Class: Bakist::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/bakist/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bakist_config=(value) ⇒ Object (writeonly)

Sets the attribute bakist_config

Parameters:

  • value

    the value to set the attribute bakist_config to.



23
24
25
# File 'lib/bakist/cli.rb', line 23

def bakist_config=(value)
  @bakist_config = value
end

Instance Method Details

#chefObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/bakist/cli.rb', line 30

def chef
  #begin
    say 'Bakist is Fetching Cookbooks', :green, true, false
    install_cookbooks if cheffile_exists?        
    say 'Bakist is Preparing to Bake', :green, true, false
    bakist_config.run_chef
  #rescue Exception => msg 
  #  say msg.backtrace.inspect  
  #  say ' Your Bakery files were not found. Please make sure ', :RED, false
  #  say '~/.bakery/', :YELLOW, false, false
  #  say ' exists', :RED, true, false
  #  say '', nil, nil, false
  #end
end

#configObject



54
55
56
# File 'lib/bakist/cli.rb', line 54

def config
  Kernel.ap(bakist_config.as_node_json)
end

#run_recipe(*recipes) ⇒ Object



48
49
50
51
# File 'lib/bakist/cli.rb', line 48

def run_recipe(*recipes)
  bakist_config.royal_crown.recipes = recipes
  chef
end