Class: Guard::Chef::Base
- Inherits:
-
Object
- Object
- Guard::Chef::Base
- Defined in:
- lib/guard/chef/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target, name) ⇒ Base
constructor
A new instance of Base.
- #kind ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(target, name) ⇒ Base
Returns a new instance of Base.
4 5 6 |
# File 'lib/guard/chef/base.rb', line 4 def initialize(target, name) @target, @name = target, name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/guard/chef/base.rb', line 2 def name @name end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
2 3 4 |
# File 'lib/guard/chef/base.rb', line 2 def target @target end |
Class Method Details
.accepts?(path, extension) ⇒ Boolean
8 9 10 |
# File 'lib/guard/chef/base.rb', line 8 def self.accepts?(path, extension) true end |
Instance Method Details
#kind ⇒ Object
12 13 14 |
# File 'lib/guard/chef/base.rb', line 12 def kind self.class.to_s.gsub(/Job/, '').downcase end |
#update ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/guard/chef/base.rb', line 16 def update puts "uploading changed #{kind} '#{target}'. Please wait." output = `#{command}` if output =~ sentinel_re puts "#{kind} '#{name}' uploaded." true else puts "#{kind} '#{name}' could not be uploaded." false end end |