Class: Coloration::Converters::AbstractConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/coloration/converters/abstract_converter.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv = ARGV) ⇒ AbstractConverter

Returns a new instance of AbstractConverter.



17
18
19
# File 'lib/coloration/converters/abstract_converter.rb', line 17

def initialize(argv = ARGV)
  @argv = argv
end

Class Attribute Details

.in_theme_typeObject (readonly)

Returns the value of attribute in_theme_type.



10
11
12
# File 'lib/coloration/converters/abstract_converter.rb', line 10

def in_theme_type
  @in_theme_type
end

Instance Attribute Details

#inputObject

Returns the value of attribute input.



7
8
9
# File 'lib/coloration/converters/abstract_converter.rb', line 7

def input
  @input
end

#itemsObject

Returns the value of attribute items.



7
8
9
# File 'lib/coloration/converters/abstract_converter.rb', line 7

def items
  @items
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/coloration/converters/abstract_converter.rb', line 7

def name
  @name
end

#resultObject

Returns the value of attribute result.



7
8
9
# File 'lib/coloration/converters/abstract_converter.rb', line 7

def result
  @result
end

#uiObject

Returns the value of attribute ui.



7
8
9
# File 'lib/coloration/converters/abstract_converter.rb', line 7

def ui
  @ui
end

Class Method Details

.process_cmd_lineObject



13
14
15
# File 'lib/coloration/converters/abstract_converter.rb', line 13

def self.process_cmd_line
  new(ARGV).process
end

Instance Method Details

#processObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/coloration/converters/abstract_converter.rb', line 21

def process
  return usage_message unless argv.any?

  read

  parse_input

  build_result

  write

rescue Coloration::Readers::TextMateThemeReader::InvalidThemeError
  invalid_theme_message

end