Class: Piston::Commands::LockUnlock
- Defined in:
- lib/piston/commands/lock_unlock.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
Methods inherited from Base
#force, #guess_wc, #initialize, logger, #logger, #quiet, #verbose, #working_copy!
Constructor Details
This class inherits a constructor from Piston::Commands::Base
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/piston/commands/lock_unlock.rb', line 6 def @options end |
Instance Method Details
#run(lock) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/piston/commands/lock_unlock.rb', line 8 def run(lock) working_copy = working_copy!(File.([:wcdir])) values = working_copy.recall values["lock"] = lock working_copy.remember(values, values["handler"]) working_copy.finalize text = lock ? "Locked" : "Unlocked" logger.info "#{text} #{working_copy} against automatic updates" end |