Class: Svp::Change

Inherits:
Object
  • Object
show all
Defined in:
lib/svp/change.rb

Direct Known Subclasses

Add, Delete, Modify

Instance Method Summary collapse

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

#diffObject



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

#revertObject



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

#statusObject



11
12
13
# File 'lib/svp/change.rb', line 11

def status
  puts "#{self.class.name[5..5]}\t#{@work_file}"
end