Class: PutText::Cmdline
- Inherits:
-
Object
- Object
- PutText::Cmdline
- Defined in:
- lib/puttext/cmdline.rb
Constant Summary collapse
- USAGE_TEXT =
'Usage: puttext LOCATION [options]'.freeze
Class Method Summary collapse
-
.run(args) ⇒ Object
Run the commmand line tool puttext.
Instance Method Summary collapse
-
#run(args) ⇒ Object
Run the commmand line tool puttext.
Class Method Details
.run(args) ⇒ Object
Run the commmand line tool puttext.
12 13 14 |
# File 'lib/puttext/cmdline.rb', line 12 def self.run(args) new.run(args) end |
Instance Method Details
#run(args) ⇒ Object
Run the commmand line tool puttext.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/puttext/cmdline.rb', line 18 def run(args) = parse_args(args) po_file = Extractor.new.extract([:path]) if [:output_file] with_output_file([:output_file]) { |f| po_file.write_to(f) } else po_file.write_to(STDOUT) end rescue => e error(e) end |