Sha256: 0d3e4c9e82928e0b5902ab25bbb06797b3d77680d84c399317c238b0ff775d6d

Contents?: true

Size: 619 Bytes

Versions: 15

Compression:

Stored size: 619 Bytes

Contents

require 'optparse'

module Weeter
  class Cli

    def initialize(args)
      @configuration_file = File.join(File.dirname(__FILE__), '..', '..', 'weeter.conf')
      args.options do |opts|
        opts.banner = "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

    def run
      load @configuration_file
      Weeter::Runner.new(Configuration.instance).start
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
weeter-0.19.4 lib/weeter/cli.rb
weeter-0.19.3 lib/weeter/cli.rb
weeter-0.19.2 lib/weeter/cli.rb
weeter-0.19.1 lib/weeter/cli.rb
weeter-0.19.0 lib/weeter/cli.rb
weeter-0.18.0 lib/weeter/cli.rb
weeter-0.17.0 lib/weeter/cli.rb
weeter-0.15.0 lib/weeter/cli.rb
weeter-0.14.0 lib/weeter/cli.rb
weeter-0.13.0 lib/weeter/cli.rb
weeter-0.11.0 lib/weeter/cli.rb
weeter-0.10.0 lib/weeter/cli.rb
weeter-0.9.2 lib/weeter/cli.rb
weeter-0.9.1 lib/weeter/cli.rb
weeter-0.9.0 lib/weeter/cli.rb