Class: Perforce2Svn::Mapping::BranchMapping
- Defined in:
- lib/perforce2svn/mapping/branch_mapping.rb
Instance Attribute Summary collapse
-
#p4_path ⇒ Object
readonly
Returns the value of attribute p4_path.
-
#svn_path ⇒ Object
readonly
Returns the value of attribute svn_path.
Attributes inherited from Operation
Instance Method Summary collapse
-
#initialize(tok, p4_path, svn_path) ⇒ BranchMapping
constructor
A new instance of BranchMapping.
- #matches_perforce_path?(other_p4_path) ⇒ Boolean
- #p4_dotted ⇒ Object
- #to_svn_path(other_p4_path) ⇒ Object
Constructor Details
#initialize(tok, p4_path, svn_path) ⇒ BranchMapping
Returns a new instance of BranchMapping.
8 9 10 11 12 13 |
# File 'lib/perforce2svn/mapping/branch_mapping.rb', line 8 def initialize(tok, p4_path, svn_path) super(tok) @p4_path = p4_path @svn_path = svn_path @path_match = /^#{@p4_path}/ end |
Instance Attribute Details
#p4_path ⇒ Object (readonly)
Returns the value of attribute p4_path.
6 7 8 |
# File 'lib/perforce2svn/mapping/branch_mapping.rb', line 6 def p4_path @p4_path end |
#svn_path ⇒ Object (readonly)
Returns the value of attribute svn_path.
6 7 8 |
# File 'lib/perforce2svn/mapping/branch_mapping.rb', line 6 def svn_path @svn_path end |
Instance Method Details
#matches_perforce_path?(other_p4_path) ⇒ Boolean
19 20 21 |
# File 'lib/perforce2svn/mapping/branch_mapping.rb', line 19 def matches_perforce_path?(other_p4_path) (other_p4_path =~ @path_match) != nil end |
#p4_dotted ⇒ Object
15 16 17 |
# File 'lib/perforce2svn/mapping/branch_mapping.rb', line 15 def p4_dotted @p4_path + '...' end |
#to_svn_path(other_p4_path) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/perforce2svn/mapping/branch_mapping.rb', line 23 def to_svn_path(other_p4_path) opath = other_p4_path.gsub(p4_path, svn_path) opath.gsub!("%40", "@") opath.gsub!("%23", "#") opath.gsub!("%2a", "*") opath.gsub!("%25", "%") opath end |