hooked 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/hooked/hook.rb +5 -1
- data/lib/hooked/version.rb +1 -1
- metadata +78 -79
data/README.md
CHANGED
@@ -152,11 +152,11 @@ Dependencies
|
|
152
152
|
------------
|
153
153
|
|
154
154
|
* [depression](https://rubygems.org/gems/depression)
|
155
|
-
* Ruby 1.9.2
|
156
|
-
* Possibly other versions and platforms, I didn't test any yet.
|
157
155
|
* [mocha](https://rubygems.org/gems/mocha) and
|
158
156
|
[test-unit](https://rubygems.org/gems/test-unit) for development
|
159
157
|
|
158
|
+
Runs fine on Ruby 1.9.2 and JRuby 1.5.6.
|
159
|
+
|
160
160
|
To do & Ideas
|
161
161
|
-------------
|
162
162
|
|
data/lib/hooked/hook.rb
CHANGED
@@ -15,7 +15,11 @@ module Hooked
|
|
15
15
|
|
16
16
|
def call(context, hookable = nil)
|
17
17
|
raise RuntimeError, "No container set for hook `#{name}'" unless container
|
18
|
-
|
18
|
+
if hookable
|
19
|
+
container.instance_exec(context, hookable, &@block)
|
20
|
+
else
|
21
|
+
container.instance_exec(context, &@block)
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
def before?
|
data/lib/hooked/version.rb
CHANGED
metadata
CHANGED
@@ -3,65 +3,62 @@ name: hooked
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
version: 0.1.
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
|
-
- Lars Gierth
|
12
|
+
- Lars Gierth
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-13 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
version: "0"
|
57
|
-
type: :development
|
58
|
-
version_requirements: *id003
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: depression
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: test-unit
|
34
|
+
prerelease: false
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
41
|
+
version: "0"
|
42
|
+
type: :development
|
43
|
+
version_requirements: *id002
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: mocha
|
46
|
+
prerelease: false
|
47
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
segments:
|
52
|
+
- 0
|
53
|
+
version: "0"
|
54
|
+
type: :development
|
55
|
+
version_requirements: *id003
|
59
56
|
description: |-
|
60
57
|
Hooked makes AOP a breeze. It lets you define and invoke
|
61
58
|
code that gems or other parts of your application can hook
|
62
59
|
onto.
|
63
60
|
email:
|
64
|
-
- lars.gierth@gmail.com
|
61
|
+
- lars.gierth@gmail.com
|
65
62
|
executables: []
|
66
63
|
|
67
64
|
extensions: []
|
@@ -69,23 +66,23 @@ extensions: []
|
|
69
66
|
extra_rdoc_files: []
|
70
67
|
|
71
68
|
files:
|
72
|
-
- Gemfile
|
73
|
-
- LICENSE
|
74
|
-
- README.md
|
75
|
-
- Rakefile
|
76
|
-
- hooked.gemspec
|
77
|
-
- lib/hooked.rb
|
78
|
-
- lib/hooked/container.rb
|
79
|
-
- lib/hooked/context.rb
|
80
|
-
- lib/hooked/controller.rb
|
81
|
-
- lib/hooked/hook.rb
|
82
|
-
- lib/hooked/hookable.rb
|
83
|
-
- lib/hooked/version.rb
|
84
|
-
- test/container_test.rb
|
85
|
-
- test/controller_test.rb
|
86
|
-
- test/helper.rb
|
87
|
-
- test/hook_test.rb
|
88
|
-
- test/hookable_test.rb
|
69
|
+
- Gemfile
|
70
|
+
- LICENSE
|
71
|
+
- README.md
|
72
|
+
- Rakefile
|
73
|
+
- hooked.gemspec
|
74
|
+
- lib/hooked.rb
|
75
|
+
- lib/hooked/container.rb
|
76
|
+
- lib/hooked/context.rb
|
77
|
+
- lib/hooked/controller.rb
|
78
|
+
- lib/hooked/hook.rb
|
79
|
+
- lib/hooked/hookable.rb
|
80
|
+
- lib/hooked/version.rb
|
81
|
+
- test/container_test.rb
|
82
|
+
- test/controller_test.rb
|
83
|
+
- test/helper.rb
|
84
|
+
- test/hook_test.rb
|
85
|
+
- test/hookable_test.rb
|
89
86
|
has_rdoc: true
|
90
87
|
homepage: http://rubygems.org/gems/hooked
|
91
88
|
licenses: []
|
@@ -94,29 +91,31 @@ post_install_message:
|
|
94
91
|
rdoc_options: []
|
95
92
|
|
96
93
|
require_paths:
|
97
|
-
- lib
|
94
|
+
- lib
|
98
95
|
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
-
none: false
|
100
96
|
requirements:
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
version: "0"
|
106
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
-
none: false
|
108
103
|
requirements:
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
114
109
|
requirements: []
|
115
110
|
|
116
111
|
rubyforge_project:
|
117
|
-
rubygems_version: 1.3.
|
112
|
+
rubygems_version: 1.3.6
|
118
113
|
signing_key:
|
119
114
|
specification_version: 3
|
120
115
|
summary: Ruby Library For Aspect Oriented Programming
|
121
|
-
test_files:
|
122
|
-
|
116
|
+
test_files:
|
117
|
+
- test/container_test.rb
|
118
|
+
- test/controller_test.rb
|
119
|
+
- test/helper.rb
|
120
|
+
- test/hook_test.rb
|
121
|
+
- test/hookable_test.rb
|