rogerdpack-arguments 0.4.7.6 → 0.4.7.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/arguments/class.rb +3 -1
- data/lib/arguments/vm.rb +1 -0
- metadata +1 -1
data/lib/arguments/class.rb
CHANGED
@@ -51,8 +51,10 @@ module NamedArgs
|
|
51
51
|
alias #{ meth } __new_#{ meth }
|
52
52
|
RUBY_EVAL
|
53
53
|
|
54
|
+
puts "wrapping #{ meth } with this code #{new_code}" if $VERBOSE
|
55
|
+
|
54
56
|
begin
|
55
|
-
klass.module_eval new_code, __FILE__, line_loc + 1
|
57
|
+
klass.module_eval new_code, __FILE__ + '.approximately', line_loc + 1
|
56
58
|
rescue SyntaxError => e
|
57
59
|
puts "warning--unable to wrap method #{ meth } -- possibly a syntax exception or it's not all on one line in 1.9 -- #{new_code}"
|
58
60
|
throw e
|
data/lib/arguments/vm.rb
CHANGED
@@ -5,6 +5,7 @@ module Arguments
|
|
5
5
|
return [] unless source and line
|
6
6
|
str = IO.readlines(source)[ line - 1 ]
|
7
7
|
return [] if str.match(/\*\w+/)
|
8
|
+
throw 'poor comma' + str if str =~ /,\W*&/
|
8
9
|
str.match(/def\s*\w+\s*\(?\s*([^)\n]*)/)[1] #This could look better
|
9
10
|
.scan(/(\w+)(?:\s*=\s*([^,]+))|(\w+)/).map{ |e| e.compact }
|
10
11
|
end
|