ru_pol 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,105 @@
1
+ RuPol
2
+ =======
3
+
4
+ @@@@@@@@@@@@@@@@@'''','@@;,:+'''''', :;,,,,''''',,,, `:',,,, ,, ,, , ,'', .,,,, `,,,,
5
+ @@@@@@@@@@@@@@@@@@@@@@@+',,. :''@''': .`,.@@@; , ,,,,,,,,:,,,,,,,,,, `,,,,, ,', ;';,, ,, ,,,
6
+ @@@@@@@@@@@@@@@@@@@@@@+':,,, ''''',,,:;,, ,',,,,,, ,., ,',, .''''. .,,,. ,
7
+ @@@@@@@@@@@@@@@@@@@@@'''''+@#'''''''''''''';,, ,,,,,,,,,,`,,,, ,', ''''''', ,,;:,'. ,,,
8
+ @@@@@@@@@@@@@@@@@'@',':;@@@#''''@@@@''''''';,. ,',,,,,`.,,,,,,,,,,, `,,,. ,,, , '''@@'''@@` ,,,,,'';,,,,,,
9
+ @@@@@@@@@@@#; '''''': `''@@@@@@'''''''''''',,,''''''''',,,,,,, ,,,,,,,,,,,,,',,, .'''+@#''',,,,,,;'''''';,''
10
+ @@@@@@@@@#',. ''''':, `,'@@@@@+'@@#'''''''''''''''''';,,,,,,,,,,,,,. .,,,,,,,,,,,'',,` ,,,,,`.;'';:''';,,'
11
+ @@@@@@@@''';, ''''''', :''@@@@+''''''''''''''''''''';,,,,,,,,,,,,,,,,,, .,,,,,',,,,,'':,,, ;'''';. ''
12
+ @@@@@@@@+,,,,,''@''''',, ,,''@@@'''+'''''''''''''''':,,,,,,,,,,,,,,,,,,, `:; , .,,,,,,,,,,,,,` ,,,,';. ,''''''' :''@'
13
+ @@@@@@@':`,,'+@@@'''': `:''@@@'@@@''@@+@''''''''''',,,,,,,,,,, ,`,' .,,,,,,,,,,,,,'': .,,. ,''''''' `'',@@@
14
+ @@@@@@@+', ,'@'''',` `'@@@@@@@'''#@@@@@@''',,,''''',,,,,,,,,,, `.`,,, ''` `,,,,,'''':, ., ''''''' `'';.:@@
15
+ @@@@@@@@@#. ,`'@@',, .''''''' ,''@@@@@@'''''',,, ;':,,,. , `,,,,,,,,#@+ ,, ,'''''` ,'''': ;'';,,, ''
16
+ @@@@@@@@@@@@@@@@@', ;''''; ,,'''@@@@@@@@@@#''''''':,,`,'', .,,,,,,,,,,,,,,,;#@+ ,''. ''''' '',:,`
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
+ RuPol is a glamorous mixin for instance pooling your Ruby classes.
48
+
49
+ It eases the pain of garbarge collection for classes that are instantiated many times, and then tossed away like runway trash. Instances are cached on the class in a pool (array, in less glamorous terms), and can be recycled at will. Of course, there is no pain without gain, and models will trade collection costs for memory usages. The Swimsuit mixin edition overrides #new and #destroy, for a virtually pain free instance swimming experience.
50
+
51
+ Runway not included.
52
+
53
+ Usage
54
+ --------
55
+
56
+ The RuPol module can just be included into your class:
57
+
58
+ class MyModel
59
+ include RuPol
60
+
61
+ def self.process
62
+ instance = rehydrate || new
63
+ # .... do something with the instance
64
+ instance.recycle
65
+ end
66
+ end
67
+
68
+ Instance convenience methods added to the class will be:
69
+
70
+ * recycle - This will clear your instance, provided a #clear method exists, and then stash it in the instance pool
71
+
72
+ Class methods added for convenience include:
73
+
74
+ * max_pool_size - Can be used after including the module in order to configure the size limit on the pool
75
+ * empty_pool - Clears the pool and related stats
76
+ * rehydrate - Get an instance from the pool and initialize it with arguments
77
+
78
+ Including the RuPol module itself means that you do all the heavy lifting of using the pool. If you want coding life a little simpler, then use the RuPol::Swimsuit edition module instead. It overrides #new and #destroy, so that you can just use the pool in the normal lifecycle of an object.
79
+
80
+ class MyLazyModel
81
+ include RuPol::Swimsuit
82
+ end
83
+
84
+ instance = MyLazyModel.new # this could be a recycled or a new instance depending on what's in your pool
85
+ instance.destroy # goes back into the pool, and if your superclass defines #destroy, that gets called first!
86
+
87
+ The Swimsuit edition provides a #clear method too so that your large objects get cleaned out before storage. Plus all the benefits of more rigorous pool usage.
88
+
89
+ Contributing to ru_pol
90
+ --------
91
+
92
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
93
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
94
+ * Fork the project
95
+ * Start a feature/bugfix branch
96
+ * Commit and push until you are happy with your contribution
97
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
98
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
99
+
100
+ Copyright
101
+ --------
102
+
103
+ Copyright (c) 2011 Kane Baccigalupi. See LICENSE.txt for
104
+ further details.
105
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/lib/ru_pol.rb CHANGED
@@ -70,7 +70,7 @@ module RuPol
70
70
 
71
71
  module ClassMethods
72
72
  def new(*init_opts)
73
- rehydrate || ( init_opts.empty? ? super() : super(*init_opts) )
73
+ rehydrate(*init_opts) || ( init_opts.empty? ? super() : super(*init_opts) )
74
74
  end
75
75
  end
76
76
  end
data/ru_pol.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ru_pol}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kane Baccigalupi"]
12
- s.date = %q{2011-03-25}
12
+ s.date = %q{2011-03-30}
13
13
  s.description = %q{RuPol is a glamorous mixin for instance pooling your Ruby classes.
14
14
  It eases the pain of garbarge collection for classes that are instantiated many times, and then tossed away like runway trash.
15
15
  Instances are cached on the class in a pool (array in less glamorous terms), and can be recycled at will.
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.email = %q{baccigalupi@gmail.com}
21
21
  s.extra_rdoc_files = [
22
22
  "LICENSE.txt",
23
- "README.rdoc"
23
+ "README.md"
24
24
  ]
25
25
  s.files = [
26
26
  ".document",
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  "Gemfile",
29
29
  "Gemfile.lock",
30
30
  "LICENSE.txt",
31
- "README.rdoc",
31
+ "README.md",
32
32
  "Rakefile",
33
33
  "VERSION",
34
34
  "lib/pool.rb",
data/spec/ru_pol_spec.rb CHANGED
@@ -201,5 +201,76 @@ describe RuPol do
201
201
  Irreplacable._pool.should include instance
202
202
  end
203
203
  end
204
+
205
+ describe 'new' do
206
+ class Inity1
207
+ include RuPol::Swimsuit
208
+
209
+ attr_accessor :arg_1
210
+
211
+ def initialize(arg_1)
212
+ self.arg_1 = arg_1
213
+ end
214
+ end
215
+
216
+ class Inity2 < Inity1
217
+ include RuPol::Swimsuit
218
+ attr_accessor :arg_2
219
+
220
+ def initialize(arg_1, arg_2)
221
+ super(arg_1)
222
+ self.arg_2 = arg_2
223
+ end
224
+ end
225
+
226
+ before do
227
+ Irreplacable.empty_pool!
228
+ Inity1.empty_pool!
229
+ Inity2.empty_pool!
230
+ end
231
+
232
+ describe 'pass thru to init' do
233
+ it 'works when there are no arguments' do
234
+ Irreplacable.new
235
+ end
236
+
237
+ it 'works with one argument' do
238
+ Inity1.new(:foo).arg_1.should == :foo
239
+ end
240
+
241
+ it 'works with many arguments' do
242
+ i = Inity2.new(:bar, :foo)
243
+ i.arg_1.should == :bar
244
+ i.arg_2.should == :foo
245
+ end
246
+ end
247
+
248
+ describe 'rehydrating' do
249
+ before do
250
+ [
251
+ @irr = Irreplacable.new,
252
+ @init1 = Inity1.new(:foo),
253
+ @init2 = Inity2.new(:bar, :foo)
254
+ ].map{|i| i.destroy }
255
+ Irreplacable._pool.size.should == 1
256
+ Inity1._pool.size.should == 1
257
+ Inity2._pool.size.should == 1
258
+ end
259
+
260
+ it 'works when there are no arguments' do
261
+ Irreplacable.new
262
+ end
263
+
264
+ it 'works with one argument' do
265
+ Inity1.new(:foo).arg_1.should == :foo
266
+ end
267
+
268
+ it 'works with many arguments' do
269
+ i = Inity2.new(:bar, :foo)
270
+ i.arg_1.should == :bar
271
+ i.arg_2.should == :foo
272
+ end
273
+ end
274
+ end
204
275
  end
205
276
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ru_pol
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kane Baccigalupi
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-25 00:00:00 -07:00
18
+ date: 2011-03-30 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -104,14 +104,14 @@ extensions: []
104
104
 
105
105
  extra_rdoc_files:
106
106
  - LICENSE.txt
107
- - README.rdoc
107
+ - README.md
108
108
  files:
109
109
  - .document
110
110
  - .rspec
111
111
  - Gemfile
112
112
  - Gemfile.lock
113
113
  - LICENSE.txt
114
- - README.rdoc
114
+ - README.md
115
115
  - Rakefile
116
116
  - VERSION
117
117
  - lib/pool.rb
data/README.rdoc DELETED
@@ -1,126 +0,0 @@
1
- = RuPol
2
-
3
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
4
- @@;;;;;;;;::::::::::::,,:,,,,:,,,,,,:,,,:;:,,::;';;'+#+'.,,,:+';::::::::::::,:,........,,:::::,,,,,,..,,,,,,,,,:::::::::::;;;;;;;;;#@@
5
- @@;;;;;;;;:::::::::::::,,,,.,,:,,,,,,,::;,.`.,::;:;+###+,..;'';;;;;::::::::::::...,,,:;;;;;::::,,,.,,.,.,,,,,,,:::::::::::;;;;;;;;;#@@
6
- @@;;;;;;;;;::::::::::::,,,,.,::,,,,,,::;```..,.:,;'#+#+:.,::+';;;;;;;;;;'''''''';:::,:;;;;;::::,,,......,,,,,,,:::::::::::;;;;;;;;;#@@
7
- @@;;;;;;;;:::::::::::::.,,.,,::,,,,,:::..``....,,;+##++,,::++''';;;;;;;';''''''+++';::;;;::;;:::,........,,,,,,,:::::::::::;;;;;;;;#@@
8
- @@;;;;;;;;:::::::::::.,:,:.,,,,,,,,,:,...`.....,.'+##+;,,,;+''';';;;;;;;;''''''''''+';;;;:;;;;;::,........,,,,,,:::::::::::;;;;;;;;#@@
9
- @@;;;;;;;;:::::::::::.:.,:,:,,,,,,,,,...........,++##+,,:;#+''';;;;;;;;;;'''''''''''''';,;;;;;:::::,,.....,,,,,,:::::::::::;;;;;;;;#@@
10
- @@;;;;;;;;::::::::::::`.,,.,,,,,:,,,,,,.......,`:###+,:,,++'';;;;;;;;;;;;;;;''''''''+++':;;;;:::::,,:,.....,,,,,::::::::::::;;;;;;;#@@
11
- @@;;;;;;;;::::::::::::....,,,,,,:,,,,,.,......,.;+#';,,:'+';;;;;;;;;;;;;;;;;;;'''''''+++';;;;:::::::,,,....,,,,,:::::,::::::;;;;;;;#@@
12
- @@;;;;;;;:::::::::::::..,,,,,,::,,,:,,,,.......,;++:,,::+';;;;;;::::::::::;;;;;'''''''+++';:;;;::::,,,,,....,,,,,:,,:,,,::;:;;;;;;;#@@
13
- @@;;;;;;;;:::::::::::,,.,,,,,,,,,,,,,,,.....`..;'+;:::,+';;;;;;:::::::::::::;;;;;''''''+++;:;;::::,,,,,,,....,,,,,.,:,,,,::;;;;;;;;#@@
14
- @@;;;;;;;;:::::::::::,,...,,,,,,,,,,,,,,.......'+;::::+'';;;;;:::::::::::::::;;;;''''''++++::;;;;::,,,,,.....,,,:,,,:,,:,::;;;;;;;;#@@
15
- @@;;;;;;;;:::::::::::,,,.,,:::,,,,,,,,,,.,...,.;;;:::+'';;;;;::::::::::::::::;;;;'''''''+++':;;;::,,,,,,.,....,,,,,,:,,:,::;;;;;;;;#@@
16
- @@;;;;;;;;:::::,:,:,,.,,:,,::::,,,,,,:,,,....,.;::;'+''';;;;:::::::::::::::::;;;;;'''''''+++;:;;;;::,,,.......,,,,.::::::::;;;;;;;;#@@
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
- RuPol is a glamorous mixin for instance pooling your Ruby classes.
107
-
108
- It eases the pain of garbarge collection for classes that are instantiated many times, and then tossed away like runway trash. Instances are cached on the class in a pool (array, in less glamorous terms), and can be recycled at will. Of course, there is no pain without gain, and models will trade collection costs for memory usages. The Swimsuit mixin edition overrides #new and #destroy, for a virtually pain free instance swimming experience.
109
-
110
- Runway not included.
111
-
112
- == Contributing to ru_pol
113
-
114
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
115
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
116
- * Fork the project
117
- * Start a feature/bugfix branch
118
- * Commit and push until you are happy with your contribution
119
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
120
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
121
-
122
- == Copyright
123
-
124
- Copyright (c) 2011 Kane Baccigalupi. See LICENSE.txt for
125
- further details.
126
-