class Takeoff::CLI

Public Instance Methods

launch(plan = nil) click to toggle source
# File lib/takeoff/cli.rb, line 22
def launch(plan = nil)
  setup

  plan ||= ENV["RACK_ENV"] || ENV["RAILS_ENV"]
  plan = Takeoff[plan]

  options[:skip].each do |name| 
    plan.stages.delete(name) 
  end if options[:skip]

  plan.launch
end

Private Instance Methods

setup() click to toggle source
# File lib/takeoff/cli.rb, line 36
def setup
  config_path = options[:config]
  config_path ||= "./Launchfile"        if File.exist?("./Launchfile")
  config_path ||= "./config/takeoff.rb" if File.exist?("./config/takeoff.rb")

  raise "Config file not found!" unless config_path

  Takeoff.configure(File.read(config_path), config_path)
end