Class: Piston::Commands::Lock
- Inherits:
-
Piston::Command
- Object
- Piston::Command
- Piston::Commands::Lock
- Defined in:
- lib/piston/commands/lock.rb
Instance Attribute Summary
Attributes inherited from Piston::Command
#args, #dry_run, #force, #lock, #logging_stream, #quiet, #recursive, #revision, #show_updates, #verbose
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Piston::Command
#find_targets, #initialize, #skip, #svn
Constructor Details
This class inherits a constructor from Piston::Command
Class Method Details
.detailed_help ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/piston/commands/lock.rb', line 21 def self.detailed_help <<EOF usage: lock DIR [DIR [...]] Locked folders will not be updated to the latest revision when updating. EOF end |
.help ⇒ Object
17 18 19 |
# File 'lib/piston/commands/lock.rb', line 17 def self.help "Lock one or more folders to their current revision" end |
Instance Method Details
#run ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/piston/commands/lock.rb', line 7 def run raise Piston::CommandError, "No targets to run against" if args.empty? args.each do |dir| remote_rev = svn(:propget, Piston::REMOTE_REV, dir).chomp.to_i svn :propset, Piston::LOCKED, remote_rev, dir logging_stream.puts "'#{dir}' locked at revision #{remote_rev}" end end |