evalhook 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ 0.5.1 Fixed compatibility issues with sexp_processor, ruby_parser and ruby2ruby
2
+
1
3
  0.5.0 Implemented code packets (see documentation)
2
4
 
3
5
  Refactor of hooking of call, super and zsuper nodes to improve performance
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/gempackagetask'
6
6
 
7
7
  spec = Gem::Specification.new do |s|
8
8
  s.name = 'evalhook'
9
- s.version = '0.5.0'
9
+ s.version = '0.5.1'
10
10
  s.author = 'Dario Seminara'
11
11
  s.email = 'robertodarioseminara@gmail.com'
12
12
  s.platform = Gem::Platform::RUBY
@@ -71,8 +71,7 @@ module EvalHook
71
71
  receiver = process(original_receiver|| s(:self))
72
72
 
73
73
  firstcall = nil
74
-
75
- if tree[3] == s(:arglist)
74
+ if tree[3] == s(:arglist) or tree[3] == nil
76
75
  firstcall = s(:call,
77
76
  hook_handler_reference,
78
77
  :hooked_variable_method,
@@ -86,7 +85,7 @@ module EvalHook
86
85
  )
87
86
  end
88
87
 
89
- s(:call, firstcall, :call, process(tree[3]))
88
+ s(:call, firstcall, :call, process(tree[3]) || s(:arglist))
90
89
  end
91
90
 
92
91
  def process_cdecl(tree)
@@ -137,7 +136,11 @@ module EvalHook
137
136
  end
138
137
 
139
138
  class_scope(nil) {
140
- s(:module, module_name_tree, process(tree[2]))
139
+ module_tree = s(:module, module_name_tree)
140
+ tree[2..-1].each do |subtree|
141
+ module_tree << process(subtree)
142
+ end
143
+ module_tree
141
144
  }
142
145
  end
143
146
 
@@ -158,11 +161,15 @@ module EvalHook
158
161
 
159
162
  if tree[2]
160
163
  class_scope(tree[1]) do
161
- s(:class, class_name_tree, process(tree[2]), process(tree[3]))
164
+ class_tree = s(:class, class_name_tree, process(tree[2]))
165
+ tree[3..-1].map(&method(:process)).each(&class_tree.method(:<<))
166
+ class_tree
162
167
  end
163
168
  else
164
169
  class_scope(tree[1]) do
165
- s(:class, class_name_tree, nil, process(tree[3]))
170
+ class_tree = s(:class, class_name_tree, nil)
171
+ tree[3..-1].map(&method(:process)).each(&class_tree.method(:<<))
172
+ class_tree
166
173
  end
167
174
  end
168
175
  end
data/lib/evalhook.rb CHANGED
@@ -299,4 +299,4 @@ module EvalHook
299
299
  class << self
300
300
  include ModuleMethods
301
301
  end
302
- end
302
+ end
metadata CHANGED
@@ -1,81 +1,62 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: evalhook
3
- version: !ruby/object:Gem::Version
4
- hash: 11
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 5
9
- - 0
10
- version: 0.5.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.1
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Dario Seminara
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-06-20 00:00:00 -03:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-11-30 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: partialruby
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &84634220 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 23
30
- segments:
31
- - 0
32
- - 2
33
- - 0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
34
21
  version: 0.2.0
35
22
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: ruby_parser
39
23
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *84634220
25
+ - !ruby/object:Gem::Dependency
26
+ name: ruby_parser
27
+ requirement: &84633980 !ruby/object:Gem::Requirement
41
28
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 3
46
- segments:
47
- - 2
48
- - 0
49
- - 6
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
50
32
  version: 2.0.6
51
33
  type: :runtime
52
- version_requirements: *id002
34
+ prerelease: false
35
+ version_requirements: *84633980
53
36
  description:
54
37
  email: robertodarioseminara@gmail.com
55
38
  executables: []
56
-
57
39
  extensions: []
58
-
59
- extra_rdoc_files:
40
+ extra_rdoc_files:
60
41
  - README
61
- files:
62
- - examples/example1.rb
42
+ files:
43
+ - examples/example2.rb
63
44
  - examples/example3.rb
64
45
  - examples/example5.rb
65
46
  - examples/example4.rb
66
- - examples/example2.rb
67
- - lib/evalhook/multi_hook_handler.rb
68
- - lib/evalhook/tree_processor.rb
69
- - lib/evalhook/redirect_helper.rb
47
+ - examples/example1.rb
70
48
  - lib/evalhook.rb
49
+ - lib/evalhook/redirect_helper.rb
50
+ - lib/evalhook/tree_processor.rb
51
+ - lib/evalhook/multi_hook_handler.rb
52
+ - spec/hook_handler/hook_handler_visitor_spec.rb
71
53
  - spec/hook_handler/hook_handler_arguments_spec.rb
54
+ - spec/hook_handler/hook_handler_package_spec.rb
72
55
  - spec/hook_handler/hook_handler_hook_spec.rb
73
- - spec/hook_handler/hook_handler_multiple_redirect_spec.rb
74
- - spec/hook_handler/hook_handler_multiple_spec.rb
75
- - spec/hook_handler/hook_handler_visitor_spec.rb
76
56
  - spec/hook_handler/hook_handler_ruby_spec.rb
77
- - spec/hook_handler/hook_handler_package_spec.rb
78
57
  - spec/hook_handler/hook_handler_defaults_spec.rb
58
+ - spec/hook_handler/hook_handler_multiple_redirect_spec.rb
59
+ - spec/hook_handler/hook_handler_multiple_spec.rb
79
60
  - spec/validation/hook_handler_spec.rb
80
61
  - LICENSE
81
62
  - AUTHORS
@@ -83,40 +64,30 @@ files:
83
64
  - README
84
65
  - Rakefile
85
66
  - TODO
86
- has_rdoc: true
87
67
  homepage: http://github.com/tario/evalhook
88
68
  licenses: []
89
-
90
69
  post_install_message:
91
- rdoc_options:
70
+ rdoc_options:
92
71
  - --main
93
72
  - README
94
- require_paths:
73
+ require_paths:
95
74
  - lib
96
- required_ruby_version: !ruby/object:Gem::Requirement
75
+ required_ruby_version: !ruby/object:Gem::Requirement
97
76
  none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- hash: 3
102
- segments:
103
- - 0
104
- version: "0"
105
- required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ! '>='
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
82
  none: false
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- hash: 3
111
- segments:
112
- - 0
113
- version: "0"
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
114
87
  requirements: []
115
-
116
88
  rubyforge_project:
117
- rubygems_version: 1.3.7
89
+ rubygems_version: 1.8.10
118
90
  signing_key:
119
91
  specification_version: 3
120
92
  summary: Alternate eval which hook all methods executed in the evaluated code
121
93
  test_files: []
122
-