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