lib/args_parser/parser.rb in args_parser-0.0.1 vs lib/args_parser/parser.rb in args_parser-0.0.2
- old
+ new
@@ -5,11 +5,10 @@
end
class Parser
attr_reader :first
-
private
def params
@params ||=
Hash.new{|h,k|
h[k] = {
@@ -29,10 +28,10 @@
public
def initialize(argv=[], &block)
unless block_given?
raise ArgumentError, 'initialize block was not given'
end
- instance_eval &block
+ instance_eval(&block)
parse argv
end
def arg(name, description, opts={})
params[name][:default] = opts[:default]