facets 2.9.2 → 2.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby +9 -12
- data/.yardopts +10 -0
- data/HISTORY.rdoc +586 -898
- data/NOTICE.rdoc +30 -30
- data/README.rdoc +50 -60
- data/lib/core/facets.rb +1 -59
- data/lib/core/facets/array.rb +63 -89
- data/lib/core/facets/array/each_pair.rb +14 -0
- data/lib/core/facets/array/each_value.rb +6 -0
- data/lib/core/facets/array/median.rb +32 -0
- data/lib/core/facets/array/mode.rb +1 -1
- data/lib/core/facets/array/nonuniq.rb +41 -4
- data/{src/core/facets/array/duplicates.rb → lib/core/facets/array/occurent.rb} +0 -0
- data/{src/core-uncommon → lib/core}/facets/array/op_pow.rb +6 -1
- data/lib/core/facets/binding.rb +14 -36
- data/lib/core/facets/binding/local_variables.rb +1 -0
- data/lib/core/facets/binding/op.rb +3 -23
- data/{src/core/facets/binding/op.rb → lib/core/facets/binding/op_get.rb} +3 -0
- data/lib/core/facets/binding/op_set.rb +1 -0
- data/lib/core/facets/binding/self.rb +8 -3
- data/lib/core/facets/binding/with.rb +12 -0
- data/lib/core/facets/class.rb +9 -14
- data/lib/core/facets/class/descendants.rb +2 -1
- data/lib/core/facets/class/hierarchically.rb +12 -0
- data/lib/{core-uncommon → core}/facets/class/preallocate.rb +5 -2
- data/lib/core/facets/class/singleton.rb +13 -0
- data/lib/core/facets/comparable.rb +8 -18
- data/lib/core/facets/denumerable.rb +3 -2
- data/lib/core/facets/dir.rb +7 -16
- data/lib/core/facets/enumerable.rb +37 -74
- data/lib/core/facets/enumerable/accumulate.rb +8 -4
- data/lib/core/facets/enumerable/defer.rb +0 -27
- data/lib/core/facets/enumerable/hashify.rb +31 -0
- data/lib/core/facets/enumerable/incase.rb +19 -0
- data/lib/core/facets/enumerable/map_with.rb +3 -0
- data/lib/core/facets/enumerable/modulate.rb +1 -1
- data/lib/core/facets/enumerable/sum.rb +4 -2
- data/lib/core/facets/exception.rb +4 -11
- data/lib/core/facets/exception/detail.rb +3 -9
- data/lib/core/facets/exception/error_print.rb +80 -0
- data/lib/core/facets/file.rb +15 -30
- data/lib/core/facets/file/atomic_id.rb +9 -0
- data/lib/core/facets/file/atomic_open.rb +26 -0
- data/lib/{supplemental/facets/atomicfile.rb → core/facets/file/atomic_write.rb} +15 -8
- data/lib/core/facets/filetest.rb +7 -16
- data/lib/core/facets/fixnum.rb +7 -0
- data/lib/core/facets/float.rb +2 -6
- data/lib/core/facets/functor.rb +16 -0
- data/lib/core/facets/hash.rb +54 -108
- data/lib/core/facets/hash/collate.rb +3 -30
- data/lib/core/facets/hash/op_sub.rb +1 -0
- data/lib/core/facets/hash/rekey.rb +18 -8
- data/lib/core/facets/hash/slice.rb +3 -2
- data/lib/core/facets/hash/update_keys.rb +2 -1
- data/lib/core/facets/hash/url_params.rb +21 -0
- data/lib/core/facets/indexable.rb +0 -2
- data/lib/core/facets/integer.rb +10 -20
- data/lib/core/facets/integer/roman.rb +1 -0
- data/lib/core/facets/kernel.rb +77 -140
- data/lib/core/facets/kernel/assign.rb +11 -13
- data/lib/{core-uncommon → core}/facets/kernel/demo.rb +8 -5
- data/lib/core/facets/kernel/eigen.rb +33 -0
- data/{src/core-uncommon → lib/core}/facets/kernel/eigenclass.rb +5 -2
- data/lib/core/facets/kernel/extend.rb +4 -1
- data/lib/core/facets/kernel/extension.rb +2 -2
- data/lib/core/facets/kernel/hierarchical_send.rb +44 -0
- data/lib/{core-uncommon → core}/facets/kernel/instance_exec.rb +4 -1
- data/lib/{core-uncommon → core}/facets/kernel/memo.rb +5 -2
- data/lib/core/facets/kernel/object_hexid.rb +23 -21
- data/lib/core/facets/kernel/singleton_class.rb +3 -2
- data/{src/core-uncommon → lib/core}/facets/kernel/trap_chain.rb +6 -1
- data/lib/{core-uncommon → core}/facets/kernel/y.rb +5 -2
- data/lib/core/facets/lazy.rb +6 -7
- data/lib/core/facets/matchdata.rb +3 -8
- data/lib/{supplemental → core}/facets/metaid.rb +0 -0
- data/lib/core/facets/method.rb +5 -6
- data/lib/core/facets/method/composition.rb +80 -0
- data/lib/{core-uncommon → core}/facets/method/memoize.rb +5 -1
- data/lib/core/facets/method/op_mul.rb +1 -0
- data/lib/core/facets/method/op_pow.rb +1 -0
- data/lib/core/facets/module.rb +60 -86
- data/{src/core-uncommon → lib/core}/facets/module/attr_class_accessor.rb +15 -3
- data/{src/core-uncommon → lib/core}/facets/module/attr_tester.rb +12 -5
- data/lib/{core-uncommon → core}/facets/module/attr_validator.rb +11 -5
- data/lib/core/facets/module/class.rb +1 -1
- data/lib/{core-uncommon → core}/facets/module/class_accessor.rb +16 -3
- data/lib/{core-uncommon → core}/facets/module/class_extend.rb +9 -2
- data/{src/core-uncommon → lib/core}/facets/module/class_inheritor.rb +5 -2
- data/lib/{core-uncommon → core}/facets/module/copy_inheritor.rb +5 -2
- data/{src/core-uncommon → lib/core}/facets/module/enclosure.rb +16 -4
- data/lib/{core-uncommon → core}/facets/module/enclosures.rb +0 -0
- data/lib/{core-uncommon → core}/facets/module/include_as.rb +0 -0
- data/{src/core-uncommon → lib/core}/facets/module/instance_function.rb +5 -1
- data/lib/{core-uncommon → core}/facets/module/let.rb +4 -0
- data/{src/core-uncommon/facets/module/cattr.rb → lib/core/facets/module/mattr.rb} +40 -8
- data/{src/core-uncommon → lib/core}/facets/module/memoize.rb +4 -0
- data/lib/{core-uncommon → core}/facets/module/method_clash.rb +11 -4
- data/lib/{core-uncommon → core}/facets/module/method_space.rb +10 -2
- data/{src/core-uncommon → lib/core}/facets/module/module_load.rb +10 -5
- data/lib/{core-uncommon → core}/facets/module/preextend.rb +4 -1
- data/lib/core/facets/nilclass.rb +3 -8
- data/lib/core/facets/numeric.rb +10 -18
- data/lib/core/facets/numeric/approx.rb +29 -6
- data/lib/core/facets/numeric/close.rb +1 -0
- data/lib/core/facets/numeric/negative.rb +1 -0
- data/lib/core/facets/numeric/positive.rb +15 -0
- data/lib/core/facets/object.rb +6 -14
- data/lib/core/facets/objectspace.rb +4 -10
- data/lib/core/facets/proc.rb +8 -18
- data/lib/core/facets/process.rb +2 -6
- data/lib/core/facets/range.rb +7 -14
- data/lib/core/facets/range/quantile.rb +18 -0
- data/lib/core/facets/regexp.rb +6 -14
- data/lib/core/facets/regexp/op_or.rb +5 -8
- data/lib/{core-uncommon/facets/integer → core/facets}/roman.rb +15 -3
- data/lib/core/facets/string.rb +69 -134
- data/{src/core-uncommon → lib/core}/facets/string/acronym.rb +4 -1
- data/lib/core/facets/string/briefcase.rb +1 -0
- data/lib/core/facets/string/camelcase.rb +60 -49
- data/{src/core-uncommon → lib/core}/facets/string/crypt.rb +5 -2
- data/lib/core/facets/string/methodize.rb +10 -11
- data/lib/core/facets/string/modulize.rb +12 -12
- data/lib/core/facets/string/natcmp.rb +3 -1
- data/lib/core/facets/string/pathize.rb +8 -4
- data/lib/core/facets/string/roman.rb +1 -0
- data/lib/core/facets/string/snakecase.rb +19 -9
- data/lib/core/facets/string/titlecase.rb +14 -2
- data/lib/core/facets/string/underscore.rb +1 -22
- data/lib/core/facets/struct.rb +2 -6
- data/lib/core/facets/symbol.rb +14 -30
- data/lib/core/facets/symbol/plain.rb +8 -0
- data/{src/core/facets/symbol/bang.rb → lib/core/facets/symbol/reader.rb} +0 -0
- data/{src/core/facets/symbol/query.rb → lib/core/facets/symbol/writer.rb} +0 -0
- data/lib/core/facets/time.rb +16 -34
- data/lib/core/facets/time/shift.rb +2 -0
- data/lib/core/facets/time/stamp.rb +14 -12
- data/lib/core/facets/unboundmethod.rb +3 -8
- data/lib/core/facets/version.rb +19 -0
- data/lib/{supplemental → standard}/facets/argvector.rb +0 -0
- data/lib/standard/facets/cloneable.rb +64 -0
- data/lib/{supplemental → standard}/facets/enumargs.rb +0 -0
- data/lib/standard/facets/equitable.rb +76 -0
- data/lib/standard/facets/fileutils/amass.rb +9 -8
- data/lib/standard/facets/instantiable.rb +25 -0
- data/lib/{supplemental → standard}/facets/interval.rb +60 -67
- data/lib/standard/facets/math.rb +57 -5
- data/lib/standard/facets/math/lgamma.rb +3 -1
- data/lib/standard/facets/math/linsolve.rb +2 -0
- data/lib/standard/facets/math/median.rb +15 -0
- data/lib/standard/facets/math/percentile.rb +40 -0
- data/lib/standard/facets/math/round.rb +9 -0
- data/lib/standard/facets/math/sqsolve.rb +7 -5
- data/lib/standard/facets/math/tgamma.rb +10 -0
- data/lib/{supplemental → standard}/facets/memoizable.rb +0 -0
- data/lib/{supplemental → standard}/facets/multipliers.rb +0 -0
- data/lib/{supplemental → standard}/facets/multiton.rb +0 -0
- data/lib/{supplemental → standard}/facets/nullclass.rb +0 -0
- data/lib/{supplemental → standard}/facets/opesc.rb +0 -0
- data/lib/standard/facets/pathname.rb +14 -1
- data/lib/{supplemental → standard}/facets/platform.rb +0 -0
- data/lib/standard/facets/set.rb +5 -1
- data/{src/supplemental → lib/standard}/facets/timer.rb +3 -2
- data/lib/{supplemental → standard}/facets/tuple.rb +0 -0
- data/qed/applique/file_helpers.rb +1 -1
- data/qed/core/dir/multiglob.rdoc +10 -10
- data/qed/core/dir/recurse.rdoc +13 -13
- data/qed/{core-uncommon → core}/module/cattr.rdoc +0 -0
- data/qed/{core-uncommon → core}/module/class_extend.rdoc +0 -0
- data/qed/{core-uncommon → core}/module/class_inheritor.rdoc +0 -0
- data/qed/{core-uncommon → core}/module/copy_inheritor.rdoc +0 -0
- data/qed/{core-uncommon → core}/module/method_space.rdoc +0 -0
- data/qed/core/string/camelcase.rdoc +19 -39
- data/qed/core/string/snakecase.rdoc +4 -3
- data/qed/standard/02_cloneable.rdoc +46 -0
- data/qed/standard/03_enumargs.rdoc +75 -0
- data/qed/standard/04_equitable.rdoc +35 -0
- data/qed/standard/05_instantiable.rdoc +42 -0
- data/qed/{supplemental → standard}/memoizable.rdoc +0 -0
- data/qed/{supplemental → standard}/mulititon.rdoc +0 -0
- data/test/core/array/test_duplicates.rb +15 -1
- data/test/core/array/test_median.rb +27 -0
- data/test/core/array/test_nonuniq.rb +2 -2
- data/test/core/array/test_occurent.rb +33 -0
- data/test/{core-uncommon → core}/class/test_preallocate.rb +0 -0
- data/test/core/denumerable_tc.rb +7 -8
- data/test/core/dir/test_each_child.rb +1 -1
- data/test/core/dir/test_multiglob.rb +1 -1
- data/test/core/enumerable/test_sum.rb +22 -0
- data/test/core/hash/test_url_params.rb +26 -0
- data/test/core/kernel/test_constant.rb +3 -3
- data/test/core/kernel/test_hierarchical_send.rb +48 -0
- data/test/core/kernel/test_object_hexid.rb +8 -4
- data/test/core/kernel/test_super_method.rb +1 -1
- data/test/{core-uncommon → core}/module/test_class_extend.rb +0 -0
- data/test/{core-uncommon → core}/module/test_class_inheritor.rb +0 -0
- data/test/{core-uncommon → core}/module/test_copy_inheritor.rb +0 -0
- data/test/{core-uncommon → core}/module/test_enclosure.rb +0 -0
- data/test/{core-uncommon → core}/module/test_instance_function.rb +0 -0
- data/test/{core-uncommon → core}/module/test_memoize.rb +0 -0
- data/test/{core-uncommon → core}/module/test_method_clash.rb +0 -0
- data/test/{core-uncommon → core}/module/test_method_space.rb +0 -0
- data/test/{core-uncommon → core}/module/test_module_load.rb +0 -0
- data/test/{core-uncommon → core}/module/test_preextend.rb +0 -0
- data/test/core/numeric/test_approx.rb +10 -1
- data/test/core/string/test_camelcase.rb +21 -38
- data/test/core/string/test_index_all.rb +5 -1
- data/test/core/string/test_pathize.rb +4 -0
- data/test/core/string/test_snakecase.rb +9 -4
- data/test/core/string/test_underscore.rb +2 -2
- data/test/core/time/test_dst_adjustment.rb +9 -1
- data/test/core/time/test_less.rb +1 -1
- data/test/core/time/test_shift.rb +6 -6
- data/test/core/time/test_stamp.rb +7 -3
- data/test/standard/math/test_abs.rb +13 -0
- data/test/standard/math/test_median.rb +17 -0
- data/test/standard/math/test_percentile.rb +13 -0
- data/test/standard/math/test_sign.rb +14 -0
- data/test/{supplemental → standard}/test_argvector.rb +0 -0
- data/test/standard/test_cloneable.rb +60 -0
- data/test/{supplemental → standard}/test_enumargs.rb +0 -0
- data/test/standard/test_equitable.rb +46 -0
- data/test/standard/test_instantiable.rb +40 -0
- data/test/{supplemental → standard}/test_memoizable.rb +0 -0
- data/test/{supplemental → standard}/test_multipliers.rb +0 -0
- data/test/standard/test_timer.rb +24 -12
- data/test/{supplemental → standard}/test_tuple.rb +0 -0
- metadata +209 -1070
- data/.gitignore +0 -11
- data/.locat +0 -24
- data/.reap/ignore +0 -1
- data/.reap/yard.reap +0 -42
- data/.test +0 -31
- data/.yard/core.yardopts +0 -7
- data/.yard/standard.yardopts +0 -7
- data/.yard/supplemental.yardopts +0 -7
- data/.yard/uncommon.yardopts +0 -7
- data/AUTHORS.rdoc +0 -100
- data/Assembly +0 -38
- data/GPL3.txt +0 -282
- data/MANIFEST +0 -1107
- data/Profile +0 -41
- data/Rakefile +0 -403
- data/VERSION +0 -1
- data/facets.gemspec +0 -152
- data/lib/core-uncommon/facets/array/median.rb +0 -17
- data/lib/core-uncommon/facets/array/op_pow.rb +0 -9
- data/lib/core-uncommon/facets/array/percentile.rb +0 -32
- data/lib/core-uncommon/facets/class/singleton.rb +0 -8
- data/lib/core-uncommon/facets/enumerable/has.rb +0 -22
- data/lib/core-uncommon/facets/enumerable/have.rb +0 -1
- data/lib/core-uncommon/facets/kernel/eigenclass.rb +0 -21
- data/lib/core-uncommon/facets/kernel/trap_chain.rb +0 -23
- data/lib/core-uncommon/facets/module/attr_class_accessor.rb +0 -39
- data/lib/core-uncommon/facets/module/attr_inheritor.rb +0 -15
- data/lib/core-uncommon/facets/module/attr_tester.rb +0 -49
- data/lib/core-uncommon/facets/module/cattr.rb +0 -264
- data/lib/core-uncommon/facets/module/class_inheritor.rb +0 -77
- data/lib/core-uncommon/facets/module/enclosure.rb +0 -82
- data/lib/core-uncommon/facets/module/instance_function.rb +0 -90
- data/lib/core-uncommon/facets/module/memoize.rb +0 -12
- data/lib/core-uncommon/facets/module/module_load.rb +0 -78
- data/lib/core-uncommon/facets/module/prepend.rb +0 -61
- data/lib/core-uncommon/facets/regexp/op_or.rb +0 -13
- data/lib/core-uncommon/facets/string/acronym.rb +0 -8
- data/lib/core-uncommon/facets/string/crypt.rb +0 -19
- data/lib/core-uncommon/facets/string/roman.rb +0 -1
- data/lib/supplemental/facets/main.rb +0 -62
- data/lib/supplemental/facets/reference.rb +0 -83
- data/lib/supplemental/facets/timer.rb +0 -207
- data/rdoc.assembly +0 -50
- data/site/.brite +0 -2
- data/site/assets/hover.js +0 -14
- data/site/assets/rdocs.js +0 -28
- data/site/assets/site.css +0 -324
- data/site/assets/syntax.css +0 -60
- data/site/atom.page +0 -25
- data/site/atom.xml +0 -20
- data/site/brite.yml +0 -3
- data/site/default.layout +0 -114
- data/site/index.html +0 -110
- data/site/index.page +0 -94
- data/site/learn.html +0 -110
- data/site/learn.page +0 -78
- data/site/media/APIdocs.png +0 -0
- data/site/media/RubyFacets.png +0 -0
- data/site/media/RubyFacetsShadow.png +0 -0
- data/site/media/RubyFacetsShadow2.png +0 -0
- data/site/media/RubyFacetsShadowFade.png +0 -0
- data/site/media/SPYlights.png +0 -0
- data/site/media/WeHeartFacets.png +0 -0
- data/site/media/abc.png +0 -0
- data/site/media/abc1.png +0 -0
- data/site/media/adverts/21-5G3Eta1L._AA_SL160_.jpg +0 -0
- data/site/media/adverts/21B53PF6W5L._AA_SL160_.jpg +0 -0
- data/site/media/adverts/21OsAAT9MaL._AA_SL160_.jpg +0 -0
- data/site/media/adverts/21PYg8IoswL._AA_SL160_.jpg +0 -0
- data/site/media/adverts/21WvvRAsbhL._AA_SL160_.jpg +0 -0
- data/site/media/adverts/amazon.html +0 -30
- data/site/media/adverts/rdoc.html +0 -15
- data/site/media/appleslice.jpg +0 -0
- data/site/media/clear.gif +0 -0
- data/site/media/core.jpg +0 -0
- data/site/media/fade_black_down.png +0 -0
- data/site/media/fade_blue_down.gif +0 -0
- data/site/media/fade_blue_up.gif +0 -0
- data/site/media/fade_red_down.png +0 -0
- data/site/media/fade_red_up (copy).png +0 -0
- data/site/media/fade_red_up.png +0 -0
- data/site/media/fade_yellow_down.jpg +0 -0
- data/site/media/fade_yellow_right.jpg +0 -0
- data/site/media/fade_yellow_up.jpg +0 -0
- data/site/media/favicon.ico +0 -0
- data/site/media/forkme.png +0 -0
- data/site/media/gray.jpg +0 -0
- data/site/media/heart.gif +0 -0
- data/site/media/itcamefrom.png +0 -0
- data/site/media/license.jpg +0 -0
- data/site/media/lightbulb.jpg +0 -0
- data/site/media/menu_bkg.png +0 -0
- data/site/media/mini.png +0 -0
- data/site/media/nitro.png +0 -0
- data/site/media/patch125.jpg +0 -0
- data/site/media/people.jpg +0 -0
- data/site/media/reap.png +0 -0
- data/site/media/ruby-lg.png +0 -0
- data/site/media/ruby.gif +0 -0
- data/site/media/temp.png +0 -0
- data/site/media/treetop.jpg +0 -0
- data/site/news.html +0 -110
- data/site/news.page +0 -22
- data/site/post.layout +0 -23
- data/site/posts/2008-01-01-how-facets-was-born.html +0 -110
- data/site/posts/2008-01-01-how-facets-was-born.post +0 -26
- data/site/posts/2008-03-24-release-2-4.html +0 -110
- data/site/posts/2008-03-24-release-2-4.post +0 -61
- data/site/posts/2009-07-21-new-website.html +0 -110
- data/site/posts/2009-07-21-new-website.post +0 -17
- data/site/posts/2009-08-22-release-2-7.html +0 -110
- data/site/posts/2009-08-22-release-2-7.post +0 -130
- data/site/posts/2009-11-09-release-2-8.html +0 -110
- data/site/posts/2009-11-09-release-2-8.post +0 -61
- data/site/posts/2010-09-01-release-2-9.html +0 -110
- data/site/posts/2010-09-01-release-2-9.post +0 -39
- data/site/source.html +0 -110
- data/site/source.page +0 -46
- data/src/core-uncommon/facets/array/median.rb +0 -17
- data/src/core-uncommon/facets/array/percentile.rb +0 -32
- data/src/core-uncommon/facets/class/preallocate.rb +0 -52
- data/src/core-uncommon/facets/class/singleton.rb +0 -8
- data/src/core-uncommon/facets/enumerable/has.rb +0 -22
- data/src/core-uncommon/facets/enumerable/have.rb +0 -1
- data/src/core-uncommon/facets/integer/roman.rb +0 -77
- data/src/core-uncommon/facets/kernel/demo.rb +0 -27
- data/src/core-uncommon/facets/kernel/instance_exec.rb +0 -44
- data/src/core-uncommon/facets/kernel/memo.rb +0 -41
- data/src/core-uncommon/facets/kernel/y.rb +0 -20
- data/src/core-uncommon/facets/method/memoize.rb +0 -13
- data/src/core-uncommon/facets/module/attr_inheritor.rb +0 -15
- data/src/core-uncommon/facets/module/attr_validator.rb +0 -40
- data/src/core-uncommon/facets/module/class_accessor.rb +0 -33
- data/src/core-uncommon/facets/module/class_extend.rb +0 -85
- data/src/core-uncommon/facets/module/copy_inheritor.rb +0 -42
- data/src/core-uncommon/facets/module/enclosures.rb +0 -1
- data/src/core-uncommon/facets/module/include_as.rb +0 -1
- data/src/core-uncommon/facets/module/let.rb +0 -27
- data/src/core-uncommon/facets/module/method_clash.rb +0 -59
- data/src/core-uncommon/facets/module/method_space.rb +0 -99
- data/src/core-uncommon/facets/module/preextend.rb +0 -29
- data/src/core-uncommon/facets/module/prepend.rb +0 -61
- data/src/core-uncommon/facets/regexp/op_or.rb +0 -13
- data/src/core-uncommon/facets/string/roman.rb +0 -1
- data/src/core/facets.rb +0 -70
- data/src/core/facets.yml +0 -57
- data/src/core/facets/applique/file_helpers.rb +0 -33
- data/src/core/facets/array.rb +0 -28
- data/src/core/facets/array/after.rb +0 -1
- data/src/core/facets/array/before.rb +0 -39
- data/src/core/facets/array/collapse.rb +0 -12
- data/src/core/facets/array/collisions.rb +0 -1
- data/src/core/facets/array/combination.rb +0 -43
- data/src/core/facets/array/commonality.rb +0 -37
- data/src/core/facets/array/conjoin.rb +0 -89
- data/src/core/facets/array/contains.rb +0 -7
- data/src/core/facets/array/delete.rb +0 -4
- data/src/core/facets/array/delete_unless.rb +0 -15
- data/src/core/facets/array/delete_values.rb +0 -50
- data/src/core/facets/array/divide.rb +0 -20
- data/src/core/facets/array/entropy.rb +0 -39
- data/src/core/facets/array/extract_options.rb +0 -31
- data/src/core/facets/array/from.rb +0 -33
- data/src/core/facets/array/index.rb +0 -23
- data/src/core/facets/array/indexable.rb +0 -31
- data/src/core/facets/array/merge.rb +0 -22
- data/src/core/facets/array/mode.rb +0 -22
- data/src/core/facets/array/nonuniq.rb +0 -37
- data/src/core/facets/array/not_empty.rb +0 -13
- data/src/core/facets/array/only.rb +0 -26
- data/src/core/facets/array/pad.rb +0 -41
- data/src/core/facets/array/peek.rb +0 -1
- data/src/core/facets/array/permutation.rb +0 -32
- data/src/core/facets/array/poke.rb +0 -1
- data/src/core/facets/array/probability.rb +0 -39
- data/src/core/facets/array/product.rb +0 -30
- data/src/core/facets/array/pull.rb +0 -30
- data/src/core/facets/array/recurse.rb +0 -29
- data/src/core/facets/array/recursively.rb +0 -47
- data/src/core/facets/array/rotate.rb +0 -48
- data/src/core/facets/array/select.rb +0 -20
- data/src/core/facets/array/splice.rb +0 -27
- data/src/core/facets/array/split.rb +0 -27
- data/src/core/facets/array/store.rb +0 -12
- data/src/core/facets/array/thru.rb +0 -1
- data/src/core/facets/array/traverse.rb +0 -44
- data/src/core/facets/array/uniq_by.rb +0 -16
- data/src/core/facets/binding.rb +0 -32
- data/src/core/facets/binding/__callee__.rb +0 -1
- data/src/core/facets/binding/__method__.rb +0 -1
- data/src/core/facets/binding/call_stack.rb +0 -1
- data/src/core/facets/binding/caller.rb +0 -44
- data/src/core/facets/binding/callstack.rb +0 -1
- data/src/core/facets/binding/defined.rb +0 -12
- data/src/core/facets/binding/eval.rb +0 -14
- data/src/core/facets/binding/local_variables.rb +0 -17
- data/src/core/facets/binding/self.rb +0 -12
- data/src/core/facets/boolean.rb +0 -121
- data/src/core/facets/class.rb +0 -20
- data/src/core/facets/class/descendants.rb +0 -35
- data/src/core/facets/class/methodize.rb +0 -19
- data/src/core/facets/class/pathize.rb +0 -19
- data/src/core/facets/class/subclasses.rb +0 -28
- data/src/core/facets/class/to_proc.rb +0 -25
- data/src/core/facets/comparable.rb +0 -20
- data/src/core/facets/comparable/at_least.rb +0 -1
- data/src/core/facets/comparable/at_most.rb +0 -1
- data/src/core/facets/comparable/bound.rb +0 -1
- data/src/core/facets/comparable/cap.rb +0 -34
- data/src/core/facets/comparable/clip.rb +0 -38
- data/src/core/facets/comparable/cmp.rb +0 -41
- data/src/core/facets/comparable/op_get.rb +0 -45
- data/src/core/facets/denumerable.rb +0 -76
- data/src/core/facets/dir.rb +0 -20
- data/src/core/facets/dir/ascend.rb +0 -56
- data/src/core/facets/dir/descend.rb +0 -1
- data/src/core/facets/dir/each_child.rb +0 -16
- data/src/core/facets/dir/multiglob.rb +0 -78
- data/src/core/facets/dir/parent.rb +0 -16
- data/src/core/facets/dir/recurse.rb +0 -35
- data/src/core/facets/enumerable.rb +0 -20
- data/src/core/facets/enumerable/accumulate.rb +0 -61
- data/src/core/facets/enumerable/cluster_by.rb +0 -18
- data/src/core/facets/enumerable/collect_with_index.rb +0 -2
- data/src/core/facets/enumerable/compact_map.rb +0 -36
- data/src/core/facets/enumerable/count.rb +0 -53
- data/src/core/facets/enumerable/defer.rb +0 -73
- data/src/core/facets/enumerable/each_by.rb +0 -33
- data/src/core/facets/enumerable/each_with_object.rb +0 -38
- data/src/core/facets/enumerable/every.rb +0 -40
- data/src/core/facets/enumerable/ewise.rb +0 -59
- data/src/core/facets/enumerable/exclude.rb +0 -16
- data/src/core/facets/enumerable/expand.rb +0 -15
- data/src/core/facets/enumerable/filter.rb +0 -33
- data/src/core/facets/enumerable/find_yield.rb +0 -42
- data/src/core/facets/enumerable/frequency.rb +0 -24
- data/src/core/facets/enumerable/graph.rb +0 -37
- data/src/core/facets/enumerable/group_by.rb +0 -33
- data/src/core/facets/enumerable/map_by.rb +0 -35
- data/src/core/facets/enumerable/map_detect.rb +0 -1
- data/src/core/facets/enumerable/map_send.rb +0 -26
- data/src/core/facets/enumerable/map_with.rb +0 -18
- data/src/core/facets/enumerable/map_with_index.rb +0 -23
- data/src/core/facets/enumerable/mash.rb +0 -1
- data/src/core/facets/enumerable/modulate.rb +0 -22
- data/src/core/facets/enumerable/none.rb +0 -32
- data/src/core/facets/enumerable/occur.rb +0 -38
- data/src/core/facets/enumerable/one.rb +0 -39
- data/src/core/facets/enumerable/per.rb +0 -85
- data/src/core/facets/enumerable/purge.rb +0 -43
- data/src/core/facets/enumerable/recursively.rb +0 -66
- data/src/core/facets/enumerable/sum.rb +0 -16
- data/src/core/facets/enumerable/take.rb +0 -16
- data/src/core/facets/enumerable/uniq_by.rb +0 -13
- data/src/core/facets/enumerable/visit.rb +0 -30
- data/src/core/facets/enumerable/zip_map.rb +0 -1
- data/src/core/facets/enumerator.rb +0 -75
- data/src/core/facets/enumerator/fx.rb +0 -36
- data/src/core/facets/exception.rb +0 -21
- data/src/core/facets/exception/detail.rb +0 -23
- data/src/core/facets/exception/raised.rb +0 -14
- data/src/core/facets/exception/suppress.rb +0 -22
- data/src/core/facets/file.rb +0 -20
- data/src/core/facets/file/append.rb +0 -14
- data/src/core/facets/file/create.rb +0 -21
- data/src/core/facets/file/ext.rb +0 -36
- data/src/core/facets/file/null.rb +0 -21
- data/src/core/facets/file/read_binary.rb +0 -18
- data/src/core/facets/file/read_list.rb +0 -34
- data/src/core/facets/file/rewrite.rb +0 -90
- data/src/core/facets/file/rootname.rb +0 -23
- data/src/core/facets/file/sanitize.rb +0 -18
- data/src/core/facets/file/split_all.rb +0 -19
- data/src/core/facets/file/split_root.rb +0 -13
- data/src/core/facets/file/write.rb +0 -24
- data/src/core/facets/file/writelines.rb +0 -27
- data/src/core/facets/filetest.rb +0 -20
- data/src/core/facets/filetest/absolute.rb +0 -1
- data/src/core/facets/filetest/contains.rb +0 -12
- data/src/core/facets/filetest/relative.rb +0 -38
- data/src/core/facets/filetest/root.rb +0 -17
- data/src/core/facets/filetest/safe.rb +0 -20
- data/src/core/facets/filetest/separator_pattern.rb +0 -19
- data/src/core/facets/float.rb +0 -20
- data/src/core/facets/float/round.rb +0 -2
- data/src/core/facets/functor.rb +0 -78
- data/src/core/facets/hash.rb +0 -20
- data/src/core/facets/hash/alias.rb +0 -31
- data/src/core/facets/hash/argumentize.rb +0 -28
- data/src/core/facets/hash/at.rb +0 -8
- data/src/core/facets/hash/autonew.rb +0 -24
- data/src/core/facets/hash/collate.rb +0 -62
- data/src/core/facets/hash/count.rb +0 -12
- data/src/core/facets/hash/data.rb +0 -41
- data/src/core/facets/hash/dearray_values.rb +0 -46
- data/src/core/facets/hash/deep_merge.rb +0 -33
- data/src/core/facets/hash/delete.rb +0 -4
- data/src/core/facets/hash/delete_at.rb +0 -7
- data/src/core/facets/hash/delete_unless.rb +0 -17
- data/src/core/facets/hash/delete_values.rb +0 -41
- data/src/core/facets/hash/diff.rb +0 -17
- data/src/core/facets/hash/except.rb +0 -25
- data/src/core/facets/hash/graph.rb +0 -18
- data/src/core/facets/hash/insert.rb +0 -19
- data/src/core/facets/hash/inverse.rb +0 -30
- data/src/core/facets/hash/join.rb +0 -17
- data/src/core/facets/hash/keys.rb +0 -45
- data/src/core/facets/hash/mash.rb +0 -1
- data/src/core/facets/hash/new_with.rb +0 -15
- data/src/core/facets/hash/op.rb +0 -7
- data/src/core/facets/hash/op_add.rb +0 -12
- data/src/core/facets/hash/op_and.rb +0 -33
- data/src/core/facets/hash/op_mul.rb +0 -18
- data/src/core/facets/hash/op_or.rb +0 -12
- data/src/core/facets/hash/op_push.rb +0 -17
- data/src/core/facets/hash/op_sub.rb +0 -26
- data/src/core/facets/hash/recurse.rb +0 -29
- data/src/core/facets/hash/recursively.rb +0 -61
- data/src/core/facets/hash/rekey.rb +0 -79
- data/src/core/facets/hash/replace_each.rb +0 -16
- data/src/core/facets/hash/reverse_merge.rb +0 -30
- data/src/core/facets/hash/select.rb +0 -17
- data/src/core/facets/hash/slice.rb +0 -37
- data/src/core/facets/hash/stringify_keys.rb +0 -1
- data/src/core/facets/hash/subset.rb +0 -24
- data/src/core/facets/hash/swap.rb +0 -17
- data/src/core/facets/hash/symbolize_keys.rb +0 -92
- data/src/core/facets/hash/to_h.rb +0 -1
- data/src/core/facets/hash/to_mod.rb +0 -33
- data/src/core/facets/hash/to_options.rb +0 -1
- data/src/core/facets/hash/to_proc.rb +0 -39
- data/src/core/facets/hash/to_struct.rb +0 -17
- data/src/core/facets/hash/traverse.rb +0 -47
- data/src/core/facets/hash/update.rb +0 -6
- data/src/core/facets/hash/update_each.rb +0 -18
- data/src/core/facets/hash/update_keys.rb +0 -20
- data/src/core/facets/hash/update_values.rb +0 -20
- data/src/core/facets/hash/weave.rb +0 -76
- data/src/core/facets/hash/zip.rb +0 -18
- data/src/core/facets/indexable.rb +0 -270
- data/src/core/facets/instance.rb +0 -157
- data/src/core/facets/integer.rb +0 -20
- data/src/core/facets/integer/bit.rb +0 -1
- data/src/core/facets/integer/bitmask.rb +0 -99
- data/src/core/facets/integer/even.rb +0 -1
- data/src/core/facets/integer/factorial.rb +0 -21
- data/src/core/facets/integer/multiple.rb +0 -19
- data/src/core/facets/integer/odd.rb +0 -37
- data/src/core/facets/integer/of.rb +0 -18
- data/src/core/facets/integer/ordinal.rb +0 -24
- data/src/core/facets/kernel.rb +0 -20
- data/src/core/facets/kernel/__callee__.rb +0 -1
- data/src/core/facets/kernel/__class__.rb +0 -9
- data/src/core/facets/kernel/__dir__.rb +0 -26
- data/src/core/facets/kernel/__get__.rb +0 -15
- data/src/core/facets/kernel/__method__.rb +0 -48
- data/src/core/facets/kernel/__set__.rb +0 -1
- data/src/core/facets/kernel/as.rb +0 -115
- data/src/core/facets/kernel/ask.rb +0 -28
- data/src/core/facets/kernel/assign.rb +0 -76
- data/src/core/facets/kernel/assign_from.rb +0 -1
- data/src/core/facets/kernel/attr_singleton.rb +0 -59
- data/src/core/facets/kernel/blank.rb +0 -84
- data/src/core/facets/kernel/call_stack.rb +0 -56
- data/src/core/facets/kernel/callstack.rb +0 -1
- data/src/core/facets/kernel/case.rb +0 -8
- data/src/core/facets/kernel/complete.rb +0 -26
- data/src/core/facets/kernel/constant.rb +0 -20
- data/src/core/facets/kernel/d.rb +0 -27
- data/src/core/facets/kernel/deep_clone.rb +0 -1
- data/src/core/facets/kernel/deep_copy.rb +0 -38
- data/src/core/facets/kernel/disable_warnings.rb +0 -26
- data/src/core/facets/kernel/enable_warnings.rb +0 -1
- data/src/core/facets/kernel/equate.rb +0 -16
- data/src/core/facets/kernel/ergo.rb +0 -43
- data/src/core/facets/kernel/extend.rb +0 -27
- data/src/core/facets/kernel/extension.rb +0 -12
- data/src/core/facets/kernel/false.rb +0 -2
- data/src/core/facets/kernel/here.rb +0 -11
- data/src/core/facets/kernel/identical.rb +0 -4
- data/src/core/facets/kernel/in.rb +0 -13
- data/src/core/facets/kernel/instance_assign.rb +0 -20
- data/src/core/facets/kernel/instance_class.rb +0 -26
- data/src/core/facets/kernel/instance_send.rb +0 -7
- data/src/core/facets/kernel/load_all.rb +0 -1
- data/src/core/facets/kernel/load_relative.rb +0 -1
- data/src/core/facets/kernel/maybe.rb +0 -19
- data/src/core/facets/kernel/meta_alias.rb +0 -23
- data/src/core/facets/kernel/meta_class.rb +0 -17
- data/src/core/facets/kernel/meta_def.rb +0 -20
- data/src/core/facets/kernel/meta_eval.rb +0 -20
- data/src/core/facets/kernel/method.rb +0 -50
- data/src/core/facets/kernel/no.rb +0 -1
- data/src/core/facets/kernel/not.rb +0 -37
- data/src/core/facets/kernel/not_nil.rb +0 -18
- data/src/core/facets/kernel/object_class.rb +0 -10
- data/src/core/facets/kernel/object_hexid.rb +0 -31
- data/src/core/facets/kernel/object_send.rb +0 -33
- data/src/core/facets/kernel/p.rb +0 -24
- data/src/core/facets/kernel/presence.rb +0 -1
- data/src/core/facets/kernel/present.rb +0 -1
- data/src/core/facets/kernel/qua_class.rb +0 -31
- data/src/core/facets/kernel/require_all.rb +0 -42
- data/src/core/facets/kernel/require_relative.rb +0 -52
- data/src/core/facets/kernel/respond.rb +0 -42
- data/src/core/facets/kernel/returning.rb +0 -27
- data/src/core/facets/kernel/silence.rb +0 -73
- data/src/core/facets/kernel/silence_warnings.rb +0 -1
- data/src/core/facets/kernel/singleton_class.rb +0 -9
- data/src/core/facets/kernel/source_location.rb +0 -13
- data/src/core/facets/kernel/super_method.rb +0 -11
- data/src/core/facets/kernel/tap.rb +0 -48
- data/src/core/facets/kernel/temporarily.rb +0 -23
- data/src/core/facets/kernel/true.rb +0 -26
- data/src/core/facets/kernel/try.rb +0 -58
- data/src/core/facets/kernel/val.rb +0 -19
- data/src/core/facets/kernel/with.rb +0 -20
- data/src/core/facets/kernel/writers.rb +0 -91
- data/src/core/facets/kernel/yes.rb +0 -25
- data/src/core/facets/lazy.rb +0 -238
- data/src/core/facets/matchdata.rb +0 -20
- data/src/core/facets/matchdata/match.rb +0 -15
- data/src/core/facets/matchdata/matchset.rb +0 -44
- data/src/core/facets/method.rb +0 -20
- data/src/core/facets/module.rb +0 -20
- data/src/core/facets/module/abstract.rb +0 -24
- data/src/core/facets/module/alias_accessor.rb +0 -45
- data/src/core/facets/module/alias_method_chain.rb +0 -67
- data/src/core/facets/module/alias_module_function.rb +0 -30
- data/src/core/facets/module/all_instance_methods.rb +0 -19
- data/src/core/facets/module/ancestor.rb +0 -16
- data/src/core/facets/module/anonymous.rb +0 -25
- data/src/core/facets/module/attr_setter.rb +0 -52
- data/src/core/facets/module/basename.rb +0 -31
- data/src/core/facets/module/can.rb +0 -20
- data/src/core/facets/module/class.rb +0 -12
- data/src/core/facets/module/class_def.rb +0 -2
- data/src/core/facets/module/class_method_defined.rb +0 -1
- data/src/core/facets/module/extend.rb +0 -1
- data/src/core/facets/module/home.rb +0 -90
- data/src/core/facets/module/homename.rb +0 -1
- data/src/core/facets/module/housing.rb +0 -1
- data/src/core/facets/module/include_function_module.rb +0 -25
- data/src/core/facets/module/instance_method.rb +0 -25
- data/src/core/facets/module/instance_method_defined.rb +0 -23
- data/src/core/facets/module/integrate.rb +0 -49
- data/src/core/facets/module/is.rb +0 -57
- data/src/core/facets/module/methodize.rb +0 -20
- data/src/core/facets/module/modname.rb +0 -1
- data/src/core/facets/module/module_def.rb +0 -31
- data/src/core/facets/module/nodef.rb +0 -13
- data/src/core/facets/module/op.rb +0 -107
- data/src/core/facets/module/op_add.rb +0 -1
- data/src/core/facets/module/op_mul.rb +0 -1
- data/src/core/facets/module/op_sub.rb +0 -1
- data/src/core/facets/module/pathize.rb +0 -20
- data/src/core/facets/module/redefine_method.rb +0 -37
- data/src/core/facets/module/redirect_method.rb +0 -46
- data/src/core/facets/module/remove.rb +0 -1
- data/src/core/facets/module/rename_method.rb +0 -30
- data/src/core/facets/module/revise.rb +0 -41
- data/src/core/facets/module/set.rb +0 -36
- data/src/core/facets/module/singleton_method_defined.rb +0 -1
- data/src/core/facets/module/spacename.rb +0 -25
- data/src/core/facets/module/to_obj.rb +0 -20
- data/src/core/facets/module/wrap_method.rb +0 -35
- data/src/core/facets/na.rb +0 -21
- data/src/core/facets/nilclass.rb +0 -20
- data/src/core/facets/nilclass/ergo.rb +0 -1
- data/src/core/facets/nilclass/to_f.rb +0 -17
- data/src/core/facets/numeric.rb +0 -20
- data/src/core/facets/numeric/approx.rb +0 -15
- data/src/core/facets/numeric/distance.rb +0 -14
- data/src/core/facets/numeric/length.rb +0 -10
- data/src/core/facets/numeric/round.rb +0 -69
- data/src/core/facets/numeric/round_at.rb +0 -1
- data/src/core/facets/numeric/round_to.rb +0 -1
- data/src/core/facets/numeric/spacing.rb +0 -20
- data/src/core/facets/object.rb +0 -20
- data/src/core/facets/object/clone.rb +0 -1
- data/src/core/facets/object/dup.rb +0 -79
- data/src/core/facets/object/object_state.rb +0 -77
- data/src/core/facets/object/replace.rb +0 -43
- data/src/core/facets/object/try_dup.rb +0 -1
- data/src/core/facets/objectspace.rb +0 -20
- data/src/core/facets/objectspace/classes.rb +0 -11
- data/src/core/facets/objectspace/op_fetch.rb +0 -3
- data/src/core/facets/objectspace/reflect.rb +0 -62
- data/src/core/facets/proc.rb +0 -20
- data/src/core/facets/proc/bind.rb +0 -24
- data/src/core/facets/proc/bind_to.rb +0 -17
- data/src/core/facets/proc/compose.rb +0 -42
- data/src/core/facets/proc/curry.rb +0 -32
- data/src/core/facets/proc/partial.rb +0 -33
- data/src/core/facets/proc/to_method.rb +0 -38
- data/src/core/facets/proc/update.rb +0 -9
- data/src/core/facets/process.rb +0 -20
- data/src/core/facets/process/daemon.rb +0 -32
- data/src/core/facets/range.rb +0 -20
- data/src/core/facets/range/combine.rb +0 -47
- data/src/core/facets/range/overlap.rb +0 -12
- data/src/core/facets/range/to_r.rb +0 -26
- data/src/core/facets/range/umbrella.rb +0 -1
- data/src/core/facets/range/within.rb +0 -64
- data/src/core/facets/regexp.rb +0 -20
- data/src/core/facets/regexp/arity.rb +0 -17
- data/src/core/facets/regexp/multiline.rb +0 -13
- data/src/core/facets/regexp/op_add.rb +0 -18
- data/src/core/facets/regexp/op_or.rb +0 -18
- data/src/core/facets/regexp/to_re.rb +0 -28
- data/src/core/facets/string.rb +0 -20
- data/src/core/facets/string/align.rb +0 -125
- data/src/core/facets/string/bracket.rb +0 -64
- data/src/core/facets/string/bytes.rb +0 -21
- data/src/core/facets/string/camelcase.rb +0 -62
- data/src/core/facets/string/capitalized.rb +0 -49
- data/src/core/facets/string/characters.rb +0 -13
- data/src/core/facets/string/cleanlines.rb +0 -27
- data/src/core/facets/string/cleave.rb +0 -36
- data/src/core/facets/string/cmp.rb +0 -1
- data/src/core/facets/string/compress_lines.rb +0 -17
- data/src/core/facets/string/divide.rb +0 -18
- data/src/core/facets/string/each_char.rb +0 -31
- data/src/core/facets/string/each_word.rb +0 -17
- data/src/core/facets/string/edit_distance.rb +0 -124
- data/src/core/facets/string/end_with.rb +0 -1
- data/src/core/facets/string/exclude.rb +0 -10
- data/src/core/facets/string/expand_tab.rb +0 -35
- data/src/core/facets/string/file.rb +0 -35
- data/src/core/facets/string/fold.rb +0 -39
- data/src/core/facets/string/indent.rb +0 -67
- data/src/core/facets/string/index_all.rb +0 -24
- data/src/core/facets/string/interpolate.rb +0 -19
- data/src/core/facets/string/lchomp.rb +0 -33
- data/src/core/facets/string/line_wrap.rb +0 -18
- data/src/core/facets/string/lines.rb +0 -19
- data/src/core/facets/string/lowercase.rb +0 -1
- data/src/core/facets/string/margin.rb +0 -31
- data/src/core/facets/string/methodize.rb +0 -27
- data/src/core/facets/string/modulize.rb +0 -31
- data/src/core/facets/string/mscan.rb +0 -19
- data/src/core/facets/string/natcmp.rb +0 -86
- data/src/core/facets/string/nchar.rb +0 -32
- data/src/core/facets/string/newlines.rb +0 -32
- data/src/core/facets/string/op_div.rb +0 -14
- data/src/core/facets/string/op_sub.rb +0 -14
- data/src/core/facets/string/outdent.rb +0 -1
- data/src/core/facets/string/pathize.rb +0 -28
- data/src/core/facets/string/quote.rb +0 -93
- data/src/core/facets/string/random_binary.rb +0 -10
- data/src/core/facets/string/range.rb +0 -60
- data/src/core/facets/string/range_all.rb +0 -1
- data/src/core/facets/string/range_of_line.rb +0 -1
- data/src/core/facets/string/rewrite.rb +0 -24
- data/src/core/facets/string/shatter.rb +0 -22
- data/src/core/facets/string/similarity.rb +0 -89
- data/src/core/facets/string/snakecase.rb +0 -21
- data/src/core/facets/string/splice.rb +0 -33
- data/src/core/facets/string/squish.rb +0 -22
- data/src/core/facets/string/start_with.rb +0 -60
- data/src/core/facets/string/store.rb +0 -7
- data/src/core/facets/string/subtract.rb +0 -4
- data/src/core/facets/string/tab.rb +0 -17
- data/src/core/facets/string/tabto.rb +0 -19
- data/src/core/facets/string/titlecase.rb +0 -15
- data/src/core/facets/string/to_re.rb +0 -26
- data/src/core/facets/string/unbracket.rb +0 -1
- data/src/core/facets/string/underscore.rb +0 -22
- data/src/core/facets/string/unfold.rb +0 -27
- data/src/core/facets/string/unindent.rb +0 -1
- data/src/core/facets/string/unquote.rb +0 -1
- data/src/core/facets/string/uppercase.rb +0 -23
- data/src/core/facets/string/variablize.rb +0 -13
- data/src/core/facets/string/word_wrap.rb +0 -32
- data/src/core/facets/string/words.rb +0 -12
- data/src/core/facets/string/xor.rb +0 -26
- data/src/core/facets/struct.rb +0 -20
- data/src/core/facets/struct/attributes.rb +0 -15
- data/src/core/facets/symbol.rb +0 -20
- data/src/core/facets/symbol/as_s.rb +0 -17
- data/src/core/facets/symbol/chomp.rb +0 -24
- data/src/core/facets/symbol/generate.rb +0 -24
- data/src/core/facets/symbol/not.rb +0 -29
- data/src/core/facets/symbol/op_div.rb +0 -21
- data/src/core/facets/symbol/plain.rb +0 -43
- data/src/core/facets/symbol/setter.rb +0 -1
- data/src/core/facets/symbol/succ.rb +0 -23
- data/src/core/facets/symbol/thrown.rb +0 -18
- data/src/core/facets/symbol/to_proc.rb +0 -33
- data/src/core/facets/symbol/variablize.rb +0 -14
- data/src/core/facets/time.rb +0 -20
- data/src/core/facets/time/ago.rb +0 -1
- data/src/core/facets/time/change.rb +0 -46
- data/src/core/facets/time/dst_adjustment.rb +0 -24
- data/src/core/facets/time/elapse.rb +0 -18
- data/src/core/facets/time/future.rb +0 -14
- data/src/core/facets/time/hence.rb +0 -1
- data/src/core/facets/time/in.rb +0 -1
- data/src/core/facets/time/less.rb +0 -1
- data/src/core/facets/time/past.rb +0 -1
- data/src/core/facets/time/round_to.rb +0 -21
- data/src/core/facets/time/set.rb +0 -27
- data/src/core/facets/time/shift.rb +0 -95
- data/src/core/facets/time/stamp.rb +0 -45
- data/src/core/facets/time/to_time.rb +0 -21
- data/src/core/facets/time/trunc.rb +0 -15
- data/src/core/facets/to_hash.rb +0 -336
- data/src/core/facets/unboundmethod.rb +0 -20
- data/src/core/facets/unboundmethod/arguments.rb +0 -44
- data/src/core/facets/unboundmethod/name.rb +0 -28
- data/src/standard/facets/basicobject.rb +0 -75
- data/src/standard/facets/cgi.rb +0 -44
- data/src/standard/facets/continuation.rb +0 -56
- data/src/standard/facets/date.rb +0 -433
- data/src/standard/facets/digest.rb +0 -2
- data/src/standard/facets/digest/base64digest.rb +0 -45
- data/src/standard/facets/digest/salted_digest.rb +0 -44
- data/src/standard/facets/erb.rb +0 -66
- data/src/standard/facets/fileutils.rb +0 -13
- data/src/standard/facets/fileutils/amass.rb +0 -33
- data/src/standard/facets/fileutils/cp_rx.rb +0 -44
- data/src/standard/facets/fileutils/head.rb +0 -1
- data/src/standard/facets/fileutils/ln_r.rb +0 -99
- data/src/standard/facets/fileutils/outofdate.rb +0 -38
- data/src/standard/facets/fileutils/safe_ln.rb +0 -27
- data/src/standard/facets/fileutils/slice.rb +0 -55
- data/src/standard/facets/fileutils/stage.rb +0 -66
- data/src/standard/facets/fileutils/tail.rb +0 -1
- data/src/standard/facets/fileutils/wc.rb +0 -63
- data/src/standard/facets/fileutils/whereis.rb +0 -66
- data/src/standard/facets/fileutils/which.rb +0 -60
- data/src/standard/facets/find.rb +0 -16
- data/src/standard/facets/getoptlong.rb +0 -59
- data/src/standard/facets/math.rb +0 -6
- data/src/standard/facets/math/abs.rb +0 -8
- data/src/standard/facets/math/acot.rb +0 -8
- data/src/standard/facets/math/acoth.rb +0 -8
- data/src/standard/facets/math/acsc.rb +0 -8
- data/src/standard/facets/math/acsch.rb +0 -8
- data/src/standard/facets/math/amd.rb +0 -17
- data/src/standard/facets/math/approx_equal.rb +0 -15
- data/src/standard/facets/math/asec.rb +0 -8
- data/src/standard/facets/math/asech.rb +0 -8
- data/src/standard/facets/math/atkinson_index.rb +0 -16
- data/src/standard/facets/math/beta.rb +0 -9
- data/src/standard/facets/math/cdf.rb +0 -10
- data/src/standard/facets/math/ceil.rb +0 -8
- data/src/standard/facets/math/cot.rb +0 -8
- data/src/standard/facets/math/coth.rb +0 -8
- data/src/standard/facets/math/csc.rb +0 -8
- data/src/standard/facets/math/csch.rb +0 -8
- data/src/standard/facets/math/delta.rb +0 -9
- data/src/standard/facets/math/epsilon.rb +0 -21
- data/src/standard/facets/math/exp10.rb +0 -8
- data/src/standard/facets/math/exp2.rb +0 -8
- data/src/standard/facets/math/factorial.rb +0 -37
- data/src/standard/facets/math/floor.rb +0 -8
- data/src/standard/facets/math/gamma.rb +0 -12
- data/src/standard/facets/math/gcd.rb +0 -23
- data/src/standard/facets/math/gini_coefficient.rb +0 -33
- data/src/standard/facets/math/kldivergence.rb +0 -19
- data/src/standard/facets/math/lcm.rb +0 -15
- data/src/standard/facets/math/lgamma.rb +0 -21
- data/src/standard/facets/math/linsolve.rb +0 -10
- data/src/standard/facets/math/log2.rb +0 -14
- data/src/standard/facets/math/max.rb +0 -1
- data/src/standard/facets/math/mean.rb +0 -16
- data/src/standard/facets/math/median.rb +0 -15
- data/src/standard/facets/math/min.rb +0 -35
- data/src/standard/facets/math/pow.rb +0 -8
- data/src/standard/facets/math/pstd.rb +0 -1
- data/src/standard/facets/math/pvariance.rb +0 -1
- data/src/standard/facets/math/rmd.rb +0 -16
- data/src/standard/facets/math/root.rb +0 -8
- data/src/standard/facets/math/sec.rb +0 -8
- data/src/standard/facets/math/sech.rb +0 -8
- data/src/standard/facets/math/sign.rb +0 -9
- data/src/standard/facets/math/sinc.rb +0 -8
- data/src/standard/facets/math/sqr.rb +0 -8
- data/src/standard/facets/math/sqsolve.rb +0 -53
- data/src/standard/facets/math/std.rb +0 -27
- data/src/standard/facets/math/stderr.rb +0 -1
- data/src/standard/facets/math/sum.rb +0 -16
- data/src/standard/facets/math/summed_sqdevs.rb +0 -14
- data/src/standard/facets/math/theil_index.rb +0 -24
- data/src/standard/facets/math/variance.rb +0 -31
- data/src/standard/facets/net/http.rb +0 -32
- data/src/standard/facets/ostruct.rb +0 -210
- data/src/standard/facets/pathname.rb +0 -240
- data/src/standard/facets/random.rb +0 -446
- data/src/standard/facets/rbconfig.rb +0 -78
- data/src/standard/facets/set.rb +0 -32
- data/src/standard/facets/shellwords.rb +0 -112
- data/src/standard/facets/strscan.rb +0 -16
- data/src/standard/facets/thread.rb +0 -98
- data/src/standard/facets/uri.rb +0 -211
- data/src/standard/facets/yaml.rb +0 -59
- data/src/standard/facets/zlib.rb +0 -38
- data/src/supplemental/facets/argvector.rb +0 -343
- data/src/supplemental/facets/atomicfile.rb +0 -51
- data/src/supplemental/facets/enumargs.rb +0 -195
- data/src/supplemental/facets/interval.rb +0 -284
- data/src/supplemental/facets/main.rb +0 -62
- data/src/supplemental/facets/memoizable.rb +0 -141
- data/src/supplemental/facets/metaid.rb +0 -7
- data/src/supplemental/facets/multipliers.rb +0 -65
- data/src/supplemental/facets/multiton.rb +0 -387
- data/src/supplemental/facets/nullclass.rb +0 -38
- data/src/supplemental/facets/opesc.rb +0 -79
- data/src/supplemental/facets/platform.rb +0 -377
- data/src/supplemental/facets/reference.rb +0 -83
- data/src/supplemental/facets/tuple.rb +0 -282
- data/test/core-uncommon/array/test_median.rb +0 -12
- data/test/core-uncommon/array/test_percentile.rb +0 -12
- data/test/core-uncommon/module/test_cattr.rb +0 -53
- data/test/core-uncommon/module/test_prepend.rb +0 -26
- data/work/CHANGES +0 -2529
- data/work/NOTES.rdoc +0 -143
- data/work/bench/bench_load.rb +0 -56
- data/work/bench/enumerable/bench_collect.rb +0 -84
- data/work/bench/enumerable/bench_count.rb +0 -58
- data/work/bench/general/bench_calls.rb +0 -74
- data/work/bench/general/bench_includes.rb +0 -25
- data/work/bench/general/bench_methods.rb +0 -17
- data/work/bench/general/bench_pathname.rb +0 -24
- data/work/bench/general/bench_range.rb +0 -64
- data/work/bench/general/bench_return.rb +0 -56
- data/work/bench/general/bench_yeild.rb +0 -75
- data/work/bench/general/comment_loading/bench.rb +0 -46
- data/work/bench/general/comment_loading/comments_begin.rb +0 -109
- data/work/bench/general/comment_loading/comments_end.rb +0 -127
- data/work/bench/general/comment_loading/comments_none.rb +0 -1
- data/work/bench/general/comment_loading/comments_sharp.rb +0 -125
- data/work/bench/hash/bench_slice.rb +0 -62
- data/work/bench/integer/bench_factorial.rb +0 -31
- data/work/consider/aspects.rb +0 -254
- data/work/consider/attr.rb +0 -82
- data/work/consider/bin.rb +0 -26
- data/work/consider/blackmagic.rb +0 -103
- data/work/consider/bool_attr_accessor.rb +0 -414
- data/work/consider/duration.rb +0 -286
- data/work/consider/forwardable_chain.patch +0 -448
- data/work/consider/knowself.rb +0 -42
- data/work/consider/lib/core/facets.rb +0 -37
- data/work/consider/lib/core/facets/array/fetch.rb +0 -37
- data/work/consider/lib/core/facets/array/op_div.rb +0 -23
- data/work/consider/lib/core/facets/hash/having.rb +0 -75
- data/work/consider/lib/core/facets/string/trim.rb +0 -70
- data/work/consider/lib/more/facets/argv.rb +0 -47
- data/work/consider/lib/more/facets/extension.rb +0 -30
- data/work/consider/lib/more/facets/fixnum.rb +0 -55
- data/work/consider/lib/more/facets/forwardable_chain.patch +0 -448
- data/work/consider/lib/more/facets/gem.rb +0 -23
- data/work/consider/lib/more/facets/interface.rb +0 -230
- data/work/consider/lib/more/facets/plugin.rb +0 -153
- data/work/consider/lib/more/facets/recorder.rb +0 -54
- data/work/consider/lib/more/facets/tasksystem.rb +0 -350
- data/work/consider/mapcar.rb +0 -74
- data/work/consider/require_directory.rb +0 -4
- data/work/consider/set.rb +0 -47
- data/work/consider/succ.rb +0 -44
- data/work/consider/succ_case.rb +0 -39
- data/work/defunct/core/facets/array/combinations.rb +0 -33
- data/work/defunct/core/facets/array/combos.rb +0 -47
- data/work/defunct/core/facets/array/each_uniq_pair.rb +0 -43
- data/work/defunct/core/facets/array/permutation.rb +0 -75
- data/work/defunct/core/facets/array/to_path.rb +0 -14
- data/work/defunct/core/facets/class/initializer.rb +0 -60
- data/work/defunct/core/facets/class/prepend.rb +0 -52
- data/work/defunct/core/facets/class/remove_descendents.rb +0 -42
- data/work/defunct/core/facets/enumerable/cascade.rb +0 -28
- data/work/defunct/core/facets/enumerable/each.rb +0 -89
- data/work/defunct/core/facets/enumerable/to_hash.rb +0 -30
- data/work/defunct/core/facets/hash/access.rb +0 -146
- data/work/defunct/core/facets/hash/group_by_value.rb +0 -66
- data/work/defunct/core/facets/hash/normalize_keys.rb +0 -134
- data/work/defunct/core/facets/hash/op_div.rb +0 -11
- data/work/defunct/core/facets/hash/variablize_keys.rb +0 -48
- data/work/defunct/core/facets/kernel/__assign__.rb +0 -28
- data/work/defunct/core/facets/kernel/__real__.rb +0 -48
- data/work/defunct/core/facets/kernel/deep_clone.rb +0 -48
- data/work/defunct/core/facets/kernel/instance_assume.rb +0 -66
- data/work/defunct/core/facets/kernel/once.rb +0 -54
- data/work/defunct/core/facets/kernel/warn_with_line.rb +0 -29
- data/work/defunct/core/facets/method/curry.rb +0 -10
- data/work/defunct/core/facets/method/partial.rb +0 -10
- data/work/defunct/core/facets/module/attr_toggler.rb +0 -59
- data/work/defunct/core/facets/module/by_name.rb +0 -56
- data/work/defunct/core/facets/module/compare_on.rb +0 -35
- data/work/defunct/core/facets/module/equate_on.rb +0 -36
- data/work/defunct/core/facets/module/methodize.rb +0 -19
- data/work/defunct/core/facets/module/module_method.rb +0 -14
- data/work/defunct/core/facets/module/on_included.rb +0 -80
- data/work/defunct/core/facets/proc/bind.rb +0 -38
- data/work/defunct/core/facets/proc/to_h.rb +0 -22
- data/work/defunct/core/facets/string/camelcase.rb +0 -25
- data/work/defunct/core/facets/string/indexable.rb +0 -144
- data/work/defunct/core/facets/string/stackable.rb +0 -181
- data/work/defunct/core/facets/string/to_const.rb +0 -31
- data/work/defunct/core/facets/string/to_proc.rb +0 -52
- data/work/defunct/core/facets/symbol/pad.rb +0 -1
- data/work/defunct/core/facets/symbol/shadow.rb +0 -37
- data/work/defunct/core/facets/symbol/to_const.rb +0 -31
- data/work/defunct/more/facets/annotations.rb +0 -302
- data/work/defunct/more/facets/duration.rb +0 -540
- data/work/defunct/more/facets/logger.rb +0 -158
- data/work/defunct/more/facets/multiton.rb +0 -390
- data/work/defunct/more/facets/multiton2.rb +0 -237
- data/work/defunct/more/facets/uploadutils.rb +0 -466
- data/work/defunct/script/conflicts +0 -63
- data/work/defunct/script/methods +0 -49
- data/work/defunct/test/string/test_crypt.rb +0 -17
- data/work/defunct/test/string/test_indexable.rb +0 -68
- data/work/defunct/test/string/test_stackable.rb +0 -94
- data/work/defunct/test/string/test_stylize.rb +0 -52
- data/work/defunct/test/test_continuation.rb +0 -15
- data/work/defunct/test/test_instance_exec.rb +0 -44
- data/work/defunct/test/test_ioredirect.rb +0 -23
- data/work/defunct/test/test_prepend.rb +0 -19
- data/work/defunct/test/test_succ.rb +0 -35
- data/work/defunct/yard.assembly +0 -44
- data/work/sandbox/component.rb +0 -120
- data/work/sandbox/enumerator.rb +0 -12
- data/work/sandbox/enumx.rb +0 -116
- data/work/sandbox/express.rb +0 -48
- data/work/sandbox/multidispatch.rb +0 -236
- data/work/sandbox/multidispatch0.rb +0 -224
- data/work/sandbox/multiton2.rb +0 -590
- data/work/sandbox/namespace.rb +0 -169
- data/work/sandbox/safe-study/safe_extension.rb +0 -17
- data/work/sandbox/safe-study/safe_study.rb +0 -16
- data/work/sandbox/to_data.rb +0 -141
- data/work/sandbox/visit.rb +0 -62
- data/work/site/endorse.page +0 -65
- data/work/site/posts/2010-01-25-test_rails_with_facets.post +0 -151
- data/work/site/posts/enumargs.md +0 -30
- data/work/site/posts/tomslib.rb +0 -47
- data/work/site/posts/weblog.xml +0 -78
- data/work/site/sidebar.txt +0 -19
- data/work/todo/more/test_basicobject.rb +0 -34
- data/work/todo/more/test_fileutils_slice.rb +0 -88
- data/work/todo/more/test_fileutils_wc.rb +0 -53
- data/work/todo/more/test_fileutils_which.rb +0 -45
- data/work/todo/more/test_getoptlong.rb +0 -26
- data/work/todo/more/test_multiton.rb +0 -184
- data/work/trash/hook.rdoc +0 -49
- data/work/trash/menu.html +0 -71
- data/work/trash/site-jekyll/.htaccess +0 -1
- data/work/trash/site-jekyll/.rsync-filter +0 -7
- data/work/trash/site-jekyll/.till +0 -1
- data/work/trash/site-jekyll/_config.yml +0 -6
- data/work/trash/site-jekyll/_layouts/default.html +0 -101
- data/work/trash/site-jekyll/_layouts/post.html +0 -23
- data/work/trash/site-jekyll/_posts/2008-01-01-how-facets-was-born.markdown +0 -25
- data/work/trash/site-jekyll/_posts/2008-04-04-times-collect.markdown +0 -33
- data/work/trash/site-jekyll/_posts/2008-10-10-string-margin.markdown +0 -52
- data/work/trash/site-jekyll/_posts/2009-07-21-new-website.markdown +0 -16
- data/work/trash/site-jekyll/_posts/2009-08-22-release-2-7.markdown +0 -127
- data/work/trash/site-jekyll/_posts/2009-11-09-release-2-8.markdown +0 -58
- data/work/trash/site-jekyll/about.html +0 -79
- data/work/trash/site-jekyll/assets/scripts/hover.js +0 -14
- data/work/trash/site-jekyll/assets/scripts/rdocs.js +0 -28
- data/work/trash/site-jekyll/assets/styles/site.css +0 -317
- data/work/trash/site-jekyll/assets/styles/syntax.css +0 -60
- data/work/trash/site-jekyll/atom.xml +0 -23
- data/work/trash/site-jekyll/community.html +0 -72
- data/work/trash/site-jekyll/download.html +0 -84
- data/work/trash/site-jekyll/endorse.html +0 -64
- data/work/trash/site-jekyll/index.html +0 -17
- data/work/trash/site-jekyll/learn.html +0 -221
- data/work/trash/site-jekyll/source.html +0 -74
- data/work/trash/site/.htaccess +0 -1
- data/work/trash/site/.rsync-filter +0 -10
- data/work/trash/site/js/hover.js +0 -14
- data/work/trash/site/js/rdocs.js +0 -28
- data/work/trash/site/quick.html +0 -250
- data/work/trash/site/splash.html +0 -44
- data/work/trash/task/count +0 -48
- data/work/trash/task/load +0 -40
- data/work/trash/task/publish +0 -83
- data/work/trash/task/tag +0 -26
- data/work/trash/test_inject.rb +0 -17
@@ -1,224 +0,0 @@
|
|
1
|
-
require 'facets/core/kernel/instance_exec'
|
2
|
-
|
3
|
-
module MultipleDispatch
|
4
|
-
|
5
|
-
class Dispatcher
|
6
|
-
|
7
|
-
def initialize(name, lists)
|
8
|
-
@name = name
|
9
|
-
@lists = lists
|
10
|
-
end
|
11
|
-
|
12
|
-
def run(you, args)
|
13
|
-
@lists.each do |list|
|
14
|
-
catch(:mismatch) do
|
15
|
-
return list.match(you, args)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
begin
|
19
|
-
raise NoMethodError.new("undefined method `#{@name}' for #{you.inspect}:#{you.class}")
|
20
|
-
rescue NoMethodError => e
|
21
|
-
e.set_backtrace(e.backtrace[2..-1])
|
22
|
-
raise e
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
class ArgumentList
|
29
|
-
|
30
|
-
def initialize(required, optional, defaults, catch_all, catch_all_type, &action)
|
31
|
-
@required = required
|
32
|
-
@optional = optional
|
33
|
-
@defaults = defaults
|
34
|
-
@catch_all = catch_all
|
35
|
-
@catch_all_type = catch_all_type
|
36
|
-
@action = action
|
37
|
-
calc_arity
|
38
|
-
end
|
39
|
-
|
40
|
-
def calc_arity
|
41
|
-
@min_arity = @required.length
|
42
|
-
@max_arity = (@min_arity + @optional.length unless @catch_all)
|
43
|
-
end
|
44
|
-
|
45
|
-
def match(you, args)
|
46
|
-
throw :mismatch if args.length < @min_arity
|
47
|
-
throw :mismatch if @max_arity && @max_arity < args.length
|
48
|
-
(0...@required.length).each do |i|
|
49
|
-
throw :mismatch unless @required[i] === args[i]
|
50
|
-
end
|
51
|
-
(@required.length...[args.length, @required.length + @optional.length].min).each do |i|
|
52
|
-
throw :mismatch unless @optional[i - @required.length] === args[i]
|
53
|
-
end
|
54
|
-
(args.length - @required.length...@optional.length).each do |i|
|
55
|
-
args << @defaults[i]
|
56
|
-
end
|
57
|
-
if @catch_all
|
58
|
-
(@required.length + @optional.length...args.length).each do |i|
|
59
|
-
throw :mismatch unless @catch_all_type === args[i]
|
60
|
-
end
|
61
|
-
you.instance_exec(*(args[0, @required.length + @optional.length] << args[@required.length + @optional.length..-1]), &@action)
|
62
|
-
else
|
63
|
-
you.instance_exec(*args, &@action)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
68
|
-
|
69
|
-
module ArgumentChanger
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
class PropertyDispatch
|
74
|
-
|
75
|
-
def initialize(&blk)
|
76
|
-
@blk = blk
|
77
|
-
end
|
78
|
-
|
79
|
-
def ===(arg)
|
80
|
-
@blk.call(arg)
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
84
|
-
|
85
|
-
class CastDispatch
|
86
|
-
|
87
|
-
include ArgumentChanger
|
88
|
-
|
89
|
-
def initialize(type)
|
90
|
-
@type = :"to_#{type}"
|
91
|
-
end
|
92
|
-
|
93
|
-
def ===(arg)
|
94
|
-
arg.send(@type) rescue nil
|
95
|
-
end
|
96
|
-
|
97
|
-
def changes_argument?
|
98
|
-
true
|
99
|
-
end
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
class AndDispatch
|
104
|
-
|
105
|
-
def initialize(subterms)
|
106
|
-
@subterms = subterms
|
107
|
-
end
|
108
|
-
|
109
|
-
def ===(arg)
|
110
|
-
@subterms.each do |t|
|
111
|
-
return false unless t === arg
|
112
|
-
end
|
113
|
-
true
|
114
|
-
end
|
115
|
-
|
116
|
-
end
|
117
|
-
|
118
|
-
class OrDispatch
|
119
|
-
|
120
|
-
def initialize(subterms)
|
121
|
-
@subterms = subterms
|
122
|
-
end
|
123
|
-
|
124
|
-
def ===(arg)
|
125
|
-
@subterms.each do |t|
|
126
|
-
return true if t === arg
|
127
|
-
end
|
128
|
-
false
|
129
|
-
end
|
130
|
-
|
131
|
-
end
|
132
|
-
|
133
|
-
class DontCareDispatch
|
134
|
-
|
135
|
-
def initialize
|
136
|
-
|
137
|
-
end
|
138
|
-
|
139
|
-
def ===(arg)
|
140
|
-
true
|
141
|
-
end
|
142
|
-
|
143
|
-
end
|
144
|
-
|
145
|
-
end
|
146
|
-
|
147
|
-
if __FILE__ == $0
|
148
|
-
|
149
|
-
include MultipleDispatch
|
150
|
-
|
151
|
-
class A
|
152
|
-
|
153
|
-
def m(*args, &blk)
|
154
|
-
# Argument list 1
|
155
|
-
arg1 = ArgumentList.new([String, String], [], [], false, nil) do |s1, s2|
|
156
|
-
yield [:two_strings, s1, s2]
|
157
|
-
end
|
158
|
-
# Argument list 2
|
159
|
-
arg2 = ArgumentList.new([String, Integer], [], [], false, nil) do |s, i|
|
160
|
-
yield [:string_and_integer, s, i]
|
161
|
-
end
|
162
|
-
# Argument list 3
|
163
|
-
arg3 = ArgumentList.new([Integer, Integer, Integer], [], [], false, nil) do |i1, i2, i3|
|
164
|
-
yield [:three_integers, i1, i2, i3]
|
165
|
-
end
|
166
|
-
# Argument list 4
|
167
|
-
arg4 = ArgumentList.new([:do1, Integer], [], [], false, nil) do |_, i|
|
168
|
-
yield [:do1, i]
|
169
|
-
end
|
170
|
-
# Argument list 5
|
171
|
-
arg5 = ArgumentList.new([:do2, Integer], [], [], false, nil) do |_, i|
|
172
|
-
yield [:do2, i]
|
173
|
-
end
|
174
|
-
# Argument list 6
|
175
|
-
arg6 = ArgumentList.new([:do3, Integer], [Integer, String], [11, "extra"], false, nil) do |_, i1, i2, s|
|
176
|
-
yield [:do3, i1, i2, s]
|
177
|
-
end
|
178
|
-
# Argument list 7
|
179
|
-
arg7 = ArgumentList.new([:do4], [], [], true, Integer) do |_, args|
|
180
|
-
yield [:do4, args]
|
181
|
-
end
|
182
|
-
# Argument list 8
|
183
|
-
arg8 = ArgumentList.new([:do4], [], [], true, String) do |_, args|
|
184
|
-
yield [:do4, args]
|
185
|
-
end
|
186
|
-
# Argument list 9
|
187
|
-
arg9 = ArgumentList.new([PropertyDispatch.new { |a| :do5 === a }], [], [], false, nil) do |_|
|
188
|
-
yield [:do5]
|
189
|
-
end
|
190
|
-
# Argument list 10
|
191
|
-
arg10 = ArgumentList.new([/run/, DontCareDispatch.new], [], [], false, nil) do |i, dc|
|
192
|
-
yield [:run, i, dc]
|
193
|
-
end
|
194
|
-
# Argument list 11
|
195
|
-
arg11 = ArgumentList.new([:do6, CastDispatch.new(:sym)], [], [], false, nil) do |_, s|
|
196
|
-
yield [:do6, s]
|
197
|
-
end
|
198
|
-
|
199
|
-
# Dispatcher
|
200
|
-
d = Dispatcher.new(:'test', [arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11])
|
201
|
-
|
202
|
-
d.run(self, args)
|
203
|
-
end
|
204
|
-
|
205
|
-
end
|
206
|
-
|
207
|
-
A.new.m("hello", "world") { |a| p a }
|
208
|
-
A.new.m("world", 1) { |a| p a }
|
209
|
-
A.new.m(1, 2, 3) { |a| p a }
|
210
|
-
A.new.m(:do1, 1) { |a| p a }
|
211
|
-
A.new.m(:do2, 2) { |a| p a }
|
212
|
-
A.new.m(:do3, 3, 4, "a1") { |a| p a }
|
213
|
-
A.new.m(:do3, 3, 4) { |a| p a }
|
214
|
-
A.new.m(:do3, 3) { |a| p a }
|
215
|
-
A.new.m(:do4) { |a| p a }
|
216
|
-
A.new.m(:do4, 2) { |a| p a }
|
217
|
-
A.new.m(:do4, 2, 3) { |a| p a }
|
218
|
-
A.new.m(:do4, "2", "3") { |a| p a }
|
219
|
-
A.new.m(:do5) { |a| p a }
|
220
|
-
A.new.m("grunt", 1) { |a| p a }
|
221
|
-
A.new.m("grunt", :a) { |a| p a }
|
222
|
-
A.new.m(:do6, "hi") { |a| p a }
|
223
|
-
|
224
|
-
end
|
data/work/sandbox/multiton2.rb
DELETED
@@ -1,590 +0,0 @@
|
|
1
|
-
|
2
|
-
module Multiton
|
3
|
-
|
4
|
-
# disable build-in copying methods
|
5
|
-
def clone
|
6
|
-
raise TypeError, "can't clone Multiton #{self}"
|
7
|
-
end
|
8
|
-
|
9
|
-
def dup
|
10
|
-
raise TypeError, "can't dup Multiton #{self}"
|
11
|
-
end
|
12
|
-
|
13
|
-
protected # default marshalling strategy
|
14
|
-
def _dump(depth=-1)
|
15
|
-
Marshal.dump(@multiton_initializer)
|
16
|
-
end
|
17
|
-
|
18
|
-
#
|
19
|
-
|
20
|
-
class << self
|
21
|
-
private
|
22
|
-
def append_features(mod)
|
23
|
-
# help out people counting on transitive mixins
|
24
|
-
unless mod.instance_of?(Class)
|
25
|
-
raise TypeError, "Inclusion of Multiton in module #{mod}"
|
26
|
-
end
|
27
|
-
super
|
28
|
-
end
|
29
|
-
|
30
|
-
def included(klass)
|
31
|
-
# gracefully handle multiple inclusions of Multiton
|
32
|
-
unless class << klass; include?(Multiton::ClassMethods) end
|
33
|
-
klass.private_class_method :new, :allocate
|
34
|
-
klass.extend Multiton::ClassMethods
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
#
|
40
|
-
|
41
|
-
module ClassMethods
|
42
|
-
|
43
|
-
def instance(*e)
|
44
|
-
arg = multiton_id(e)
|
45
|
-
@multiton_instance.fetch(arg) do
|
46
|
-
@multiton_mutex[arg].synchronize do
|
47
|
-
@multiton_instance.fetch(arg) do
|
48
|
-
val = @multiton_instance[arg] = new(*e)
|
49
|
-
val.instance_variable_set(:@multiton_initializer,e)
|
50
|
-
@multiton_mutex.initialized(arg)
|
51
|
-
val
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def initialized?(*e)
|
58
|
-
@multiton_instance.key?(multiton_id(e))
|
59
|
-
end
|
60
|
-
|
61
|
-
protected
|
62
|
-
def reinitialize
|
63
|
-
@multiton_instance.clear
|
64
|
-
@multiton_mutex.clear
|
65
|
-
end
|
66
|
-
|
67
|
-
def _load(str)
|
68
|
-
instance(*Marshal.load(str))
|
69
|
-
end
|
70
|
-
|
71
|
-
private
|
72
|
-
def multiton_id(e)
|
73
|
-
e
|
74
|
-
end
|
75
|
-
|
76
|
-
def initialize_copy(orig)
|
77
|
-
super
|
78
|
-
Multiton::ClassMethods.extended(self)
|
79
|
-
end
|
80
|
-
|
81
|
-
def inherited(sub)
|
82
|
-
super
|
83
|
-
Multiton::ClassMethods.extended(sub)
|
84
|
-
end
|
85
|
-
|
86
|
-
class << self
|
87
|
-
protected
|
88
|
-
def extended(klass)
|
89
|
-
klass.class_eval do
|
90
|
-
@multiton_instance = Hash.new
|
91
|
-
@multiton_mutex = InstanceMutex.new
|
92
|
-
|
93
|
-
private
|
94
|
-
# Defining marshal_dump & marshal_load instance methods introduces
|
95
|
-
# a loop hole to create additonal instances. Providing a private
|
96
|
-
# marshal_dump method forces Ruby to fall back on the _dump & _load
|
97
|
-
# marshalling scheme. When $VERBOSE == true issue a method re-
|
98
|
-
# definition warning for (re)defining marshal_dump.
|
99
|
-
def marshal_dump(depth = -1)
|
100
|
-
raise TypeError, "don't use marshal_load + marshal_dump marshalling"
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
class InstanceMutex < Hash
|
106
|
-
def initialize
|
107
|
-
@global = Mutex.new
|
108
|
-
end
|
109
|
-
|
110
|
-
def initialized(arg)
|
111
|
-
store(arg,DummyMutex)
|
112
|
-
end
|
113
|
-
|
114
|
-
def (DummyMutex = Object.new).synchronize
|
115
|
-
yield
|
116
|
-
end
|
117
|
-
|
118
|
-
def default(arg)
|
119
|
-
@global.synchronize { fetch(arg) { store(arg,Mutex.new) }}
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
module Multiton
|
152
|
-
# disable build-in copying methods
|
153
|
-
def clone
|
154
|
-
raise TypeError, "can't clone Multiton #{self}"
|
155
|
-
end
|
156
|
-
|
157
|
-
def dup
|
158
|
-
raise TypeError, "can't dup Multiton #{self}"
|
159
|
-
end
|
160
|
-
|
161
|
-
protected # default marshalling strategy
|
162
|
-
def _dump(depth=-1)
|
163
|
-
Marshal.dump(@multiton_initializer)
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
class << Multiton
|
168
|
-
private
|
169
|
-
def append_features(mod)
|
170
|
-
# help out people counting on transitive mixins
|
171
|
-
unless mod.instance_of?(Class)
|
172
|
-
raise TypeError, "Inclusion of Multiton in module #{mod}"
|
173
|
-
end
|
174
|
-
super
|
175
|
-
end
|
176
|
-
|
177
|
-
def included(klass)
|
178
|
-
# gracefully handle multiple inclusions of Multiton
|
179
|
-
unless class << klass; include?(Multiton::ClassMethods) end
|
180
|
-
klass.private_class_method :new,:allocate
|
181
|
-
klass.extend Multiton::ClassMethods
|
182
|
-
end
|
183
|
-
end
|
184
|
-
end
|
185
|
-
|
186
|
-
module Multiton::ClassMethods
|
187
|
-
def instance(*e)
|
188
|
-
arg = multiton_id(e)
|
189
|
-
@multiton_instance.fetch(arg) {
|
190
|
-
@multiton_mutex[arg].synchronize {
|
191
|
-
@multiton_instance.fetch(arg) {
|
192
|
-
val = @multiton_instance[arg] = new(*e)
|
193
|
-
val.instance_variable_set(:@multiton_initializer,e)
|
194
|
-
@multiton_mutex.initialized(arg)
|
195
|
-
val
|
196
|
-
}}}
|
197
|
-
end
|
198
|
-
|
199
|
-
def initialized?(*e)
|
200
|
-
@multiton_instance.key?(multiton_id(e))
|
201
|
-
end
|
202
|
-
|
203
|
-
protected
|
204
|
-
def reinitialize
|
205
|
-
@multiton_instance.clear
|
206
|
-
@multiton_mutex.clear
|
207
|
-
end
|
208
|
-
|
209
|
-
def _load(str)
|
210
|
-
instance(*Marshal.load(str))
|
211
|
-
end
|
212
|
-
|
213
|
-
private
|
214
|
-
def multiton_id(e)
|
215
|
-
e
|
216
|
-
end
|
217
|
-
|
218
|
-
def initialize_copy(orig)
|
219
|
-
super
|
220
|
-
Multiton::ClassMethods.extended(self)
|
221
|
-
end
|
222
|
-
|
223
|
-
def inherited(sub)
|
224
|
-
super
|
225
|
-
Multiton::ClassMethods.extended(sub)
|
226
|
-
end
|
227
|
-
end
|
228
|
-
|
229
|
-
class << Multiton::ClassMethods
|
230
|
-
protected
|
231
|
-
def extended(klass)
|
232
|
-
klass.class_eval do
|
233
|
-
@multiton_instance = Hash.new
|
234
|
-
@multiton_mutex = InstanceMutex.new
|
235
|
-
|
236
|
-
private
|
237
|
-
# Defining marshal_dump & marshal_load instance methods introduces
|
238
|
-
# a loop hole to create additonal instances. Providing a private
|
239
|
-
# marshal_dump method forces Ruby to fall back on the _dump & _load
|
240
|
-
# marshalling scheme. When $VERBOSE == true issue a method re-
|
241
|
-
# definition warning for (re)defining marshal_dump.
|
242
|
-
def marshal_dump(depth = -1)
|
243
|
-
raise TypeError, "don't use marshal_load + marshal_dump marshalling"
|
244
|
-
end
|
245
|
-
end
|
246
|
-
end
|
247
|
-
|
248
|
-
class InstanceMutex < Hash
|
249
|
-
def initialize
|
250
|
-
@global = Mutex.new
|
251
|
-
end
|
252
|
-
|
253
|
-
def initialized(arg)
|
254
|
-
store(arg,DummyMutex)
|
255
|
-
end
|
256
|
-
|
257
|
-
def (DummyMutex = Object.new).synchronize
|
258
|
-
yield
|
259
|
-
end
|
260
|
-
|
261
|
-
def default(arg)
|
262
|
-
@global.synchronize { fetch(arg) { store(arg,Mutex.new) }}
|
263
|
-
end
|
264
|
-
end
|
265
|
-
end
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
### Simple marshalling test #######
|
271
|
-
class A
|
272
|
-
def initialize(a,*e)
|
273
|
-
@e = a
|
274
|
-
end
|
275
|
-
|
276
|
-
include Multiton
|
277
|
-
|
278
|
-
end
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
C = Class.new(A.clone)
|
284
|
-
s = C.instance('a','b')
|
285
|
-
|
286
|
-
raise unless Marshal.load(Marshal.dump(s)) == s
|
287
|
-
|
288
|
-
|
289
|
-
### Interdependent initialization example and threading benchmark ###
|
290
|
-
|
291
|
-
class Regular_SymPlane
|
292
|
-
def self.multiton_id(e)
|
293
|
-
a,b = e
|
294
|
-
(a+b - 1)*(a+b )/2 + (a > b ? a : b)
|
295
|
-
end
|
296
|
-
|
297
|
-
def initialize(a,b)
|
298
|
-
klass = self.class
|
299
|
-
if a < b
|
300
|
-
@l = b > 0 ? klass.instance(a,b-1) : nil
|
301
|
-
@r = a > 0 ? klass.instance(a-1,b) : nil
|
302
|
-
else
|
303
|
-
@l = a > 0 ? klass.instance(a-1,b) : nil
|
304
|
-
@r = b > 0 ? klass.instance(a,b-1) : nil
|
305
|
-
end
|
306
|
-
end
|
307
|
-
|
308
|
-
include Multiton
|
309
|
-
end
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
def nap
|
314
|
-
# Thread.pass
|
315
|
-
sleep(rand(0.01))
|
316
|
-
end
|
317
|
-
|
318
|
-
class SymPlane < Regular_SymPlane
|
319
|
-
@m = Mutex.new
|
320
|
-
@count = 0
|
321
|
-
end
|
322
|
-
|
323
|
-
class << SymPlane
|
324
|
-
attr_reader :count
|
325
|
-
def reinitialize
|
326
|
-
super
|
327
|
-
@m = Mutex.new
|
328
|
-
@count = 0
|
329
|
-
end
|
330
|
-
def inherited(sub_class)
|
331
|
-
super
|
332
|
-
sub_class.instance_eval { @m = Mutex.new; @count = 0 }
|
333
|
-
end
|
334
|
-
|
335
|
-
def multiton_id(e)
|
336
|
-
nap()
|
337
|
-
super
|
338
|
-
end
|
339
|
-
|
340
|
-
def new(*e)
|
341
|
-
super
|
342
|
-
ensure
|
343
|
-
nap()
|
344
|
-
@m.synchronize { p @count if (@count += 1) % 15 == 0 }
|
345
|
-
end
|
346
|
-
|
347
|
-
def run(k)
|
348
|
-
threads = 0
|
349
|
-
max = k * (k+1) / 2
|
350
|
-
puts ""
|
351
|
-
while count() < max
|
352
|
-
Thread.new { threads+= 1; instance(rand(30),rand(30)) }
|
353
|
-
end
|
354
|
-
puts "\nThe simulation created #{threads} threads"
|
355
|
-
end
|
356
|
-
end
|
357
|
-
|
358
|
-
|
359
|
-
require 'Benchmark'
|
360
|
-
include Benchmark
|
361
|
-
|
362
|
-
bmbm do |x|
|
363
|
-
x.report('Initialize 465 SymPlane instances') { SymPlane.run(30) }
|
364
|
-
x.report('Reinitialize ') do
|
365
|
-
sleep 3
|
366
|
-
SymPlane.reinitialize
|
367
|
-
end
|
368
|
-
end
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
module Multiton
|
387
|
-
# disable build-in copying methods
|
388
|
-
def clone
|
389
|
-
raise TypeError, "can't clone Multiton #{self}"
|
390
|
-
end
|
391
|
-
|
392
|
-
def dup
|
393
|
-
raise TypeError, "can't dup Multiton #{self}"
|
394
|
-
end
|
395
|
-
|
396
|
-
protected # default marshalling strategy
|
397
|
-
def _dump(depth=-1)
|
398
|
-
Marshal.dump(@multiton_initializer)
|
399
|
-
end
|
400
|
-
end
|
401
|
-
|
402
|
-
class << Multiton
|
403
|
-
private
|
404
|
-
def append_features(mod)
|
405
|
-
# help out people counting on transitive mixins
|
406
|
-
unless mod.instance_of?(Class)
|
407
|
-
raise TypeError, "Inclusion of Multiton in module #{mod}"
|
408
|
-
end
|
409
|
-
super
|
410
|
-
end
|
411
|
-
|
412
|
-
def included(klass)
|
413
|
-
# gracefully handle multiple inclusions of Multiton
|
414
|
-
unless class << klass; include?(Multiton::ClassMethods) end
|
415
|
-
klass.private_class_method :new, :allocate
|
416
|
-
klass.extend Multiton::ClassMethods
|
417
|
-
end
|
418
|
-
end
|
419
|
-
end
|
420
|
-
|
421
|
-
|
422
|
-
module Multiton::ClassMethods
|
423
|
-
class SyncHash < Hash
|
424
|
-
def initialize
|
425
|
-
@global = Mutex.new
|
426
|
-
super {|a,b| @global.synchronize {|| fetch(b) {|| a[b]= yield }}}
|
427
|
-
end
|
428
|
-
end
|
429
|
-
|
430
|
-
PoolInstance = SyncHash.new{ Hash.new }
|
431
|
-
PoolInstanceMutex = SyncHash.new{ SyncHash.new{ Mutex.new }}
|
432
|
-
def (DummyMutex = Object.new).synchronize
|
433
|
-
yield
|
434
|
-
end
|
435
|
-
|
436
|
-
def instance(*e)
|
437
|
-
arg = multiton_id(e)
|
438
|
-
(@multiton_instance ||= PoolInstance[self]).fetch(arg) {
|
439
|
-
(@multiton_mutex ||= PoolInstanceMutex[self])[arg].synchronize {
|
440
|
-
@multiton_instance.fetch(arg) {
|
441
|
-
val = @multiton_instance[arg] = new(*e)
|
442
|
-
val.instance_variable_set(:@multiton_initializer,e)
|
443
|
-
@multiton_mutex[arg]= DummyMutex
|
444
|
-
val
|
445
|
-
}}}
|
446
|
-
end
|
447
|
-
|
448
|
-
def initialized?(*e)
|
449
|
-
# the method is not thread safe ...
|
450
|
-
(@multiton_instance ||= PoolInstance[self]).key?(multiton_id(e))
|
451
|
-
end
|
452
|
-
|
453
|
-
protected
|
454
|
-
def reinitialize
|
455
|
-
(@multiton_instance ||= PoolInstance[self]).clear
|
456
|
-
(@multiton_mutex ||= PoolInstanceMutex[self]).clear
|
457
|
-
end
|
458
|
-
|
459
|
-
def _load(str)
|
460
|
-
instance(*Marshal.load(str))
|
461
|
-
end
|
462
|
-
|
463
|
-
private
|
464
|
-
def multiton_id(e)
|
465
|
-
e
|
466
|
-
end
|
467
|
-
|
468
|
-
# Defining marshal_dump & marshal_load instance methods introduces
|
469
|
-
# a loop hole to create additonal instances. Providing a private
|
470
|
-
# marshal_dump method forces Ruby to fall back on the _dump & _load
|
471
|
-
# marshalling scheme. When $VERBOSE == true issue a method re-
|
472
|
-
# definition warning for (re)defining marshal_dump.
|
473
|
-
def self.extended(klass)
|
474
|
-
klass.class_eval do
|
475
|
-
private
|
476
|
-
def marshal_dump(depth = -1)
|
477
|
-
raise TypeError, "don't use marshal_load + marshal_dump marshalling"
|
478
|
-
end
|
479
|
-
end
|
480
|
-
end
|
481
|
-
private_class_method :extended
|
482
|
-
|
483
|
-
end
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
### Simple marshalling test #######
|
493
|
-
class A
|
494
|
-
def initialize(a,*e)
|
495
|
-
@e = a
|
496
|
-
end
|
497
|
-
|
498
|
-
include Multiton
|
499
|
-
|
500
|
-
end
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
C = Class.new(A.clone)
|
506
|
-
s = C.instance('a','b')
|
507
|
-
|
508
|
-
raise unless Marshal.load(Marshal.dump(s)) == s
|
509
|
-
|
510
|
-
|
511
|
-
### Interdependent initialization example and threading benchmark ###
|
512
|
-
|
513
|
-
class Regular_SymPlane
|
514
|
-
def self.multiton_id(e)
|
515
|
-
a,b = e
|
516
|
-
(a+b - 1)*(a+b )/2 + (a > b ? a : b)
|
517
|
-
end
|
518
|
-
|
519
|
-
def initialize(a,b)
|
520
|
-
klass = self.class
|
521
|
-
if a < b
|
522
|
-
@l = b > 0 ? klass.instance(a,b-1) : nil
|
523
|
-
@r = a > 0 ? klass.instance(a-1,b) : nil
|
524
|
-
else
|
525
|
-
@l = a > 0 ? klass.instance(a-1,b) : nil
|
526
|
-
@r = b > 0 ? klass.instance(a,b-1) : nil
|
527
|
-
end
|
528
|
-
end
|
529
|
-
|
530
|
-
include Multiton
|
531
|
-
end
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
def nap
|
536
|
-
# Thread.pass
|
537
|
-
sleep(rand(0.01))
|
538
|
-
end
|
539
|
-
|
540
|
-
class SymPlane < Regular_SymPlane
|
541
|
-
@m = Mutex.new
|
542
|
-
@count = 0
|
543
|
-
end
|
544
|
-
|
545
|
-
class << SymPlane
|
546
|
-
attr_reader :count
|
547
|
-
def reinitialize
|
548
|
-
super
|
549
|
-
@m = Mutex.new
|
550
|
-
@count = 0
|
551
|
-
end
|
552
|
-
def inherited(sub_class)
|
553
|
-
super
|
554
|
-
sub_class.instance_eval { @m = Mutex.new; @count = 0 }
|
555
|
-
end
|
556
|
-
|
557
|
-
def multiton_id(e)
|
558
|
-
nap()
|
559
|
-
super
|
560
|
-
end
|
561
|
-
|
562
|
-
def new(*e)
|
563
|
-
super
|
564
|
-
ensure
|
565
|
-
nap()
|
566
|
-
@m.synchronize { p @count if (@count += 1) % 15 == 0 }
|
567
|
-
end
|
568
|
-
|
569
|
-
def run(k)
|
570
|
-
threads = 0
|
571
|
-
max = k * (k+1) / 2
|
572
|
-
puts ""
|
573
|
-
while count() < max
|
574
|
-
Thread.new { threads+= 1; instance(rand(k),rand(k)) }
|
575
|
-
end
|
576
|
-
puts "\nThe simulation created #{threads} threads"
|
577
|
-
end
|
578
|
-
end
|
579
|
-
|
580
|
-
|
581
|
-
require 'Benchmark'
|
582
|
-
include Benchmark
|
583
|
-
|
584
|
-
bmbm do |x|
|
585
|
-
x.report('Initialize 465 SymPlane instances') { SymPlane.run(30) }
|
586
|
-
x.report('Reinitialize ') do
|
587
|
-
sleep 3
|
588
|
-
SymPlane.reinitialize
|
589
|
-
end
|
590
|
-
end
|