Class: Sambot::Commands::Cookbook
- Inherits:
-
BaseCommand
- Object
- Thor
- BaseCommand
- Sambot::Commands::Cookbook
- Defined in:
- lib/sambot/commands/cookbook.rb
Instance Method Summary collapse
Methods inherited from Thor
Instance Method Details
#build ⇒ Object
19 20 21 |
# File 'lib/sambot/commands/cookbook.rb', line 19 def build execute { Chef::Cookbook.build(config, ESSENTIAL_FILES, GENERATED_FILES) } end |
#clean ⇒ Object
14 15 16 |
# File 'lib/sambot/commands/cookbook.rb', line 14 def clean execute { Chef::Cookbook.clean(GENERATED_FILES - ['.gitignore']) } end |
#generate ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/sambot/commands/cookbook.rb', line 24 def generate execute do name = ask(' What is the name of this cookbook?') description = ask(' What does this cookbook do?') platforms = ask(' What operating system will this cookbook run on?', :limited_to => ['windows', 'centos', 'both']) type = ask(' What type of cookbook will this be?', :limited_to => ['wrapper', 'role']) platforms = platforms == 'both' ? ['centos', 'windows'] : [platforms] Chef::Cookbook.generate(config, name, platforms, type, description, ESSENTIAL_FILES, GENERATED_FILES) end end |
#register ⇒ Object
41 42 43 |
# File 'lib/sambot/commands/cookbook.rb', line 41 def register execute { Chef::Cookbook.register(config) } end |
#version ⇒ Object
36 37 38 |
# File 'lib/sambot/commands/cookbook.rb', line 36 def version execute { puts "##teamcity[buildNumber '#{config['version'].to_s}']" } end |