Class: Coloration::Converters::AbstractConverter
- Defined in:
- lib/coloration/abstract_converter.rb
Direct Known Subclasses
Textmate2JEditConverter, Textmate2KatePartConverter, Textmate2VimConverter
Class Attribute Summary collapse
-
.in_theme_type ⇒ Object
readonly
Returns the value of attribute in_theme_type.
Instance Attribute Summary collapse
-
#input ⇒ Object
Returns the value of attribute input.
-
#items ⇒ Object
Returns the value of attribute items.
-
#name ⇒ Object
Returns the value of attribute name.
-
#result ⇒ Object
Returns the value of attribute result.
-
#ui ⇒ Object
Returns the value of attribute ui.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.in_theme_type ⇒ Object (readonly)
Returns the value of attribute in_theme_type.
5 6 7 |
# File 'lib/coloration/abstract_converter.rb', line 5 def in_theme_type @in_theme_type end |
Instance Attribute Details
#input ⇒ Object
Returns the value of attribute input.
4 5 6 |
# File 'lib/coloration/abstract_converter.rb', line 4 def input @input end |
#items ⇒ Object
Returns the value of attribute items.
4 5 6 |
# File 'lib/coloration/abstract_converter.rb', line 4 def items @items end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/coloration/abstract_converter.rb', line 4 def name @name end |
#result ⇒ Object
Returns the value of attribute result.
4 5 6 |
# File 'lib/coloration/abstract_converter.rb', line 4 def result @result end |
#ui ⇒ Object
Returns the value of attribute ui.
4 5 6 |
# File 'lib/coloration/abstract_converter.rb', line 4 def ui @ui end |
Class Method Details
.process_cmd_line ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/coloration/abstract_converter.rb', line 7 def self.process_cmd_line if ARGV.size > 0 begin converter = self.new converter.feed(File.read(ARGV[0])) out_filename = ARGV[1] || ARGV[0].gsub(/\.#{@in_theme_ext}$/, ".#{@out_theme_ext}") converter.convert! File.open(out_filename, "w") { |f| f.write(converter.result) } rescue Coloration::Readers::TextMateThemeReader::InvalidThemeError STDERR.puts "Err: given file doesn't look like xml plist file containing Textmate theme" end else puts "#{File.basename($0)} <in #{@in_theme_type} theme> [out #{@out_theme_type} theme]" end end |