Class: Perforce2Svn::Mapping::Update

Inherits:
Command show all
Defined in:
lib/perforce2svn/mapping/commands.rb

Instance Attribute Summary collapse

Attributes inherited from Operation

#line_number

Instance Method Summary collapse

Constructor Details

#initialize(tok, svn_path, live_path) ⇒ Update

Returns a new instance of Update.



51
52
53
54
55
# File 'lib/perforce2svn/mapping/commands.rb', line 51

def initialize(tok, svn_path, live_path)
  super(tok)
  @svn_path = svn_path
  @live_path = live_path
end

Instance Attribute Details

#live_pathObject (readonly)

Returns the value of attribute live_path.



50
51
52
# File 'lib/perforce2svn/mapping/commands.rb', line 50

def live_path
  @live_path
end

#svn_pathObject (readonly)

Returns the value of attribute svn_path.



50
51
52
# File 'lib/perforce2svn/mapping/commands.rb', line 50

def svn_path
  @svn_path
end

Instance Method Details

#execute!(svn_txn) ⇒ Object



57
58
59
60
61
# File 'lib/perforce2svn/mapping/commands.rb', line 57

def execute!(svn_txn)
  File.open(@live_path, 'r') do |fstream|
    svn_txn.update(@svn_path, fstream)
  end
end