Sha256: a593f7ce42476343642fc6c563cd07731e58cf971122d4d048ed91ba05dc8741

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

module RocketFuel
  class CommandLineInterface < Thor
    package_name 'rocket_fuel'

    desc 'precheck', 'check for requirements prior to installation'
    def precheck
      require 'rocket_fuel/precheck'
      say '***Rocket Fuel: Checking prerequisites***', :blue
      say ''

      RocketFuel::Precheck::Run.new.tap do |run|
        run.results
      end
    end

    desc 'fix', 'fix problems that can cause issues with running rocket fuel'
    def fix(fix)
      require 'rocket_fuel/precheck'
      require 'rocket_fuel/fix'
      if fix_class = RocketFuel::Precheck.fixes[fix.to_sym]
        the_fix = fix_class.new
        say(the_fix.title)
        say('Fixing...')
        the_fix.run
        say('')

        if the_fix.check
          if the_fix.check.ok?
            say('Fix successful.', :green)
          else
            say('Fix failed.', :red)
          end
        end
      end
    end

    desc 'install [package]', 'install rocket fuel packages'
    option :vagrant, :type => :boolean, :default => false
    option :force, :type => :boolean, :default => false
    def install
      require 'rocket_fuel/install'
      if options[:force] || precheck.ok?
        RocketFuel::Install::Run.new(options).run
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rocket_fuel-0.2.0 lib/rocket_fuel/command_line_interface.rb