Sha256: 33822aa63364324a52021b5b89f3db02cecaf7b05a50d023e123bab96e524899

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 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'
    def install
      require 'rocket_fuel/install'
      run = precheck
      if run.ok?
        RocketFuel::Install::Run.new.run
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rocket_fuel-0.0.8 lib/rocket_fuel/command_line_interface.rb
rocket_fuel-0.0.7 lib/rocket_fuel/command_line_interface.rb
rocket_fuel-0.0.6 lib/rocket_fuel/command_line_interface.rb
rocket_fuel-0.0.5 lib/rocket_fuel/command_line_interface.rb
rocket_fuel-0.0.4 lib/rocket_fuel/command_line_interface.rb
rocket_fuel-0.0.3 lib/rocket_fuel/command_line_interface.rb