Class: Svp::Change
- Inherits:
-
Object
- Object
- Svp::Change
- Defined in:
- lib/svp/change.rb
Instance Method Summary collapse
- #diff ⇒ Object
-
#initialize(work_file, base_file) ⇒ Change
constructor
A new instance of Change.
- #prepare_to_commit(p4, action = "Sending") ⇒ Object
- #revert ⇒ Object
- #rollback(p4) ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(work_file, base_file) ⇒ Change
Returns a new instance of Change.
3 4 5 |
# File 'lib/svp/change.rb', line 3 def initialize(work_file, base_file) @work_file, @base_file = work_file, base_file end |
Instance Method Details
#diff ⇒ Object
7 8 9 |
# File 'lib/svp/change.rb', line 7 def diff system("diff -Nu #{@base_file} #{@work_file}") end |
#prepare_to_commit(p4, action = "Sending") ⇒ Object
19 20 21 |
# File 'lib/svp/change.rb', line 19 def prepare_to_commit(p4, action = "Sending") puts "#{action}\t#{@work_file}" end |
#revert ⇒ Object
15 16 17 |
# File 'lib/svp/change.rb', line 15 def revert puts "Reverted\t#{@work_file}" end |
#rollback(p4) ⇒ Object
23 24 25 |
# File 'lib/svp/change.rb', line 23 def rollback(p4) p4.revert("-k #{@work_file}") end |
#status ⇒ Object
11 12 13 |
# File 'lib/svp/change.rb', line 11 def status puts "#{self.class.name[5..5]}\t#{@work_file}" end |