facets 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.rdoc +331 -35
- data/MANIFEST +685 -826
- data/{doc/guide/notes.rd → NOTES} +0 -0
- data/README.rdoc +73 -25
- data/Rakefile +245 -2
- data/TODO +5 -0
- data/demo/hook.rd +47 -0
- data/demo/scenario_require.rd +9 -0
- data/doc/README.more +24 -6
- data/doc/manual/about.rb +47 -0
- data/doc/manual/annotations.rdoc +60 -0
- data/doc/manual/associations.rdoc +55 -0
- data/doc/manual/blockups.rdoc +101 -0
- data/doc/manual/capsule.rdoc +34 -0
- data/doc/manual/command.rdoc +177 -0
- data/doc/manual/core.rdoc +37 -0
- data/doc/manual/faq.rdoc +32 -0
- data/doc/manual/typecast.html +112 -0
- data/lib/core/facets.rb +359 -11
- data/lib/core/facets/array/combination.rb +3 -3
- data/lib/core/facets/array/index.rb +4 -1
- data/lib/core/facets/array/permutation.rb +2 -2
- data/lib/core/facets/array/product.rb +1 -1
- data/lib/core/facets/binding/eval.rb +1 -1
- data/lib/core/facets/denumerable.rb +76 -0
- data/lib/core/facets/duplicable.rb +34 -0
- data/lib/core/facets/enumerable/count.rb +10 -4
- data/lib/core/facets/enumerable/defer.rb +77 -0
- data/lib/core/facets/enumerable/each_by.rb +1 -1
- data/lib/core/facets/enumerable/every.rb +35 -0
- data/lib/{more/facets/elementwise.rb → core/facets/enumerable/ewise.rb} +0 -0
- data/lib/core/facets/enumerable/filter.rb +25 -0
- data/lib/core/facets/enumerable/group_by.rb +1 -1
- data/lib/core/facets/enumerable/none.rb +3 -2
- data/lib/core/facets/enumerable/one.rb +3 -2
- data/lib/core/facets/enumerable/per.rb +61 -0
- data/lib/core/facets/exception/raised.rb +14 -0
- data/lib/core/facets/integer/odd.rb +5 -1
- data/lib/core/facets/kernel/__dir__.rb +13 -3
- data/lib/core/facets/kernel/__here__.rb +14 -0
- data/lib/core/facets/kernel/__method__.rb +9 -3
- data/lib/core/facets/kernel/ask.rb +1 -0
- data/lib/core/facets/kernel/equate.rb +13 -0
- data/lib/core/facets/kernel/extension.rb +9 -0
- data/lib/core/facets/kernel/identical.rb +4 -0
- data/lib/core/facets/kernel/instance_exec.rb +2 -1
- data/lib/core/facets/kernel/method.rb +49 -0
- data/lib/core/facets/kernel/object_send.rb +2 -2
- data/lib/core/facets/kernel/{state.rb → object_state.rb} +23 -12
- data/lib/core/facets/kernel/require_all.rb +6 -1
- data/lib/core/facets/kernel/require_local.rb +8 -1
- data/lib/core/facets/kernel/require_relative.rb +52 -0
- data/lib/core/facets/kernel/source_location.rb +13 -0
- data/lib/core/facets/kernel/tap.rb +13 -6
- data/lib/core/facets/module/attr_setter.rb +57 -0
- data/lib/core/facets/module/instance_method.rb +24 -0
- data/lib/core/facets/module/module_load.rb +60 -44
- data/lib/core/facets/module/module_require.rb +1 -0
- data/lib/core/facets/nilclass/to_f.rb +1 -1
- data/lib/core/facets/objectspace/op_fetch.rb +3 -0
- data/lib/core/facets/proc/curry.rb +4 -3
- data/lib/core/facets/string/bytes.rb +10 -4
- data/lib/core/facets/string/camelcase.rb +6 -5
- data/lib/core/facets/string/chars.rb +5 -1
- data/lib/core/facets/string/each_char.rb +1 -1
- data/lib/core/facets/string/each_word.rb +1 -1
- data/lib/core/facets/string/lines.rb +11 -4
- data/lib/core/facets/string/start_with.rb +9 -2
- data/lib/core/facets/string/unfold.rb +27 -0
- data/lib/core/facets/symbol/succ.rb +3 -3
- data/lib/core/facets/symbol/thrown.rb +20 -0
- data/lib/core/facets/symbol/to_proc.rb +3 -2
- data/lib/core/facets/time/to_time.rb +1 -1
- data/lib/core/facets/to_hash.rb +41 -100
- data/lib/core/facets/unboundmethod/name.rb +20 -23
- data/lib/more/facets/ansicode.rb +1 -10
- data/lib/more/facets/autoarray.rb +3 -31
- data/lib/more/facets/basicobject.rb +73 -0
- data/lib/more/facets/blankslate.rb +2 -66
- data/lib/{lore → more}/facets/cgi.rb +0 -0
- data/lib/more/facets/class_extend.rb +1 -0
- data/lib/{lore → more}/facets/continuation.rb +0 -0
- data/lib/{lore → more}/facets/date.rb +3 -3
- data/lib/more/facets/enumargs.rb +192 -0
- data/lib/more/facets/enumerablepass.rb +2 -216
- data/lib/more/facets/enumerator.rb +62 -0
- data/lib/more/facets/{equatable.rb → equitable.rb} +11 -11
- data/lib/more/facets/expirable.rb +13 -41
- data/lib/{lore → more}/facets/fileutils.rb +0 -0
- data/lib/{lore → more}/facets/fileutils/head.rb +0 -0
- data/lib/{lore → more}/facets/fileutils/safe_ln.rb +0 -0
- data/lib/{lore → more}/facets/fileutils/slice.rb +0 -0
- data/lib/{lore → more}/facets/fileutils/tail.rb +0 -0
- data/lib/{lore → more}/facets/fileutils/wc.rb +0 -0
- data/lib/{lore → more}/facets/fileutils/whereis.rb +0 -0
- data/lib/{lore → more}/facets/fileutils/which.rb +0 -0
- data/lib/{lore → more}/facets/getoptlong.rb +0 -0
- data/lib/more/facets/hook.rb +2 -29
- data/lib/more/facets/inheritor.rb +2 -2
- data/lib/more/facets/instance_eval.rb +50 -0
- data/lib/more/facets/instance_function.rb +78 -0
- data/lib/more/facets/main.rb +20 -15
- data/lib/more/facets/memoize.rb +1 -113
- data/lib/more/facets/module/attr.rb +83 -0
- data/lib/more/facets/module/attr_tester.rb +44 -0
- data/lib/more/facets/module/attr_toggler.rb +59 -0
- data/lib/more/facets/module/attr_validator.rb +34 -0
- data/lib/more/facets/{class_extension.rb → module/class_extend.rb} +21 -13
- data/lib/more/facets/once.rb +59 -0
- data/lib/more/facets/openmodule.rb +1 -0
- data/lib/more/facets/orderedhash.rb +1 -33
- data/lib/{lore → more}/facets/ostruct.rb +0 -0
- data/lib/more/facets/ostructable.rb +1 -4
- data/lib/more/facets/partial.rb +18 -16
- data/lib/{lore → more}/facets/pathname.rb +0 -0
- data/lib/more/facets/preinitialize.rb +157 -0
- data/lib/{lore → more}/facets/rbconfig.rb +0 -0
- data/lib/more/facets/recorder.rb +1 -2
- data/lib/{lore → more}/facets/set.rb +0 -0
- data/lib/{lore → more}/facets/shellwords.rb +0 -0
- data/lib/{lore → more}/facets/uri.rb +0 -0
- data/lib/{lore → more}/facets/yaml.rb +0 -0
- data/lib/{lore → more}/facets/zlib.rb +0 -0
- data/meta/loadpath +0 -1
- data/meta/sitemap +4 -0
- data/meta/version +1 -1
- data/test/core/enumerable/test_count.rb +1 -1
- data/test/{more/test_filter.rb → core/enumerable/test_defer.rb} +24 -22
- data/test/{more/test_elementor.rb → core/enumerable/test_every.rb} +2 -15
- data/test/core/enumerable/test_ewise.rb +23 -0
- data/test/core/enumerable/test_per.rb +18 -0
- data/test/core/enumerable/test_take.rb +13 -0
- data/test/core/kernel/test_deepcopy.rb +1 -1
- data/test/{more/test_1stclassmethod.rb → core/kernel/test_method.rb} +2 -7
- data/test/core/kernel/test_tap.rb +1 -1
- data/test/core/proc/test_curry.rb +11 -0
- data/test/core/string/test_bytes.rb +1 -1
- data/test/core/string/test_camelcase.rb +23 -6
- data/test/core/string/test_lines.rb +1 -1
- data/test/core/string/test_unfold.rb +14 -0
- data/test/{more → core}/test_blank.rb +0 -0
- data/test/{more → core}/test_boolean.rb +0 -0
- data/test/{more → core}/test_functor.rb +0 -0
- data/test/{lore → more}/test_basicobject.rb +0 -0
- data/test/more/{test_class_extension.rb → test_class_extend.rb} +6 -6
- data/test/{lore → more}/test_continuation.rb +0 -0
- data/test/{lore → more}/test_date.rb +0 -0
- data/test/more/{test_enumerablepass.rb → test_enumargs.rb} +2 -4
- data/test/more/{test_equatable.rb → test_equitable.rb} +2 -2
- data/test/more/{test_instantise.rb → test_instance_function.rb} +3 -2
- data/test/more/test_memoize.rb +1 -1
- data/test/{lore → more}/test_ostruct.rb +0 -0
- metadata +865 -1016
- data/RELEASE +0 -38
- data/doc/README.lore +0 -51
- data/doc/log/basic_stats/index.html +0 -39
- data/doc/log/changelog.html +0 -648
- data/doc/log/changelog.txt +0 -217
- data/doc/log/stats/index.html +0 -39
- data/doc/log/testlog.txt +0 -278
- data/doc/notes/CHANGES +0 -2529
- data/doc/rdoc/lore/classes/Array.html +0 -176
- data/doc/rdoc/lore/classes/CGI.html +0 -191
- data/doc/rdoc/lore/classes/Config.html +0 -135
- data/doc/rdoc/lore/classes/Continuation.html +0 -113
- data/doc/rdoc/lore/classes/Date.html +0 -631
- data/doc/rdoc/lore/classes/DateTime.html +0 -583
- data/doc/rdoc/lore/classes/Enumerable.html +0 -89
- data/doc/rdoc/lore/classes/Enumerable/Enumerator.html +0 -147
- data/doc/rdoc/lore/classes/File.html +0 -128
- data/doc/rdoc/lore/classes/FileUtils.html +0 -434
- data/doc/rdoc/lore/classes/GetoptLong.html +0 -118
- data/doc/rdoc/lore/classes/GetoptLong/DSL.html +0 -208
- data/doc/rdoc/lore/classes/Kernel.html +0 -135
- data/doc/rdoc/lore/classes/Logger.html +0 -229
- data/doc/rdoc/lore/classes/Logger/Ansicolor.html +0 -277
- data/doc/rdoc/lore/classes/Logger/LogDevice.html +0 -121
- data/doc/rdoc/lore/classes/NilClass.html +0 -119
- data/doc/rdoc/lore/classes/OpenStruct.html +0 -432
- data/doc/rdoc/lore/classes/Pathname.html +0 -353
- data/doc/rdoc/lore/classes/Set.html +0 -117
- data/doc/rdoc/lore/classes/Shellwords.html +0 -111
- data/doc/rdoc/lore/classes/String.html +0 -140
- data/doc/rdoc/lore/classes/Time.html +0 -154
- data/doc/rdoc/lore/classes/URI.html +0 -454
- data/doc/rdoc/lore/classes/URI/Hash.html +0 -105
- data/doc/rdoc/lore/classes/URI/Kernel.html +0 -122
- data/doc/rdoc/lore/classes/Zlib.html +0 -188
- data/doc/rdoc/lore/created.rid +0 -1
- data/doc/rdoc/lore/files/README.html +0 -286
- data/doc/rdoc/lore/files/doc/README_lore.html +0 -155
- data/doc/rdoc/lore/files/lib/lore/facets/basicobject_rb.html +0 -118
- data/doc/rdoc/lore/files/lib/lore/facets/cgi_rb.html +0 -111
- data/doc/rdoc/lore/files/lib/lore/facets/continuation_rb.html +0 -147
- data/doc/rdoc/lore/files/lib/lore/facets/date_rb.html +0 -97
- data/doc/rdoc/lore/files/lib/lore/facets/enumerator_rb.html +0 -111
- data/doc/rdoc/lore/files/lib/lore/facets/fileutils/head_rb.html +0 -96
- data/doc/rdoc/lore/files/lib/lore/facets/fileutils/safe_ln_rb.html +0 -96
- data/doc/rdoc/lore/files/lib/lore/facets/fileutils/slice_rb.html +0 -96
- data/doc/rdoc/lore/files/lib/lore/facets/fileutils/tail_rb.html +0 -96
- data/doc/rdoc/lore/files/lib/lore/facets/fileutils/wc_rb.html +0 -96
- data/doc/rdoc/lore/files/lib/lore/facets/fileutils/whereis_rb.html +0 -96
- data/doc/rdoc/lore/files/lib/lore/facets/fileutils/which_rb.html +0 -96
- data/doc/rdoc/lore/files/lib/lore/facets/fileutils_rb.html +0 -131
- data/doc/rdoc/lore/files/lib/lore/facets/getoptlong_rb.html +0 -135
- data/doc/rdoc/lore/files/lib/lore/facets/logger_rb.html +0 -142
- data/doc/rdoc/lore/files/lib/lore/facets/ostruct_rb.html +0 -135
- data/doc/rdoc/lore/files/lib/lore/facets/pathname_rb.html +0 -145
- data/doc/rdoc/lore/files/lib/lore/facets/rbconfig_rb.html +0 -124
- data/doc/rdoc/lore/files/lib/lore/facets/set_rb.html +0 -96
- data/doc/rdoc/lore/files/lib/lore/facets/shellwords_rb.html +0 -124
- data/doc/rdoc/lore/files/lib/lore/facets/uri_rb.html +0 -125
- data/doc/rdoc/lore/files/lib/lore/facets/yaml_rb.html +0 -146
- data/doc/rdoc/lore/files/lib/lore/facets/zlib_rb.html +0 -97
- data/doc/rdoc/lore/fr_class_index.html +0 -73
- data/doc/rdoc/lore/fr_file_index.html +0 -71
- data/doc/rdoc/lore/fr_method_index.html +0 -177
- data/doc/rdoc/lore/index.html +0 -26
- data/doc/rdoc/lore/rdoc-style.css +0 -177
- data/doc/release-notes/RELEASE-2.0.5 +0 -8
- data/doc/release-notes/RELEASE-2.1.0 +0 -9
- data/doc/release-notes/RELEASE-2.1.1 +0 -5
- data/doc/release-notes/RELEASE-2.1.2 +0 -6
- data/doc/release-notes/RELEASE-2.1.3 +0 -5
- data/doc/release-notes/RELEASE-2.2.0 +0 -14
- data/doc/release-notes/RELEASE-2.2.1 +0 -4
- data/doc/release-notes/RELEASE-2.3.0 +0 -6
- data/doc/release-notes/RELEASE-2.4.0 +0 -70
- data/doc/release-notes/RELEASE-2.4.1 +0 -8
- data/doc/release-notes/RELEASE-2.4.2 +0 -4
- data/doc/release-notes/RELEASE-2.4.3 +0 -78
- data/doc/release-notes/RELEASE-2.4.4 +0 -38
- data/doc/release-notes/RELEASE-2.4.5 +0 -37
- data/doc/release-notes/RELEASE-2.5.0 +0 -83
- data/lib/core/facets/kernel/instance.rb +0 -19
- data/lib/lore/facets/basicobject.rb +0 -14
- data/lib/lore/facets/enumerator.rb +0 -67
- data/lib/lore/facets/logger.rb +0 -291
- data/lib/more/facets/1stclassmethod.rb +0 -140
- data/lib/more/facets/advisable.rb +0 -162
- data/lib/more/facets/association.rb +0 -210
- data/lib/more/facets/attr.rb +0 -209
- data/lib/more/facets/basex.rb +0 -37
- data/lib/more/facets/bbcode.rb +0 -397
- data/lib/more/facets/bicrypt.rb +0 -265
- data/lib/more/facets/binreadable.rb +0 -221
- data/lib/more/facets/censor.rb +0 -97
- data/lib/more/facets/classmethods.rb +0 -199
- data/lib/more/facets/consoleutils.rb +0 -99
- data/lib/more/facets/crypt.rb +0 -166
- data/lib/more/facets/dependency.rb +0 -151
- data/lib/more/facets/downloader.rb +0 -281
- data/lib/more/facets/duplicable.rb +0 -43
- data/lib/more/facets/elementor.rb +0 -133
- data/lib/more/facets/filter.rb +0 -121
- data/lib/more/facets/heap.rb +0 -22
- data/lib/more/facets/infinity.rb +0 -193
- data/lib/more/facets/ini.rb +0 -264
- data/lib/more/facets/instantise.rb +0 -1
- data/lib/more/facets/instantize.rb +0 -95
- data/lib/more/facets/interval.rb +0 -282
- data/lib/more/facets/iteration.rb +0 -65
- data/lib/more/facets/linkedlist.rb +0 -222
- data/lib/more/facets/lrucache.rb +0 -157
- data/lib/more/facets/matcher.rb +0 -140
- data/lib/more/facets/memoizer.rb +0 -74
- data/lib/more/facets/minitar.rb +0 -1063
- data/lib/more/facets/nackclass.rb +0 -41
- data/lib/more/facets/net/smtp_tls.rb +0 -131
- data/lib/more/facets/nilstatus.rb +0 -48
- data/lib/more/facets/overload.rb +0 -94
- data/lib/more/facets/paramix.rb +0 -202
- data/lib/more/facets/pool.rb +0 -91
- data/lib/more/facets/pqueue.rb +0 -449
- data/lib/more/facets/pry.rb +0 -32
- data/lib/more/facets/reflection.rb +0 -145
- data/lib/more/facets/semaphore.rb +0 -92
- data/lib/more/facets/settings.rb +0 -248
- data/lib/more/facets/snapshot.rb +0 -209
- data/lib/more/facets/sparse_array.rb +0 -809
- data/lib/more/facets/string/mask.rb +0 -278
- data/lib/more/facets/string/obfuscate.rb +0 -65
- data/lib/more/facets/string/stylize.rb +0 -169
- data/lib/more/facets/string/words.rb +0 -167
- data/lib/more/facets/syncarray.rb +0 -114
- data/lib/more/facets/synchash.rb +0 -157
- data/lib/more/facets/typecast.rb +0 -261
- data/lib/more/facets/uninheritable.rb +0 -50
- data/lib/more/facets/xmlhash.rb +0 -112
- data/lib/more/facets/xoxo.rb +0 -259
- data/lib/more/facets/ziputils.rb +0 -490
- data/task/conflicts +0 -63
- data/task/coverage.rake +0 -37
- data/task/methods +0 -49
- data/task/rdoc.rake +0 -17
- data/task/setup.rake +0 -38
- data/task/test.rake +0 -145
- data/test/more/test_advisable.rb +0 -71
- data/test/more/test_association.rb +0 -38
- data/test/more/test_bbcode.rb +0 -21
- data/test/more/test_binreadable.rb +0 -50
- data/test/more/test_buildable.rb +0 -73
- data/test/more/test_classmethods.rb +0 -56
- data/test/more/test_crypt.rb +0 -32
- data/test/more/test_dependency.rb +0 -69
- data/test/more/test_elementwise.rb +0 -25
- data/test/more/test_infinity.rb +0 -40
- data/test/more/test_interval.rb +0 -151
- data/test/more/test_linkedlist.rb +0 -41
- data/test/more/test_lrucache.rb +0 -14
- data/test/more/test_overload.rb +0 -160
- data/test/more/test_paramix.rb +0 -170
- data/test/more/test_prototype.rb +0 -35
- data/test/more/test_snapshot.rb +0 -21
- data/test/more/test_sparsearray.rb +0 -279
- data/test/more/test_syncarray.rb +0 -15
- data/test/more/test_synchash.rb +0 -16
- data/test/more/test_typecast.rb +0 -54
- data/test/more/test_uninheritable.rb +0 -31
- data/test/more/test_xoxo.rb +0 -274
- data/test/test_facets.rb +0 -9
data/task/conflicts
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'enumerator'
|
4
|
-
|
5
|
-
$: << 'lib'
|
6
|
-
#$: << 'lib'
|
7
|
-
|
8
|
-
libs = ARGV #(ENV['LIBS'] || "").split(/[;:]/)
|
9
|
-
|
10
|
-
# We add time b/c both that's built-in but not loaded by Ruby.
|
11
|
-
original = `script/methods time.rb yaml.rb`.split(/\s/)
|
12
|
-
facets = `script/methods lib/facets`.split(/\s/)
|
13
|
-
other = `script/methods #{libs.join(' ')}`.split(/\s/)
|
14
|
-
|
15
|
-
facets = facets - original
|
16
|
-
other = other - original
|
17
|
-
clash = facets & other
|
18
|
-
|
19
|
-
puts clash.sort.join("\n")
|
20
|
-
puts " #{clash.size} Clashes"
|
21
|
-
|
22
|
-
|
23
|
-
=begin
|
24
|
-
|
25
|
-
# Return a hash for each defined class containing a array class and method.
|
26
|
-
def methods_by_class
|
27
|
-
Module.
|
28
|
-
constants.
|
29
|
-
map{|klass| eval(klass)}.
|
30
|
-
select{|klass| klass.is_a? Class}.
|
31
|
-
inject({}){|h,klass|
|
32
|
-
h[klass] = [
|
33
|
-
klass.methods-klass.superclass.methods,
|
34
|
-
klass.instance_methods-(klass.superclass ? klass.superclass.instance_methods : [])
|
35
|
-
]
|
36
|
-
h
|
37
|
-
}
|
38
|
-
end
|
39
|
-
|
40
|
-
before = methods_by_class
|
41
|
-
|
42
|
-
ARGV.each{|a| require a }
|
43
|
-
|
44
|
-
after = methods_by_class
|
45
|
-
|
46
|
-
delta = after - before
|
47
|
-
|
48
|
-
puts delta.join("\n")
|
49
|
-
|
50
|
-
exit
|
51
|
-
|
52
|
-
# Print the difference between the before and after method lists:
|
53
|
-
before.keys.sort_by{|k| k.to_s}.each{|k|
|
54
|
-
class_diff = after[k][0]-before[k][0]
|
55
|
-
instance_diff = after[k][1]-before[k][1]
|
56
|
-
next if class_diff.empty? && instance_diff.empty?
|
57
|
-
puts((class_diff.sort.map{|c| "#{k}."+c} +
|
58
|
-
instance_diff.sort.map{|c| "#{k}#"+c}
|
59
|
-
)*"\n")
|
60
|
-
}
|
61
|
-
|
62
|
-
=end
|
63
|
-
|
data/task/coverage.rake
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
desc "show core unit test coverage"
|
4
|
-
|
5
|
-
task 'coverage' do
|
6
|
-
core_scripts = []
|
7
|
-
cd 'lib/core/facets' do
|
8
|
-
core_scripts = Dir['**/*'].reject{ |s| File.directory?(s) }
|
9
|
-
end
|
10
|
-
|
11
|
-
core_tests = []
|
12
|
-
cd 'test/core' do
|
13
|
-
core_tests = Dir['**/*']
|
14
|
-
end
|
15
|
-
|
16
|
-
core_tests = core_tests.collect do |t|
|
17
|
-
dir, fname = *File.split(t)
|
18
|
-
File.join(dir, fname.sub(/^test_/,''))
|
19
|
-
end
|
20
|
-
|
21
|
-
diff = core_scripts - core_tests
|
22
|
-
|
23
|
-
# remove core collectives
|
24
|
-
diff = diff - %w{
|
25
|
-
array.rb binding.rb cattr.rb class.rb comparable.rb dir.rb
|
26
|
-
enumerable.rb exception.rb hash.rb file.rb filetest.rb float.rb
|
27
|
-
integer.rb kernel.rb matchdata.rb module.rb nilclass.rb
|
28
|
-
numeric.rb proc.rb range.rb regexp.rb string.rb symbol.rb
|
29
|
-
time.rb unboundmethod.rb
|
30
|
-
}
|
31
|
-
|
32
|
-
puts diff.sort.join("\n")
|
33
|
-
puts
|
34
|
-
puts "#{diff.size} files uncovered."
|
35
|
-
|
36
|
-
end
|
37
|
-
|
data/task/methods
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'enumerator'
|
4
|
-
|
5
|
-
def method_list
|
6
|
-
list = []
|
7
|
-
|
8
|
-
ObjectSpace.each_object(Module) do |klass|
|
9
|
-
insta_methods = klass.public_instance_methods(true) +
|
10
|
-
klass.private_instance_methods(true) +
|
11
|
-
klass.protected_instance_methods(true)
|
12
|
-
|
13
|
-
class_methods = klass.public_methods(true) +
|
14
|
-
klass.private_methods(true) +
|
15
|
-
klass.protected_methods(true)
|
16
|
-
|
17
|
-
klass.ancestors[1..-1].each do |ancestor|
|
18
|
-
#next unless ancestor.is_a?(Module)
|
19
|
-
|
20
|
-
if ancestor.is_a?(Class)
|
21
|
-
insta_methods -= ancestor.public_instance_methods(true) +
|
22
|
-
ancestor.private_instance_methods(true) +
|
23
|
-
ancestor.protected_instance_methods(true)
|
24
|
-
|
25
|
-
class_methods -= ancestor.public_methods(true) +
|
26
|
-
ancestor.private_methods(true) +
|
27
|
-
ancestor.protected_methods(true)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
class_methods -= Kernel.public_methods(true) +
|
32
|
-
Kernel.private_methods(true) +
|
33
|
-
Kernel.protected_methods(true)
|
34
|
-
|
35
|
-
class_methods.map!{|c| "#{klass}." + c}
|
36
|
-
insta_methods.map!{|c| "#{klass}#" + c}
|
37
|
-
|
38
|
-
list.concat(class_methods)
|
39
|
-
list.concat(insta_methods)
|
40
|
-
end
|
41
|
-
|
42
|
-
return list
|
43
|
-
end
|
44
|
-
|
45
|
-
ARGV.each{ |lib| require lib }
|
46
|
-
|
47
|
-
puts method_list.sort.join("\n")
|
48
|
-
|
49
|
-
|
data/task/rdoc.rake
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'fileutils'
|
4
|
-
|
5
|
-
desc "generate rdocs"
|
6
|
-
|
7
|
-
task "rdoc" do
|
8
|
-
TEMPLATE = ENV['RDOC_TEMPLATE'] || 'html'
|
9
|
-
APIOUT = "doc/rdoc"
|
10
|
-
|
11
|
-
FileUtils.rm_r(APIOUT)
|
12
|
-
|
13
|
-
system "rdoc -a -S -t'Facets Core API' -T #{TEMPLATE} -m README --op '#{APIOUT}/core' README lib/facets/core"
|
14
|
-
system "rdoc -a -S -t'Facets Lore API' -T #{TEMPLATE} -m README --op '#{APIOUT}/lore' README lib/facets/lore"
|
15
|
-
system "rdoc -a -S -t'Facets More API' -T #{TEMPLATE} -m README --op '#{APIOUT}/more' README lib/facets/more"
|
16
|
-
end
|
17
|
-
|
data/task/setup.rake
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
|
2
|
-
def load_setup
|
3
|
-
begin
|
4
|
-
require 'setup'
|
5
|
-
$setup_installed = true
|
6
|
-
rescue LoadError
|
7
|
-
$setup_installed = false
|
8
|
-
puts "NOTP"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
private :load_setup
|
13
|
-
|
14
|
-
desc "install to ruby site location"
|
15
|
-
task :install do
|
16
|
-
load_setup
|
17
|
-
|
18
|
-
if $setup_installed
|
19
|
-
sh "setup.rb all"
|
20
|
-
else
|
21
|
-
puts "Requires stand-alone Setup.rb."
|
22
|
-
puts "See http://setup.rubyforge.org"
|
23
|
-
puts "or 'gem install setup'."
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
desc "uninstall from ruby site location"
|
28
|
-
task :uninstall do
|
29
|
-
load_setup
|
30
|
-
|
31
|
-
if $setup_installed
|
32
|
-
sh "setup.rb uninstall"
|
33
|
-
else
|
34
|
-
puts "Requires stand-alone Setup.rb."
|
35
|
-
puts "See http://setup.rubyforge.org"
|
36
|
-
puts "or 'gem install setup'."
|
37
|
-
end
|
38
|
-
end
|
data/task/test.rake
DELETED
@@ -1,145 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
task 'test' do
|
4
|
-
prepare_tests_all
|
5
|
-
end
|
6
|
-
|
7
|
-
desc "run all unit tests"
|
8
|
-
task 'test:all' do
|
9
|
-
prepare_tests_all
|
10
|
-
end
|
11
|
-
|
12
|
-
desc "run core unit tests"
|
13
|
-
task 'test:core' do
|
14
|
-
prepare_tests_core
|
15
|
-
end
|
16
|
-
|
17
|
-
desc "run lore unit tests"
|
18
|
-
task 'test:lore' do
|
19
|
-
prepare_tests_lore
|
20
|
-
end
|
21
|
-
|
22
|
-
desc "run more unit tests"
|
23
|
-
task 'test:more' do
|
24
|
-
prepare_tests_more
|
25
|
-
end
|
26
|
-
|
27
|
-
desc "run all unit tests with ActiveSupport loaded"
|
28
|
-
task 'test:all:activesupport' => [:include_activesupport, 'test:all']
|
29
|
-
|
30
|
-
desc "run core unit tests with ActiveSupport loaded"
|
31
|
-
task 'test:core:activesupport' => [:include_activesupport, 'test:core']
|
32
|
-
|
33
|
-
desc "run lore unit tests with ActiveSupport loaded"
|
34
|
-
task 'test:lore:activesupport' => [:include_activesupport, 'test:lore']
|
35
|
-
|
36
|
-
desc "run more unit tests with ActiveSupport loaded"
|
37
|
-
task 'test:more:activesupport' => [:include_activesupport, 'test:more']
|
38
|
-
|
39
|
-
task 'include_activesupport' do
|
40
|
-
require 'activesupport'
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
def add_loadpath(*paths)
|
45
|
-
live = ENV['live']
|
46
|
-
|
47
|
-
unless live
|
48
|
-
# $LOAD_PATH.unshift(File.expand_path('lib/core'))
|
49
|
-
# $LOAD_PATH.unshift(File.expand_path('lib/lore'))
|
50
|
-
# $LOAD_PATH.unshift(File.expand_path('lib/more'))
|
51
|
-
paths.each do |path|
|
52
|
-
$LOAD_PATH.unshift(File.expand_path(path))
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
puts "RUBY VERSION: #{RUBY_VERSION}"
|
57
|
-
puts "LOAD PATH:\n" + $LOAD_PATH.join("\n")
|
58
|
-
end
|
59
|
-
|
60
|
-
def get_tests(which="{c,l,m}ore")
|
61
|
-
if find = ARGV[1..-1].select{|e| e !~ /(^[-]|[=])/ }[0]
|
62
|
-
unless FileTest.file?(find)
|
63
|
-
#find = File.join(find, '**', 'test_*.rb')
|
64
|
-
find = ['test/test_*.rb']
|
65
|
-
find << File.join(find, which, '**', 'test_*.rb')
|
66
|
-
end
|
67
|
-
else
|
68
|
-
#find = 'test/**/test_*.rb'
|
69
|
-
find = ['test/test_*.rb']
|
70
|
-
find << "test/#{which}/**/test_*.rb"
|
71
|
-
end
|
72
|
-
|
73
|
-
Dir.glob(find)
|
74
|
-
end
|
75
|
-
|
76
|
-
def run_tests(files)
|
77
|
-
files.each do |file|
|
78
|
-
next if File.directory?(file)
|
79
|
-
begin
|
80
|
-
puts "Loading: #{file}" if $DEBUG
|
81
|
-
load(file)
|
82
|
-
rescue LoadError
|
83
|
-
puts "Error loading: #{file}"
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
def prepare_tests_all
|
89
|
-
add_loadpath('lib/core','lib/lore','lib/more')
|
90
|
-
files = get_tests
|
91
|
-
run_tests(files)
|
92
|
-
end
|
93
|
-
|
94
|
-
def prepare_tests_core
|
95
|
-
add_loadpath('lib/core')
|
96
|
-
files = get_tests('core')
|
97
|
-
run_tests(files)
|
98
|
-
end
|
99
|
-
|
100
|
-
def prepare_tests_lore
|
101
|
-
add_loadpath('lib/lore')
|
102
|
-
files = get_tests('lore')
|
103
|
-
run_tests(files)
|
104
|
-
end
|
105
|
-
|
106
|
-
def prepare_tests_more
|
107
|
-
add_loadpath('lib/more')
|
108
|
-
files = get_tests('more')
|
109
|
-
run_tests(files)
|
110
|
-
end
|
111
|
-
|
112
|
-
|
113
|
-
#def run_tests
|
114
|
-
# live = ENV['live']
|
115
|
-
#
|
116
|
-
# unless live
|
117
|
-
# $LOAD_PATH.unshift(File.expand_path('lib/core'))
|
118
|
-
# $LOAD_PATH.unshift(File.expand_path('lib/lore'))
|
119
|
-
# $LOAD_PATH.unshift(File.expand_path('lib/more'))
|
120
|
-
# end
|
121
|
-
#
|
122
|
-
# puts "RUBY VERSION: #{RUBY_VERSION}"
|
123
|
-
# puts "LOAD PATH:\n" + $LOAD_PATH.join("\n")
|
124
|
-
#
|
125
|
-
# if find = ARGV[1..-1].select{|e| e !~ /(^[-]|[=])/ }[0]
|
126
|
-
# unless FileTest.file?(find)
|
127
|
-
# find = File.join(find, '**', 'test_*.rb')
|
128
|
-
# end
|
129
|
-
# else
|
130
|
-
# find = 'test/**/test_*.rb'
|
131
|
-
# end
|
132
|
-
#
|
133
|
-
# files = Dir.glob(find)
|
134
|
-
#
|
135
|
-
# files.each do |file|
|
136
|
-
# next if File.directory?(file)
|
137
|
-
# begin
|
138
|
-
# puts "Loading: #{file}" if $DEBUG
|
139
|
-
# load(file)
|
140
|
-
# rescue LoadError
|
141
|
-
# puts "Error loading: #{file}"
|
142
|
-
# end
|
143
|
-
# end
|
144
|
-
#end
|
145
|
-
|
data/test/more/test_advisable.rb
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
# Test for facets/advice.rb
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'facets/advisable'
|
5
|
-
|
6
|
-
class TestAdvice < Test::Unit::TestCase
|
7
|
-
|
8
|
-
class X
|
9
|
-
extend Advisable
|
10
|
-
|
11
|
-
attr_reader :out
|
12
|
-
|
13
|
-
def initialize
|
14
|
-
@out = []
|
15
|
-
end
|
16
|
-
|
17
|
-
before :x do
|
18
|
-
@out << "BEFORE X#x"
|
19
|
-
end
|
20
|
-
|
21
|
-
after :x do
|
22
|
-
@out << "AFTER X#x"
|
23
|
-
end
|
24
|
-
|
25
|
-
def x
|
26
|
-
@out << "X#x"
|
27
|
-
"x"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
class Y < X
|
32
|
-
before :x do
|
33
|
-
@out << "BEFORE Y#x"
|
34
|
-
end
|
35
|
-
|
36
|
-
after :x do
|
37
|
-
@out << "AFTER Y#x"
|
38
|
-
end
|
39
|
-
|
40
|
-
around :x do |target|
|
41
|
-
"{" + target.call + "}"
|
42
|
-
end
|
43
|
-
|
44
|
-
def x
|
45
|
-
@out << "Y#x"
|
46
|
-
super
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
# tests
|
51
|
-
|
52
|
-
def setup
|
53
|
-
@x = X.new
|
54
|
-
@y = Y.new
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_x
|
58
|
-
r = @x.x
|
59
|
-
o = @x.out
|
60
|
-
assert_equal("x", r)
|
61
|
-
assert_equal(["BEFORE X#x", "X#x", "AFTER X#x"], o)
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_y
|
65
|
-
r = @y.x
|
66
|
-
o = @y.out
|
67
|
-
assert_equal("{x}", r)
|
68
|
-
assert_equal(["BEFORE Y#x", "BEFORE X#x", "Y#x", "X#x", "AFTER X#x", "AFTER Y#x"], o)
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# Test facets/association.rb
|
2
|
-
|
3
|
-
require 'facets/association.rb'
|
4
|
-
|
5
|
-
require 'test/unit'
|
6
|
-
|
7
|
-
class TC_Associations < Test::Unit::TestCase
|
8
|
-
|
9
|
-
def setup
|
10
|
-
@complex_hierarchy = [
|
11
|
-
'parent' >> 'child',
|
12
|
-
'childless',
|
13
|
-
'another_parent' >> [
|
14
|
-
'subchildless',
|
15
|
-
'subparent' >> 'subchild'
|
16
|
-
]
|
17
|
-
]
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_ohash
|
21
|
-
k,v = [],[]
|
22
|
-
ohash = [ 'A' >> '3', 'B' >> '2', 'C' >> '1' ]
|
23
|
-
ohash.each { |e1,e2| k << e1 ; v << e2 }
|
24
|
-
assert_equal( ['A','B','C'], k )
|
25
|
-
assert_equal( ['3','2','1'], v )
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_complex
|
29
|
-
complex = [ 'Drop Menu' >> [ 'Button 1', 'Button 2', 'Button 3' ], 'Help' ]
|
30
|
-
assert_equal( 'Drop Menu', complex[0].index )
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_associations
|
34
|
-
complex = [ :a >> :b, :a >> :c ]
|
35
|
-
assert_equal( [ :b, :c ], :a.associations )
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|