Class: Stevenson::Application

Inherits:
Thor
  • Object
show all
Defined in:
lib/stevenson/application.rb

Instance Method Summary collapse

Instance Method Details

#generate_dotfileObject



63
64
65
66
# File 'lib/stevenson/application.rb', line 63

def generate_dotfile
  Dotfile.install
  puts "Generated dotfile at #{Dotfile.path}"
end

#new(output_directory, config_path) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/stevenson/application.rb', line 42

def new(output_directory, config_path)
  # Load the template using the template loader
  template = Stevenson::Template.load(options[:template], options)

  # Place yml files
  template.place_config(config_path)
  template.place_files(options[:data], '_data') if options[:data]

  # Run output filters, in order, against the template
  directory = Stevenson::OutputFilter.generate!(template, options)

  # Run deployers against filtered template directory
  Stevenson::Deployer.deploy(directory, options)

rescue StandardError => e
  say e.message
ensure
  template.close
end