Class: Makesure::System
- Inherits:
-
Object
- Object
- Makesure::System
- Defined in:
- lib/makesure/system.rb
Instance Attribute Summary collapse
-
#cmds ⇒ Object
readonly
Returns the value of attribute cmds.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#summarizes ⇒ Object
readonly
Returns the value of attribute summarizes.
-
#uid ⇒ Object
Returns the value of attribute uid.
-
#verifies ⇒ Object
readonly
Returns the value of attribute verifies.
Instance Method Summary collapse
-
#initialize(name) ⇒ System
constructor
A new instance of System.
-
#schedule(cron_spec, cmd) ⇒ Object
DSL stuff.
- #summarize(name, cron_spec, &blk) ⇒ Object
- #summarize_with_name(name) ⇒ Object
- #verify(name, cron_spec, &blk) ⇒ Object
-
#verify_with_name(name) ⇒ Object
internal use.
Constructor Details
#initialize(name) ⇒ System
Returns a new instance of System.
9 10 11 12 13 14 15 |
# File 'lib/makesure/system.rb', line 9 def initialize(name) @name = name @cmds = [] @verifies = [] @summarizes = [] end |
Instance Attribute Details
#cmds ⇒ Object (readonly)
Returns the value of attribute cmds.
5 6 7 |
# File 'lib/makesure/system.rb', line 5 def cmds @cmds end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/makesure/system.rb', line 5 def name @name end |
#summarizes ⇒ Object (readonly)
Returns the value of attribute summarizes.
5 6 7 |
# File 'lib/makesure/system.rb', line 5 def summarizes @summarizes end |
#uid ⇒ Object
Returns the value of attribute uid.
7 8 9 |
# File 'lib/makesure/system.rb', line 7 def uid @uid end |
#verifies ⇒ Object (readonly)
Returns the value of attribute verifies.
5 6 7 |
# File 'lib/makesure/system.rb', line 5 def verifies @verifies end |
Instance Method Details
#schedule(cron_spec, cmd) ⇒ Object
DSL stuff
19 20 21 22 |
# File 'lib/makesure/system.rb', line 19 def schedule(cron_spec, cmd) Makesure.debug("scheduling '#{cmd}' at '#{cron_spec}'") @cmds << Cmd.new(cron_spec, cmd) end |
#summarize(name, cron_spec, &blk) ⇒ Object
29 30 31 32 |
# File 'lib/makesure/system.rb', line 29 def summarize(name, cron_spec, &blk) Makesure.debug("scheduling summarize at '#{cron_spec}'") @summarizes << Summarize.new(name, cron_spec, blk) end |
#summarize_with_name(name) ⇒ Object
40 41 42 |
# File 'lib/makesure/system.rb', line 40 def summarize_with_name(name) summarizes.find { |s| s.name.to_s == name.to_s } end |
#verify(name, cron_spec, &blk) ⇒ Object
24 25 26 27 |
# File 'lib/makesure/system.rb', line 24 def verify(name, cron_spec, &blk) Makesure.debug("scheduling verify at '#{cron_spec}'") @verifies << Verify.new(name, cron_spec, blk) end |
#verify_with_name(name) ⇒ Object
internal use
36 37 38 |
# File 'lib/makesure/system.rb', line 36 def verify_with_name(name) verifies.find { |v| v.name.to_s == name.to_s } end |