Class: Kaimono::Command
- Inherits:
-
Object
- Object
- Kaimono::Command
- Defined in:
- lib/kaimono/command.rb
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(argv) ⇒ Command
constructor
A new instance of Command.
- #output_html ⇒ Object
Constructor Details
#initialize(argv) ⇒ Command
Returns a new instance of Command.
9 10 11 12 13 |
# File 'lib/kaimono/command.rb', line 9 def initialize(argv) @argv = argv @kaimono_list = Kaimono::Options.new = @kaimono_list.parse(@argv) end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
3 4 5 |
# File 'lib/kaimono/command.rb', line 3 def opts @opts end |
Class Method Details
.run(argv) ⇒ Object
5 6 7 |
# File 'lib/kaimono/command.rb', line 5 def self.run(argv) new(argv).execute end |
Instance Method Details
#execute ⇒ Object
23 24 25 26 |
# File 'lib/kaimono/command.rb', line 23 def execute puts @kaimono_list.to_s output_html end |
#output_html ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/kaimono/command.rb', line 15 def output_html html_file = @kaimono_list.filename + ".html" File.open(html_file, "w") do |w| w.puts @kaimono_list.to_html end puts "output HTML => #{html_file}" end |