rogerdpack-arguments 0.4.7.5 → 0.4.7.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/arguments/class.rb +10 -1
  2. metadata +1 -1
@@ -39,7 +39,8 @@ module NamedArgs
39
39
  end
40
40
  end
41
41
 
42
- klass.module_eval <<-RUBY_EVAL, __FILE__, __LINE__
42
+ line_loc = __LINE__
43
+ new_code = <<-RUBY_EVAL
43
44
  def __new_#{ meth } *args, &block
44
45
  opts = args.last.kind_of?( Hash ) ? args.pop : {}
45
46
  #{ assigns.join("\n") }
@@ -49,6 +50,14 @@ module NamedArgs
49
50
  alias __original_#{ meth } #{ meth }
50
51
  alias #{ meth } __new_#{ meth }
51
52
  RUBY_EVAL
53
+
54
+ begin
55
+ klass.module_eval new_code, __FILE__, line_loc + 1
56
+ rescue SyntaxError => e
57
+ 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
+ throw e
59
+ end
60
+
52
61
  end
53
62
  end
54
63
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rogerdpack-arguments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7.5
4
+ version: 0.4.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Macario Ortega