evalhook 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.5.8 Fixed issue #9 (block variables shadowing methods)
2
+
3
+ 0.5.7 Fixed methods with multiple lines (for new versions of ruby)
4
+
1
5
  0.5.6 Removed ruby_parser dependency
2
6
 
3
7
  0.5.5 Fixed handling of method_missing
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/testtask'
6
6
 
7
7
  spec = Gem::Specification.new do |s|
8
8
  s.name = 'evalhook'
9
- s.version = '0.5.7'
9
+ s.version = '0.5.8'
10
10
  s.author = 'Dario Seminara'
11
11
  s.email = 'robertodarioseminara@gmail.com'
12
12
  s.platform = Gem::Platform::RUBY
@@ -72,7 +72,7 @@ module EvalHook
72
72
  end
73
73
 
74
74
  firstcall = nil
75
- if tree[3] == s(:arglist) or tree[3] == nil
75
+ if tree[1] == nil and (tree[3] == s(:arglist) or tree[3] == nil)
76
76
  firstcall = s(:call,
77
77
  hook_handler_reference,
78
78
  :hooked_variable_method,
@@ -0,0 +1,10 @@
1
+ require "rubygems"
2
+ require "evalhook"
3
+
4
+ describe EvalHook::HookHandler, "hook handler visitor" do
5
+ it "block paramters should not shadow method names" do
6
+ ctx = EvalHook::HookHandler.new
7
+ ctx.evalhook("(1..3).map{|to_s| 'a'.to_s}").should be == eval("(1..3).map{|to_s| 'a'.to_s}")
8
+ end
9
+ end
10
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evalhook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-19 00:00:00.000000000 Z
12
+ date: 2014-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: partialruby
16
- requirement: &78285330 !ruby/object:Gem::Requirement
16
+ requirement: &80979140 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.3'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *78285330
24
+ version_requirements: *80979140
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sexp_processor
27
- requirement: &78284200 !ruby/object:Gem::Requirement
27
+ requirement: &80978710 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '4.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *78284200
35
+ version_requirements: *80978710
36
36
  description:
37
37
  email: robertodarioseminara@gmail.com
38
38
  executables: []
@@ -55,6 +55,7 @@ files:
55
55
  - spec/hook_handler/hook_handler_hook_spec.rb
56
56
  - spec/hook_handler/hook_handler_defn_spec.rb
57
57
  - spec/hook_handler/hook_handler_ruby_spec.rb
58
+ - spec/hook_handler/hook_handler_variable_spec.rb
58
59
  - spec/hook_handler/hook_handler_defaults_spec.rb
59
60
  - spec/hook_handler/hook_handler_multiple_redirect_spec.rb
60
61
  - spec/hook_handler/hook_handler_multiple_spec.rb