proxeze 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +7 -2
- data/Gemfile.lock +12 -0
- data/README.rdoc +9 -10
- data/VERSION +1 -1
- data/proxeze.gemspec +14 -4
- metadata +202 -142
data/Gemfile
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
group :development do
|
4
|
-
|
4
|
+
platforms :mri_19 do
|
5
5
|
gem "ruby-debug19"
|
6
|
-
|
6
|
+
end
|
7
|
+
platforms :mri_18 do
|
8
|
+
gem 'ruby-debug'
|
9
|
+
end
|
10
|
+
platforms :jruby do
|
11
|
+
gem 'jruby-openssl'
|
7
12
|
gem 'ruby-debug'
|
8
13
|
end
|
9
14
|
gem "rspec", "~> 2.4.0"
|
data/Gemfile.lock
CHANGED
@@ -2,6 +2,7 @@ GEM
|
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
4
|
archive-tar-minitar (0.5.2)
|
5
|
+
bouncy-castle-java (1.5.0145.2)
|
5
6
|
columnize (0.3.2)
|
6
7
|
diff-lcs (1.1.2)
|
7
8
|
git (1.2.5)
|
@@ -9,6 +10,9 @@ GEM
|
|
9
10
|
bundler (~> 1.0.0)
|
10
11
|
git (>= 1.2.5)
|
11
12
|
rake
|
13
|
+
jruby-openssl (0.7.3)
|
14
|
+
bouncy-castle-java
|
15
|
+
linecache (0.43)
|
12
16
|
linecache19 (0.5.11)
|
13
17
|
ruby_core_source (>= 0.1.4)
|
14
18
|
rake (0.8.7)
|
@@ -22,6 +26,12 @@ GEM
|
|
22
26
|
rspec-expectations (2.4.0)
|
23
27
|
diff-lcs (~> 1.1.2)
|
24
28
|
rspec-mocks (2.4.0)
|
29
|
+
ruby-debug (0.10.4)
|
30
|
+
columnize (>= 0.1)
|
31
|
+
ruby-debug-base (~> 0.10.4.0)
|
32
|
+
ruby-debug-base (0.10.4)
|
33
|
+
linecache (>= 0.3)
|
34
|
+
ruby-debug-base (0.10.4-java)
|
25
35
|
ruby-debug-base19 (0.11.24)
|
26
36
|
columnize (>= 0.3.1)
|
27
37
|
linecache19 (>= 0.5.11)
|
@@ -40,6 +50,8 @@ PLATFORMS
|
|
40
50
|
DEPENDENCIES
|
41
51
|
bundler (~> 1.0.0)
|
42
52
|
jeweler (~> 1.5.2)
|
53
|
+
jruby-openssl
|
43
54
|
rcov
|
44
55
|
rspec (~> 2.4.0)
|
56
|
+
ruby-debug
|
45
57
|
ruby-debug19
|
data/README.rdoc
CHANGED
@@ -33,10 +33,10 @@ Examples tell it best... In this example we have a tree structure of Categories.
|
|
33
33
|
c6.categories << Category.new('8')
|
34
34
|
|
35
35
|
# now we have a tree like this:
|
36
|
-
#
|
37
|
-
#
|
38
|
-
# ||
|
39
|
-
# c2
|
36
|
+
# c1
|
37
|
+
# ___||___
|
38
|
+
# || ||
|
39
|
+
# c2 c3
|
40
40
|
# ____||____
|
41
41
|
# || || ||
|
42
42
|
# c4 c5 c6
|
@@ -70,12 +70,15 @@ Let's say we need to be able to hide c6 and its children at some point, to do th
|
|
70
70
|
|
71
71
|
So, we've added behavior to the proxied objects, but not the Category objects themselves.
|
72
72
|
|
73
|
-
You can also proxy an object without overriding the #new method on its class
|
73
|
+
You can also proxy an object without overriding the #new method on its class. This is particularly useful if you have an object that you want to proxy, but you aren't able (or don't want) to proxy every instance of the class.
|
74
|
+
|
75
|
+
In this example, you can't define Fixnum>>#new, so if you need a proxy for Fixnums here's how you do it
|
74
76
|
|
75
77
|
p = Proxeze.for(1)
|
76
78
|
p.class # Proxeze::Fixnum
|
77
79
|
p.__getobj__.class # Fixnum
|
78
80
|
|
81
|
+
Here, we don't want all instances of A being proxied, but we do need a proxy for a particular instance of it:
|
79
82
|
class A
|
80
83
|
attr_accessor :foo
|
81
84
|
def initialize; @foo = 1; end
|
@@ -85,11 +88,7 @@ You can also proxy an object without overriding the #new method on its class:
|
|
85
88
|
p.class # => Proxeze::A
|
86
89
|
p.__getobj__.class # => A
|
87
90
|
|
88
|
-
|
89
|
-
|
90
|
-
p = Proxeze.for(A.new)
|
91
|
-
p.class # => Proxeze::A
|
92
|
-
p.__getobj__.class # => A
|
91
|
+
Of course, you can proxy the class and all subsequent instances even after you've proxied a specific instance:
|
93
92
|
|
94
93
|
Proxeze.proxeze A
|
95
94
|
a = A.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/proxeze.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{proxeze}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jason Rogers"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-03}
|
13
13
|
s.description = %q{A basic proxy/delegate framework for Ruby that will allow you to wrap any object with a proxy instance. For more information about the Proxy and Delegate patterns, check out http://en.wikipedia.org/wiki/Proxy_pattern and http://en.wikipedia.org/wiki/Delegation_pattern respectively.}
|
14
14
|
s.email = %q{jacaetevha@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
s.homepage = %q{http://github.com/jacaetevha/proxeze}
|
41
41
|
s.licenses = ["MIT"]
|
42
42
|
s.require_paths = ["lib"]
|
43
|
-
s.rubygems_version = %q{1.
|
43
|
+
s.rubygems_version = %q{1.3.6}
|
44
44
|
s.summary = %q{A basic proxy/delegate framework for Ruby that will allow you to wrap any object with a proxy instance.}
|
45
45
|
s.test_files = [
|
46
46
|
"examples/sinatra/app.rb",
|
@@ -50,10 +50,14 @@ Gem::Specification.new do |s|
|
|
50
50
|
]
|
51
51
|
|
52
52
|
if s.respond_to? :specification_version then
|
53
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
53
54
|
s.specification_version = 3
|
54
55
|
|
55
|
-
if Gem::Version.new(Gem::
|
56
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
56
57
|
s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
|
58
|
+
s.add_development_dependency(%q<ruby-debug>, [">= 0"])
|
59
|
+
s.add_development_dependency(%q<jruby-openssl>, [">= 0"])
|
60
|
+
s.add_development_dependency(%q<ruby-debug>, [">= 0"])
|
57
61
|
s.add_development_dependency(%q<rspec>, ["~> 2.4.0"])
|
58
62
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
59
63
|
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
@@ -64,6 +68,9 @@ Gem::Specification.new do |s|
|
|
64
68
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
65
69
|
else
|
66
70
|
s.add_dependency(%q<ruby-debug19>, [">= 0"])
|
71
|
+
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
72
|
+
s.add_dependency(%q<jruby-openssl>, [">= 0"])
|
73
|
+
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
67
74
|
s.add_dependency(%q<rspec>, ["~> 2.4.0"])
|
68
75
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
69
76
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
@@ -75,6 +82,9 @@ Gem::Specification.new do |s|
|
|
75
82
|
end
|
76
83
|
else
|
77
84
|
s.add_dependency(%q<ruby-debug19>, [">= 0"])
|
85
|
+
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
86
|
+
s.add_dependency(%q<jruby-openssl>, [">= 0"])
|
87
|
+
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
78
88
|
s.add_dependency(%q<rspec>, ["~> 2.4.0"])
|
79
89
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
80
90
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
metadata
CHANGED
@@ -1,117 +1,178 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxeze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 4
|
8
|
+
- 0
|
9
|
+
version: 0.4.0
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
|
-
- Jason Rogers
|
12
|
+
- Jason Rogers
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
16
|
|
13
|
-
date: 2011-02-
|
17
|
+
date: 2011-02-03 00:00:00 -05:00
|
14
18
|
default_executable:
|
15
19
|
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: ruby-debug19
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
segments:
|
27
|
+
- 0
|
28
|
+
version: "0"
|
29
|
+
requirement: *id001
|
30
|
+
prerelease: false
|
31
|
+
type: :development
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: ruby-debug
|
34
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
segments:
|
39
|
+
- 0
|
40
|
+
version: "0"
|
41
|
+
requirement: *id002
|
42
|
+
prerelease: false
|
43
|
+
type: :development
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: jruby-openssl
|
46
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
segments:
|
51
|
+
- 0
|
52
|
+
version: "0"
|
53
|
+
requirement: *id003
|
54
|
+
prerelease: false
|
55
|
+
type: :development
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: ruby-debug
|
58
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
segments:
|
63
|
+
- 0
|
64
|
+
version: "0"
|
65
|
+
requirement: *id004
|
66
|
+
prerelease: false
|
67
|
+
type: :development
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: rspec
|
70
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ~>
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
segments:
|
75
|
+
- 2
|
76
|
+
- 4
|
77
|
+
- 0
|
78
|
+
version: 2.4.0
|
79
|
+
requirement: *id005
|
80
|
+
prerelease: false
|
81
|
+
type: :development
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: bundler
|
84
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
segments:
|
89
|
+
- 1
|
90
|
+
- 0
|
91
|
+
- 0
|
92
|
+
version: 1.0.0
|
93
|
+
requirement: *id006
|
94
|
+
prerelease: false
|
95
|
+
type: :development
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: jeweler
|
98
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ~>
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
segments:
|
103
|
+
- 1
|
104
|
+
- 5
|
105
|
+
- 2
|
106
|
+
version: 1.5.2
|
107
|
+
requirement: *id007
|
108
|
+
prerelease: false
|
109
|
+
type: :development
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: rcov
|
112
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
version: "0"
|
119
|
+
requirement: *id008
|
120
|
+
prerelease: false
|
121
|
+
type: :development
|
122
|
+
- !ruby/object:Gem::Dependency
|
123
|
+
name: rspec
|
124
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ~>
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
segments:
|
129
|
+
- 2
|
130
|
+
- 4
|
131
|
+
- 0
|
132
|
+
version: 2.4.0
|
133
|
+
requirement: *id009
|
134
|
+
prerelease: false
|
135
|
+
type: :development
|
136
|
+
- !ruby/object:Gem::Dependency
|
137
|
+
name: bundler
|
138
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - ~>
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
segments:
|
143
|
+
- 1
|
144
|
+
- 0
|
145
|
+
- 0
|
146
|
+
version: 1.0.0
|
147
|
+
requirement: *id010
|
148
|
+
prerelease: false
|
149
|
+
type: :development
|
150
|
+
- !ruby/object:Gem::Dependency
|
151
|
+
name: jeweler
|
152
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ~>
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
segments:
|
157
|
+
- 1
|
158
|
+
- 5
|
159
|
+
- 2
|
160
|
+
version: 1.5.2
|
161
|
+
requirement: *id011
|
162
|
+
prerelease: false
|
163
|
+
type: :development
|
164
|
+
- !ruby/object:Gem::Dependency
|
165
|
+
name: rcov
|
166
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
segments:
|
171
|
+
- 0
|
172
|
+
version: "0"
|
173
|
+
requirement: *id012
|
174
|
+
prerelease: false
|
175
|
+
type: :development
|
115
176
|
description: A basic proxy/delegate framework for Ruby that will allow you to wrap any object with a proxy instance. For more information about the Proxy and Delegate patterns, check out http://en.wikipedia.org/wiki/Proxy_pattern and http://en.wikipedia.org/wiki/Delegation_pattern respectively.
|
116
177
|
email: jacaetevha@gmail.com
|
117
178
|
executables: []
|
@@ -119,61 +180,60 @@ executables: []
|
|
119
180
|
extensions: []
|
120
181
|
|
121
182
|
extra_rdoc_files:
|
122
|
-
- LICENSE.txt
|
123
|
-
- README.rdoc
|
183
|
+
- LICENSE.txt
|
184
|
+
- README.rdoc
|
124
185
|
files:
|
125
|
-
- Gemfile
|
126
|
-
- Gemfile.lock
|
127
|
-
- LICENSE.txt
|
128
|
-
- README.rdoc
|
129
|
-
- Rakefile
|
130
|
-
- VERSION
|
131
|
-
- examples/sinatra/app.rb
|
132
|
-
- examples/sinatra/config.ru
|
133
|
-
- examples/sinatra/public/app.css
|
134
|
-
- examples/sinatra/public/app.js
|
135
|
-
- examples/sinatra/public/favicon.ico
|
136
|
-
- examples/sinatra/public/nested_directory/file_inside_nested_directory.txt
|
137
|
-
- examples/sinatra/views/index.haml
|
138
|
-
- examples/sinatra/views/layout.haml
|
139
|
-
- lib/proxeze.rb
|
140
|
-
- proxeze.gemspec
|
141
|
-
- spec/definitions.rb
|
142
|
-
- spec/proxeze_spec.rb
|
143
|
-
- spec/spec_helper.rb
|
186
|
+
- Gemfile
|
187
|
+
- Gemfile.lock
|
188
|
+
- LICENSE.txt
|
189
|
+
- README.rdoc
|
190
|
+
- Rakefile
|
191
|
+
- VERSION
|
192
|
+
- examples/sinatra/app.rb
|
193
|
+
- examples/sinatra/config.ru
|
194
|
+
- examples/sinatra/public/app.css
|
195
|
+
- examples/sinatra/public/app.js
|
196
|
+
- examples/sinatra/public/favicon.ico
|
197
|
+
- examples/sinatra/public/nested_directory/file_inside_nested_directory.txt
|
198
|
+
- examples/sinatra/views/index.haml
|
199
|
+
- examples/sinatra/views/layout.haml
|
200
|
+
- lib/proxeze.rb
|
201
|
+
- proxeze.gemspec
|
202
|
+
- spec/definitions.rb
|
203
|
+
- spec/proxeze_spec.rb
|
204
|
+
- spec/spec_helper.rb
|
144
205
|
has_rdoc: true
|
145
206
|
homepage: http://github.com/jacaetevha/proxeze
|
146
207
|
licenses:
|
147
|
-
- MIT
|
208
|
+
- MIT
|
148
209
|
post_install_message:
|
149
210
|
rdoc_options: []
|
150
211
|
|
151
212
|
require_paths:
|
152
|
-
- lib
|
213
|
+
- lib
|
153
214
|
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
-
none: false
|
155
215
|
requirements:
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
version: "0"
|
216
|
+
- - ">="
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
segments:
|
219
|
+
- 0
|
220
|
+
version: "0"
|
162
221
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
-
none: false
|
164
222
|
requirements:
|
165
|
-
|
166
|
-
|
167
|
-
|
223
|
+
- - ">="
|
224
|
+
- !ruby/object:Gem::Version
|
225
|
+
segments:
|
226
|
+
- 0
|
227
|
+
version: "0"
|
168
228
|
requirements: []
|
169
229
|
|
170
230
|
rubyforge_project:
|
171
|
-
rubygems_version: 1.
|
231
|
+
rubygems_version: 1.3.6
|
172
232
|
signing_key:
|
173
233
|
specification_version: 3
|
174
234
|
summary: A basic proxy/delegate framework for Ruby that will allow you to wrap any object with a proxy instance.
|
175
235
|
test_files:
|
176
|
-
- examples/sinatra/app.rb
|
177
|
-
- spec/definitions.rb
|
178
|
-
- spec/proxeze_spec.rb
|
179
|
-
- spec/spec_helper.rb
|
236
|
+
- examples/sinatra/app.rb
|
237
|
+
- spec/definitions.rb
|
238
|
+
- spec/proxeze_spec.rb
|
239
|
+
- spec/spec_helper.rb
|