Class: TapDance::CLI
- Inherits:
-
Thor
- Object
- Thor
- TapDance::CLI
- Defined in:
- lib/tap_dance/cli.rb
Instance Attribute Summary collapse
-
#brewfile ⇒ Object
Returns the value of attribute brewfile.
-
#definition ⇒ Object
Returns the value of attribute definition.
Instance Method Summary collapse
-
#initialize(*args, &block) ⇒ CLI
constructor
A new instance of CLI.
- #install ⇒ Object
- #update(name = nil) ⇒ Object
Constructor Details
#initialize(*args, &block) ⇒ CLI
Returns a new instance of CLI.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/tap_dance/cli.rb', line 28 def initialize(*args, &block) super(*args, &block) # Activate shell output TapDance.ui = UI::Shell.new() TapDance.ui.level = "debug" if ["verbose"] # Make sure homebrew is installed unless command?(:brew) TapDance.ui.error "You haven't installed homebrew, or it isn't in your path." exit 1 end @definition = nil # Activate dry-run mode TapDance::BrewCLI.dry_run = ["dry-run"] if ["dry-run"] # Find brewfile @brewfile = ["brewfile"] @brewfile ||= "./Brewfile" @brewfile = File. @brewfile TapDance.ui.info "Brewing from #{@brewfile}" unless File.exist? @brewfile TapDance.ui.error "Nothing to brew! No Brewfile found." else TapDance.ui.info "Running `brew update` for good measure." BrewCLI.update end end |
Instance Attribute Details
#brewfile ⇒ Object
Returns the value of attribute brewfile.
25 26 27 |
# File 'lib/tap_dance/cli.rb', line 25 def brewfile @brewfile end |
#definition ⇒ Object
Returns the value of attribute definition.
26 27 28 |
# File 'lib/tap_dance/cli.rb', line 26 def definition @definition end |