Class: Weeter::Cli
- Inherits:
-
Object
- Object
- Weeter::Cli
- Defined in:
- lib/weeter/cli.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Cli
constructor
A new instance of Cli.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Cli
Returns a new instance of Cli.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/weeter/cli.rb', line 6 def initialize(args) @configuration_file = File.join(File.dirname(__FILE__), '..', '..', 'weeter.conf') args. do |opts| opts. = "Usage: #{$0} [options]" opts.on("-c", "--configuration=filename", String, "Specifies an executable ruby file containing weeter configuration", "Default: weeter.conf") do |val| @configuration_file = val end end.parse! end |
Instance Method Details
#run ⇒ Object
18 19 20 21 |
# File 'lib/weeter/cli.rb', line 18 def run load @configuration_file Weeter::Runner.new(Configuration.instance).start end |