lib/lovely_rufus/settings.rb in lovely_rufus-0.2.0 vs lib/lovely_rufus/settings.rb in lovely_rufus-0.2.1

- old
+ new

@@ -2,13 +2,17 @@ module LovelyRufus Settings = Struct.new(:width) do def initialize(args) self.width = 72 - OptionParser.new do |opts| - opts.on('-w', '--width=WIDTH', Integer, 'Wrapping width') do |width| - self.width = width - end - end.parse! args + 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