Class: Perforce2Svn::Mapping::MappingFile
- Inherits:
-
Object
- Object
- Perforce2Svn::Mapping::MappingFile
- Defined in:
- lib/perforce2svn/mapping/mapping_file.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
-
#mappings ⇒ Object
readonly
Returns the value of attribute mappings.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(mapping_file, options) ⇒ MappingFile
constructor
A new instance of MappingFile.
Constructor Details
#initialize(mapping_file, options) ⇒ MappingFile
Returns a new instance of MappingFile.
31 32 33 34 35 36 37 38 |
# File 'lib/perforce2svn/mapping/mapping_file.rb', line 31 def initialize(mapping_file, ) load_mapping_file(mapping_file, ) analyze(mapping_file) if [:analysis_only] exit 0 end end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
29 30 31 |
# File 'lib/perforce2svn/mapping/mapping_file.rb', line 29 def @author end |
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
29 30 31 |
# File 'lib/perforce2svn/mapping/mapping_file.rb', line 29 def commands @commands end |
#mappings ⇒ Object (readonly)
Returns the value of attribute mappings.
29 30 31 |
# File 'lib/perforce2svn/mapping/mapping_file.rb', line 29 def mappings @mappings end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
29 30 31 |
# File 'lib/perforce2svn/mapping/mapping_file.rb', line 29 def @message end |
Class Method Details
.help_file ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/perforce2svn/mapping/mapping_file.rb', line 10 def self.help_file map_file = File.join(File.dirname(__FILE__), 'help.txt') contents = "" color = Choosy::Printing::Color.new File.open(map_file, 'r') do |file| file.each_line do |line| contents << if line =~ /^#/ color.blue(line) elsif line =~ /^([\w-]+)(.*)/ color.green($1) + $2 + "\n" else line end end end contents end |