Class: ChupaText::Command::ChupaText
- Inherits:
-
Object
- Object
- ChupaText::Command::ChupaText
- Defined in:
- lib/chupa-text/command/chupa-text.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ChupaText
constructor
A new instance of ChupaText.
- #run(*arguments) ⇒ Object
Constructor Details
#initialize ⇒ ChupaText
Returns a new instance of ChupaText.
29 30 31 32 33 |
# File 'lib/chupa-text/command/chupa-text.rb', line 29 def initialize @input = nil @configuration = Configuration.default @enable_gems = true end |
Class Method Details
.run(*arguments) ⇒ Object
23 24 25 26 |
# File 'lib/chupa-text/command/chupa-text.rb', line 23 def run(*arguments) chupa_text = new chupa_text.run(*arguments) end |
Instance Method Details
#run(*arguments) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/chupa-text/command/chupa-text.rb', line 35 def run(*arguments) return false unless parse_arguments(arguments) load_decomposers extractor = create_extractor data = create_data formatter = create_formatter formatter.format_start(data) extractor.extract(data) do |extracted| formatter.format_extracted(extracted) end formatter.format_finish(data) true end |