class Stevenson::Application

Public Instance Methods

generate_dotfile() click to toggle source
# File lib/stevenson/application.rb, line 77
def generate_dotfile
  Dotfile.install
  puts "Generated dotfile at #{Dotfile.path}"
end
new(output_directory, config_path) click to toggle source
# File lib/stevenson/application.rb, line 47
def new(output_directory, config_path)
  if options[:private_template]
    template_url, git_username, git_password = options[:private_template]
    git_username ||= ENV["GITHUB_SERVICE_ACCOUNT_USERNAME"]
    git_password ||= ENV["GITHUB_SERVICE_ACCOUNT_PASSWORD"]
    template = template_url.gsub("github", "#{git_username}:#{git_password}@github")
  else
    template = options[:template]
  end

  # Load the template using the template loader
  template = Stevenson::Template.load(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 Stevenson::Error => e
  say e.message
ensure
  template.close if template
end