Class: KnifeTable::TableSet
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- KnifeTable::TableSet
- Includes:
- Helpers
- Defined in:
- lib/chef/knife/table_set.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ TableSet
constructor
A new instance of TableSet.
- #run ⇒ Object
Methods included from Helpers
Constructor Details
#initialize(*args) ⇒ TableSet
Returns a new instance of TableSet.
32 33 34 35 |
# File 'lib/chef/knife/table_set.rb', line 32 def initialize(*args) super @cookbooks = config[:cookbooks].to_s.split(',').map(&:strip) end |
Instance Method Details
#run ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/chef/knife/table_set.rb', line 37 def run ui.msg ui.highline.color("#{' ' * 10}** Knife Table: New place setting **", [HighLine::GREEN, HighLine::BOLD]) branch_name = "#{config[:branch_prefix]}#{name_args.join('_').downcase}" ui.highline.say "Creating new work branch (#{branch_name}): " git.branch(branch_name).create ui.highline.say "done" git.checkout(branch_name) unless(@cookbooks.empty?) bumper = KnifeSpork::SporkBump.new @cookbooks.each do |cookbook| bumper.patch(cookbook_path, cookbook, config[:bump_type]) end end end |