Sha256: 8f45bab6fc437293d1fd14d99475b55ba56d98a102a9b7bfe61960bdc2b4aa6c

Contents?: true

Size: 345 Bytes

Versions: 5

Compression:

Stored size: 345 Bytes

Contents

require 'optparse'

module LovelyRufus
  Settings = Struct.new(:width) do
    def initialize(args)
      self.width = 72
      OptionParser.new(&method(:parse)).parse! args
    end

    private

    def parse(opts)
      opts.on('-w', '--width=WIDTH', Integer, 'Wrapping width') do |width|
        self.width = width
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lovely_rufus-1.0.0 lib/lovely_rufus/settings.rb
lovely_rufus-0.3.2 lib/lovely_rufus/settings.rb
lovely_rufus-0.3.1 lib/lovely_rufus/settings.rb
lovely_rufus-0.3.0 lib/lovely_rufus/settings.rb
lovely_rufus-0.2.1 lib/lovely_rufus/settings.rb