Class: CookbookJob
- Inherits:
-
Object
- Object
- CookbookJob
- Defined in:
- lib/guard/chef/cookbook_job.rb
Instance Method Summary collapse
- #base_cmd ⇒ Object
-
#initialize(base_dir, target) ⇒ CookbookJob
constructor
A new instance of CookbookJob.
- #target ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(base_dir, target) ⇒ CookbookJob
Returns a new instance of CookbookJob.
2 3 4 |
# File 'lib/guard/chef/cookbook_job.rb', line 2 def initialize(base_dir, target) @base_dir, @target = base_dir, target end |
Instance Method Details
#base_cmd ⇒ Object
6 7 8 |
# File 'lib/guard/chef/cookbook_job.rb', line 6 def base_cmd "cd #{@base_dir}" end |
#target ⇒ Object
10 11 12 |
# File 'lib/guard/chef/cookbook_job.rb', line 10 def target @target end |
#update ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/guard/chef/cookbook_job.rb', line 14 def update puts "uploading changed cookbook. (#{target}) Please wait." if /upload complete/ =~ `#{base_cmd} && rake upload_cookbook[#{target}]` puts "cookbook (#{target}) uploaded." true else puts "cookbook (#{target}) could not be uploaded." false end end |