Sha256: 29806f15768fe4ebf7b571174d81f219e948908a4ad2664cd9adc999c186f809

Contents?: true

Size: 558 Bytes

Versions: 6

Compression:

Stored size: 558 Bytes

Contents

require 'optparse'

module Vedeu
  class Configuration
    def self.configure(args = [])
      new(args).configure
    end

    def initialize(args = [])
      @args    = args
      @options = {}
    end

    def configure
      parser = OptionParser.new do |opts|
        opts.banner = "Usage: #{$PROGRAM_NAME} [options]"

        opts.on('-1', '--run-once', 'Run application once.') do
          @options[:interactive] = false
        end
      end
      parser.parse!(args)

      options
    end

    private

    attr_accessor :args, :options
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.0.36 lib/vedeu/configuration.rb
vedeu-0.0.35 lib/vedeu/configuration.rb
vedeu-0.0.34 lib/vedeu/configuration.rb
vedeu-0.0.33 lib/vedeu/configuration.rb
vedeu-0.0.32 lib/vedeu/configuration.rb
vedeu-0.0.31 lib/vedeu/configuration.rb