facets 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +6 -0
- data/NOTES +14 -1
- data/Rakefile +26 -0
- data/demo/bench/general/bench_calls.rb +74 -0
- data/demo/bench/general/bench_includes.rb +25 -0
- data/demo/bench/general/bench_methods.rb +17 -0
- data/demo/bench/general/bench_pathname.rb +24 -0
- data/demo/bench/general/bench_range.rb +64 -0
- data/demo/bench/general/bench_return.rb +56 -0
- data/demo/bench/general/bench_yeild.rb +75 -0
- data/lib/{more → class}/facets/association.rb +0 -0
- data/lib/{more → class}/facets/autoarray.rb +0 -0
- data/lib/{more → class}/facets/basicobject.rb +0 -0
- data/lib/{more → class}/facets/buildingblock.rb +0 -44
- data/lib/{more → class}/facets/cachedelegator.rb +3 -0
- data/lib/{more → class}/facets/coroutine.rb +0 -56
- data/lib/{more → class}/facets/dictionary.rb +0 -0
- data/lib/{more → class}/facets/downloader.rb +0 -0
- data/lib/{more → class}/facets/filelist.rb +0 -0
- data/lib/{more → class}/facets/fileshell.rb +0 -0
- data/lib/{more → class}/facets/hashbuilder.rb +0 -0
- data/lib/{more → class}/facets/heap.rb +0 -0
- data/lib/{more → class}/facets/infinity.rb +0 -46
- data/lib/{more → class}/facets/interval.rb +0 -0
- data/lib/{more → class}/facets/ioredirect.rb +0 -0
- data/lib/{more → class}/facets/linkedlist.rb +0 -42
- data/lib/{more → class}/facets/lrucache.rb +0 -23
- data/lib/{more → class}/facets/minitar.rb +0 -0
- data/lib/{more → class}/facets/nackclass.rb +0 -0
- data/lib/{more → class}/facets/nullclass.rb +0 -0
- data/lib/{more → class}/facets/opencascade.rb +0 -70
- data/lib/{more → class}/facets/opencollection.rb +0 -0
- data/lib/class/facets/openhash.rb +41 -0
- data/lib/{more → class}/facets/openobject.rb +0 -121
- data/lib/{more → class}/facets/orderedhash.rb +0 -0
- data/lib/{more → class}/facets/pathlist.rb +0 -0
- data/lib/{more → class}/facets/pool.rb +0 -0
- data/lib/{more → class}/facets/pqueue.rb +0 -0
- data/lib/{more → class}/facets/progressbar.rb +0 -0
- data/lib/{more → class}/facets/recorder.rb +0 -40
- data/lib/{more → class}/facets/reference.rb +0 -0
- data/lib/{more → class}/facets/rwdelegator.rb +0 -0
- data/lib/{more → class}/facets/semaphore.rb +0 -0
- data/lib/{more → class}/facets/syncarray.rb +0 -24
- data/lib/{more → class}/facets/synchash.rb +1 -25
- data/lib/{more → class}/facets/timer.rb +0 -62
- data/lib/{more → class}/facets/tuple.rb +0 -60
- data/lib/{more → class}/facets/version.rb +0 -0
- data/lib/core/facets/dir/multiglob.rb +20 -5
- data/lib/core/facets/enumerable/cartesian.rb +2 -2
- data/lib/core/facets/enumerable/combination.rb +9 -1
- data/lib/core/facets/kernel/object.rb +1 -1
- data/lib/{more → mixin}/facets/binreadable.rb +0 -62
- data/lib/{more → mixin}/facets/buildable.rb +0 -48
- data/lib/mixin/facets/cloneable.rb +90 -0
- data/lib/{more → mixin}/facets/enumerablepass.rb +0 -81
- data/lib/{more → mixin}/facets/expirable.rb +0 -0
- data/lib/{more → mixin}/facets/fileable.rb +0 -0
- data/lib/{more → mixin}/facets/instantiable.rb +0 -30
- data/lib/{more → mixin}/facets/multiton.rb +0 -0
- data/lib/{more → mixin}/facets/registerable.rb +0 -0
- data/lib/mixin/facets/tasksystem.rb +350 -0
- data/lib/{more → mixin}/facets/uninheritable.rb +1 -39
- data/lib/{more → mixin}/facets/validation.rb +0 -0
- data/lib/more/facets/arguments.rb +0 -66
- data/lib/more/facets/attributes.rb +0 -35
- data/lib/more/facets/bbcode.rb +1 -31
- data/lib/more/facets/bytes.rb +0 -80
- data/lib/more/facets/class_extension.rb +0 -66
- data/lib/more/facets/classmethods.rb +0 -64
- data/lib/more/facets/compare_on.rb +0 -52
- data/lib/more/facets/curry.rb +0 -29
- data/lib/more/facets/cut.rb +0 -27
- data/lib/more/facets/date.rb +0 -54
- data/lib/more/facets/dependency.rb +0 -70
- data/lib/more/facets/elementor.rb +0 -67
- data/lib/more/facets/getoptlong.rb +0 -30
- data/lib/more/facets/{hash_keyize.rb → hash/keyize.rb} +0 -0
- data/lib/more/facets/inheritor.rb +0 -150
- data/lib/more/facets/instantise.rb +0 -41
- data/lib/more/facets/let.rb +0 -20
- data/lib/more/facets/memoize.rb +0 -45
- data/lib/more/facets/multipliers.rb +0 -110
- data/lib/more/facets/ostruct.rb +0 -124
- data/lib/more/facets/random.rb +0 -153
- data/lib/more/facets/rbconfig.rb +55 -0
- data/lib/more/facets/set.rb +27 -0
- data/lib/more/facets/snapshot.rb +0 -30
- data/lib/more/facets/stylize.rb +0 -147
- data/lib/more/facets/times.rb +0 -98
- data/lib/more/facets/tracepoint.rb +194 -0
- data/lib/more/facets/typecast.rb +0 -63
- data/lib/more/facets/ziputils.rb +7 -0
- data/log/Changelog-0.txt +239 -0
- data/log/Changelog-1.txt +450 -0
- data/log/Changelog.txt +841 -0
- data/log/Fixme.txt +18 -0
- data/log/Testlog.txt +188 -0
- data/log/Todo.txt +326 -0
- data/meta/MANIFEST +1 -1
- data/meta/VERSION +1 -0
- data/meta/authors +48 -0
- data/meta/description +8 -0
- data/meta/project.yaml +11 -5
- data/task/install +4 -2
- data/task/rdoc +5 -0
- data/task/test +40 -0
- data/test/{unit → class}/test_association.rb +0 -0
- data/test/{unit → class}/test_autoarray.rb +0 -0
- data/test/{unit → class}/test_basicobject.rb +0 -0
- data/test/{unit → class}/test_buildingblock.rb +1 -0
- data/test/{unit → class}/test_coroutine.rb +0 -0
- data/test/{unit → class}/test_dictionary.rb +0 -0
- data/test/{unit → class}/test_infinity.rb +0 -0
- data/test/{unit → class}/test_interval.rb +0 -0
- data/test/{unit → class}/test_linkedlist.rb +1 -1
- data/test/{unit → class}/test_lrucache.rb +3 -0
- data/test/{unit → class}/test_opencascade.rb +0 -0
- data/test/{unit → class}/test_openobject.rb +0 -0
- data/test/{unit → class}/test_recorder.rb +0 -1
- data/test/{unit → class}/test_syncarray.rb +2 -4
- data/test/{unit → class}/test_synchash.rb +2 -4
- data/test/{unit → class}/test_timer.rb +0 -1
- data/test/{unit → class}/test_tuple.rb +0 -0
- data/test/{unit → core}/array/test_delete.rb +0 -0
- data/test/{unit → core}/array/test_indexable.rb +0 -0
- data/test/{unit → core}/array/test_merge.rb +0 -0
- data/test/{unit → core}/array/test_only.rb +0 -0
- data/test/{unit → core}/array/test_pad.rb +0 -0
- data/test/{unit → core}/array/test_rotate.rb +0 -0
- data/test/{unit → core}/array/test_select.rb +0 -0
- data/test/{unit → core}/array/test_stackable.rb +0 -0
- data/test/{unit/binding/test_cflow.rb → core/binding/test_caller.rb} +2 -2
- data/test/{unit → core}/binding/test_defined.rb +0 -0
- data/test/{unit → core}/binding/test_eval.rb +0 -0
- data/test/{unit → core}/binding/test_here.rb +0 -0
- data/test/{unit → core}/binding/test_self.rb +0 -0
- data/test/{unit → core}/binding/test_vars.rb +0 -0
- data/test/{unit → core}/class/test_descendents.rb +0 -0
- data/test/{unit → core}/class/test_initializer.rb +0 -0
- data/test/{unit → core}/class/test_remove_descendents.rb +0 -0
- data/test/{unit → core}/comparable/test_bound.rb +0 -0
- data/test/{unit → core}/comparable/test_cmp.rb +0 -0
- data/test/{unit → core}/dir/test_parent.rb +0 -0
- data/test/{unit → core}/dir/test_recurse.rb +0 -0
- data/test/{unit → core}/dir/test_traverse.rb +0 -0
- data/test/{unit → core}/enumerable/test_cartesian.rb +0 -0
- data/test/{unit → core}/enumerable/test_collect.rb +0 -0
- data/test/{unit → core}/enumerable/test_combination.rb +0 -0
- data/test/{unit → core}/enumerable/test_count.rb +0 -0
- data/test/{unit → core}/enumerable/test_each.rb +0 -0
- data/test/{unit → core}/enumerable/test_mash.rb +0 -0
- data/test/{unit → core}/enumerable/test_permutation.rb +0 -0
- data/test/{unit → core}/enumerable/test_probability.rb +0 -0
- data/test/{unit → core}/enumerable/test_split.rb +0 -0
- data/test/{unit → core}/exception/test_detail.rb +0 -0
- data/test/{unit → core}/file/test_null.rb +0 -0
- data/test/{unit → core}/file/test_read.rb +0 -0
- data/test/{unit → core}/file/test_sanitize.rb +0 -0
- data/test/{unit → core}/file/test_split_all.rb +0 -0
- data/test/{unit → core}/file/test_write.rb +0 -0
- data/test/{unit → core}/filetest/test_root.rb +0 -0
- data/test/{unit → core}/hash/test_alias.rb +0 -0
- data/test/{unit → core}/hash/test_at.rb +0 -0
- data/test/{unit → core}/hash/test_autonew.rb +0 -0
- data/test/core/hash/test_collate.rb +33 -0
- data/test/{unit → core}/hash/test_delete.rb +0 -0
- data/test/{unit → core}/hash/test_each_with_key.rb +0 -0
- data/test/{unit → core}/hash/test_has_keys.rb +0 -0
- data/test/{unit → core}/hash/test_insert.rb +0 -0
- data/test/{unit → core}/hash/test_inverse.rb +0 -0
- data/test/{unit → core}/hash/test_op.rb +0 -0
- data/test/{unit → core}/hash/test_rekey.rb +0 -0
- data/test/{unit → core}/hash/test_reverse_merge.rb +0 -0
- data/test/{unit → core}/hash/test_select.rb +0 -0
- data/test/{unit → core}/hash/test_swap.rb +0 -0
- data/test/{unit → core}/hash/test_traverse.rb +0 -0
- data/test/{unit → core}/hash/test_update.rb +0 -0
- data/test/{unit → core}/hash/test_weave.rb +0 -0
- data/test/{unit → core}/hash/test_zipnew.rb +0 -0
- data/test/{unit → core}/integer/test_bitmask.rb +0 -0
- data/test/{unit → core}/integer/test_factorial.rb +0 -0
- data/test/{unit → core}/integer/test_multiple.rb +0 -0
- data/test/{unit → core}/integer/test_of.rb +0 -0
- data/test/{unit → core}/kernel/test_callstack.rb +0 -0
- data/test/{unit → core}/kernel/test_constant.rb +0 -0
- data/test/{unit → core}/kernel/test_deepcopy.rb +0 -0
- data/test/{unit → core}/kernel/test_instance.rb +0 -0
- data/test/{unit → core}/kernel/test_metaid.rb +0 -0
- data/test/{unit → core}/kernel/test_object.rb +1 -1
- data/test/{unit → core}/kernel/test_populate.rb +0 -0
- data/test/{unit → core}/kernel/test_report.rb +0 -0
- data/test/{unit → core}/kernel/test_returning.rb +0 -0
- data/test/{unit → core}/kernel/test_silence.rb +0 -0
- data/test/{unit → core}/kernel/test_super.rb +0 -0
- data/test/{unit → core}/kernel/test_tap.rb +0 -0
- data/test/{unit → core}/kernel/test_val.rb +0 -0
- data/test/{unit → core}/kernel/test_withattr.rb +0 -0
- data/test/{unit → core}/matchdata/test_match.rb +0 -0
- data/test/{unit → core}/matchdata/test_matchset.rb +0 -0
- data/test/{unit → core}/module/test_abstract.rb +0 -0
- data/test/{unit → core}/module/test_alias.rb +0 -0
- data/test/{unit → core}/module/test_cattr.rb +0 -0
- data/test/{unit → core}/module/test_clone.rb +0 -0
- data/test/{unit → core}/module/test_include.rb +0 -0
- data/test/{unit → core}/module/test_modify.rb +0 -0
- data/test/{unit → core}/module/test_name.rb +0 -0
- data/test/{unit → core}/module/test_traits.rb +0 -0
- data/test/{unit → core}/numeric/test_round.rb +0 -0
- data/test/{unit → core}/proc/test_bind.rb +0 -0
- data/test/{unit → core}/proc/test_compose.rb +0 -0
- data/test/{unit → core}/range/test_combine.rb +0 -0
- data/test/{unit → core}/range/test_overlap.rb +0 -0
- data/test/{unit → core}/regexp/test_arity.rb +0 -0
- data/test/{unit → core}/string/test_align.rb +0 -0
- data/test/{unit → core}/string/test_blank.rb +0 -0
- data/test/{unit → core}/string/test_bracket.rb +0 -0
- data/test/{unit → core}/string/test_case.rb +0 -0
- data/test/{unit → core}/string/test_crypt.rb +0 -0
- data/test/{unit → core}/string/test_filter.rb +0 -0
- data/test/{unit → core}/string/test_indexable.rb +0 -0
- data/test/{unit → core}/string/test_interpolate.rb +0 -0
- data/test/{unit → core}/string/test_natcmp.rb +0 -0
- data/test/{unit → core}/string/test_nchar.rb +0 -0
- data/test/{unit → core}/string/test_op.rb +0 -0
- data/test/{unit → core}/string/test_partitions.rb +0 -0
- data/test/{unit → core}/string/test_range.rb +0 -0
- data/test/{unit → core}/string/test_regesc.rb +0 -0
- data/test/{unit → core}/string/test_scan.rb +0 -0
- data/test/{unit → core}/string/test_stackable.rb +0 -0
- data/test/{unit → core}/string/test_tabs.rb +0 -0
- data/test/{unit → core}/string/test_wrap.rb +0 -0
- data/test/{unit → core}/symbol/test_chomp.rb +0 -0
- data/test/{unit → core}/symbol/test_generate.rb +0 -0
- data/test/{unit → core}/symbol/test_not.rb +0 -0
- data/test/{unit → core}/symbol/test_shadow.rb +0 -0
- data/test/{unit → core}/symbol/test_succ.rb +0 -0
- data/test/{unit → core}/symbol/test_to_proc.rb +0 -0
- data/test/{unit → core}/test_1stclassmethod.rb +0 -0
- data/test/{unit → core}/test_boolean.rb +0 -0
- data/test/{unit → core}/test_conversion.rb +0 -0
- data/test/{unit → core}/test_functor.rb +0 -0
- data/test/{unit → core}/time/test_change.rb +0 -0
- data/test/{unit → core}/time/test_elapse.rb +0 -0
- data/test/{unit → core}/time/test_stamp.rb +0 -0
- data/test/{unit → mixin}/test_binreadable.rb +0 -0
- data/test/{unit → mixin}/test_buildable.rb +1 -0
- data/test/mixin/test_cloneable.rb +41 -0
- data/test/{unit → mixin}/test_enumerablepass.rb +0 -0
- data/test/{unit → mixin}/test_instantiable.rb +2 -1
- data/test/{unit → mixin}/test_multiton.rb +0 -0
- data/test/{unit → mixin}/test_uninheritable.rb +1 -2
- data/test/{unit → more/hash}/test_keyize.rb +1 -1
- data/test/{unit → more}/test_advice.rb +0 -0
- data/test/{unit → more}/test_annotations.rb +0 -0
- data/test/{unit → more}/test_ansicode.rb +0 -0
- data/test/{unit → more}/test_aop.rb +0 -0
- data/test/{unit → more}/test_arguments.rb +1 -0
- data/test/{unit → more}/test_attributes.rb +2 -2
- data/test/{unit → more}/test_bbcode.rb +1 -0
- data/test/{unit → more}/test_bytes.rb +1 -0
- data/test/{unit → more}/test_class_extension.rb +2 -1
- data/test/{unit → more}/test_classmethods.rb +2 -1
- data/test/{unit → more}/test_compare_on.rb +0 -1
- data/test/{unit → more}/test_continuation.rb +0 -0
- data/test/{unit → more}/test_crypt.rb +0 -0
- data/test/{unit → more}/test_curry.rb +1 -0
- data/test/{unit → more}/test_cut.rb +2 -1
- data/test/{unit → more}/test_date.rb +1 -1
- data/test/{unit → more}/test_dependency.rb +2 -2
- data/test/{unit → more}/test_elementor.rb +1 -1
- data/test/{unit → more}/test_getoptlong.rb +1 -0
- data/test/{unit → more}/test_inheritor.rb +1 -1
- data/test/{unit → more}/test_instantise.rb +2 -1
- data/test/{unit → more}/test_interface.rb +0 -0
- data/test/{unit → more}/test_let.rb +0 -1
- data/test/{unit → more}/test_memoize.rb +2 -3
- data/test/{unit → more}/test_multipliers.rb +1 -1
- data/test/{unit → more}/test_namespace.rb +0 -0
- data/test/{unit → more}/test_ostruct.rb +0 -0
- data/test/{unit → more}/test_overload.rb +0 -0
- data/test/{unit → more}/test_paramix.rb +0 -0
- data/test/{unit → more}/test_prototype.rb +0 -0
- data/test/more/test_random.rb +146 -0
- data/test/{unit → more}/test_snapshot.rb +0 -3
- data/test/{unit → more}/test_stylize.rb +1 -2
- data/test/{unit → more}/test_thread.rb +0 -0
- data/test/{unit → more}/test_times.rb +2 -2
- data/test/{unit → more}/test_typecast.rb +0 -3
- metadata +1117 -1098
- data/lib/more/facets/cloneable.rb +0 -75
- data/log/changelog.txt +0 -0
- data/meta/facets.roll +0 -4
- data/meta/google_ad.html +0 -15
- data/meta/icli.yaml +0 -17
- data/task/changes +0 -29
- data/task/clean +0 -17
- data/task/clobber/package +0 -10
- data/task/log +0 -17
- data/task/prepare +0 -7
- data/task/publish +0 -43
- data/task/release +0 -10
- data/task/stamp +0 -33
- data/task/stats +0 -138
- data/task/test/cross +0 -309
- data/task/test/each +0 -42
- data/task/test/load +0 -30
- data/task/test/pairs +0 -50
- data/task/test/solo +0 -294
- data/task/test/syntax +0 -31
- data/task/test/whole +0 -34
- data/test/unit/hash/test_collate.rb +0 -31
- data/test/unit/test_random.rb +0 -149
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# TITLE:
|
|
2
|
-
#
|
|
3
|
-
# Clonable
|
|
4
|
-
#
|
|
5
|
-
# SUMMARY:
|
|
6
|
-
#
|
|
7
|
-
# Standard basis for adding #dup and #clone methods to a class.
|
|
8
|
-
#
|
|
9
|
-
# COPYRIGHT:
|
|
10
|
-
#
|
|
11
|
-
# Copyright (c) 2002 Jim Weirich
|
|
12
|
-
#
|
|
13
|
-
# LICENSE:
|
|
14
|
-
#
|
|
15
|
-
# GNU General Public License (GPL)
|
|
16
|
-
#
|
|
17
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
|
18
|
-
# a copy of this software and associated documentation files (the
|
|
19
|
-
# "Software"), to deal in the Software without restriction, including
|
|
20
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
|
21
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
22
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
|
23
|
-
# the following conditions:
|
|
24
|
-
#
|
|
25
|
-
# The above copyright notice and this permission notice shall be
|
|
26
|
-
# included in all copies or substantial portions of the Software.
|
|
27
|
-
#
|
|
28
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
29
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
30
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
31
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
32
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
33
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
34
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
35
|
-
#
|
|
36
|
-
# HISTORY:
|
|
37
|
-
#
|
|
38
|
-
# Cloneable was ported from Jim Weirich's Rake.
|
|
39
|
-
#
|
|
40
|
-
# AUTHORS:
|
|
41
|
-
#
|
|
42
|
-
# - Jim Weirich
|
|
43
|
-
#
|
|
44
|
-
# TODOs:
|
|
45
|
-
#
|
|
46
|
-
# - Method #clone should copy '<<'-methods in contrast to #dup.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# = Cloneable
|
|
50
|
-
#
|
|
51
|
-
# Standard basis for adding #dup and #clone methods to a class.
|
|
52
|
-
|
|
53
|
-
module Cloneable
|
|
54
|
-
def clone
|
|
55
|
-
sibling = self.class.new
|
|
56
|
-
instance_variables.each do |ivar|
|
|
57
|
-
value = self.instance_variable_get(ivar)
|
|
58
|
-
sibling.instance_variable_set(ivar, value.dup) #rake_dup)
|
|
59
|
-
end
|
|
60
|
-
sibling
|
|
61
|
-
end
|
|
62
|
-
alias_method :dup, :clone
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
# _____ _
|
|
68
|
-
# |_ _|__ ___| |_
|
|
69
|
-
# | |/ _ \/ __| __|
|
|
70
|
-
# | | __/\__ \ |_
|
|
71
|
-
# |_|\___||___/\__|
|
|
72
|
-
#
|
|
73
|
-
|
|
74
|
-
=begin #test
|
|
75
|
-
=end
|
data/log/changelog.txt
DELETED
|
File without changes
|
data/meta/facets.roll
DELETED
data/meta/google_ad.html
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<div style="position: absolute; top: 5px; right: 10px;">
|
|
2
|
-
<script type="text/javascript"><!--
|
|
3
|
-
google_ad_client = "pub-1126154564663472";
|
|
4
|
-
google_ad_width = 234;
|
|
5
|
-
google_ad_height = 60;
|
|
6
|
-
google_ad_format = "234x60_as";
|
|
7
|
-
google_ad_type = "text_image";
|
|
8
|
-
//2007-08-31: facets
|
|
9
|
-
google_ad_channel = "2923120207";
|
|
10
|
-
//-->
|
|
11
|
-
</script>
|
|
12
|
-
<script type="text/javascript"
|
|
13
|
-
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
|
14
|
-
</script>
|
|
15
|
-
</div>
|
data/meta/icli.yaml
DELETED
data/task/changes
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# generate changes from history
|
|
4
|
-
|
|
5
|
-
config = configuration['changes']
|
|
6
|
-
|
|
7
|
-
history_file = config['history'] || 'log/history.rd'
|
|
8
|
-
changes_file = config['changes'] || 'CHANGES'
|
|
9
|
-
|
|
10
|
-
history_file.to_actual_filename!
|
|
11
|
-
|
|
12
|
-
name, version = rollrc.name, rollrc.version
|
|
13
|
-
|
|
14
|
-
main :changes do
|
|
15
|
-
build changes_file
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
file changes_file => [ history_file ] do
|
|
19
|
-
history = File.read(history_file)
|
|
20
|
-
matches = /^==\s*#{version}(.*?)(\n==|\Z)/m.match(history)
|
|
21
|
-
changes = matches[0]
|
|
22
|
-
changes = changes.chomp('==').strip.sub(/^==\s+/, "#{name} ")
|
|
23
|
-
if dryrun?
|
|
24
|
-
puts "#{changes_file} would have been updated (dryrun mode)."
|
|
25
|
-
else
|
|
26
|
-
File.open(changes_file, 'w'){ |f| f << changes }
|
|
27
|
-
puts "#{changes_file} updated."
|
|
28
|
-
end
|
|
29
|
-
end
|
data/task/clean
DELETED
data/task/clobber/package
DELETED
data/task/log
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# produce changelog
|
|
4
|
-
|
|
5
|
-
main :changelog do
|
|
6
|
-
text = `svn log --xml`
|
|
7
|
-
i = text.index("?>\n")
|
|
8
|
-
text.insert(i+2, "\n" + '<?xml-stylesheet href="changelog.xsl" type="text/xsl" ?>')
|
|
9
|
-
|
|
10
|
-
if dryrun?
|
|
11
|
-
puts text
|
|
12
|
-
else
|
|
13
|
-
File.open('doc/log/changelog.xml') do |f|
|
|
14
|
-
f << text
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
data/task/prepare
DELETED
data/task/publish
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# Publish website to rubyforge
|
|
4
|
-
#
|
|
5
|
-
# This task publishes the source dir (deafult 'doc')
|
|
6
|
-
# to a rubyforge website.
|
|
7
|
-
|
|
8
|
-
main :publish do
|
|
9
|
-
config = configuration['publish']
|
|
10
|
-
|
|
11
|
-
project = config['project']
|
|
12
|
-
subdir = config['subdir']
|
|
13
|
-
source = config['source'] || "doc"
|
|
14
|
-
username = config['username']
|
|
15
|
-
protect = %w{usage statcvs statsvn robot.txt wiki}
|
|
16
|
-
exclude = %w{.svn}
|
|
17
|
-
|
|
18
|
-
abort "no project" unless project
|
|
19
|
-
abort "no username" unless username
|
|
20
|
-
|
|
21
|
-
if subdir
|
|
22
|
-
destination = File.join(project, subdir)
|
|
23
|
-
else
|
|
24
|
-
destination = project
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
dir = source.chomp('/') + '/'
|
|
28
|
-
url = "#{username}@rubyforge.org:/var/www/gforge-projects/#{destination}"
|
|
29
|
-
|
|
30
|
-
# maybe -p ?
|
|
31
|
-
op = ['-rLvz', '--delete']
|
|
32
|
-
if file?(File.join(source,'.rsync-filter'))
|
|
33
|
-
op << "--filter='dir-merge #{source}/.rsync-filter'"
|
|
34
|
-
else
|
|
35
|
-
op.concat exclude.map{|e| "--filter='- #{e}'"}
|
|
36
|
-
op.concat protect.map{|e| "--filter='P #{e}'"}
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
args = op + [dir, url]
|
|
40
|
-
|
|
41
|
-
rsync(*args.to_params)
|
|
42
|
-
end
|
|
43
|
-
|
data/task/release
DELETED
data/task/stamp
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# update version stamps
|
|
4
|
-
|
|
5
|
-
# You can change these via the command line.
|
|
6
|
-
version = commandline['version'] || release.version
|
|
7
|
-
status = commandline['status'] || release.status
|
|
8
|
-
|
|
9
|
-
# Update ROLLRC file.
|
|
10
|
-
|
|
11
|
-
main :stamp do
|
|
12
|
-
if version != release.version or status != release.status
|
|
13
|
-
build release.file
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
|
|
19
|
-
file release.file do
|
|
20
|
-
w = ''
|
|
21
|
-
w << "#{release.name} #{version} #{status} #{Time.now.strftime('%Y-%m-%d')}"
|
|
22
|
-
w << " #{release.default}" if release.default
|
|
23
|
-
w << "\n"
|
|
24
|
-
w << release.libpath.join("\n")
|
|
25
|
-
|
|
26
|
-
if dryrun?
|
|
27
|
-
puts release.file + ":"
|
|
28
|
-
puts w
|
|
29
|
-
else
|
|
30
|
-
File.open(release.file, 'w'){|f| f << w}
|
|
31
|
-
puts "#{release.file} updated."
|
|
32
|
-
end
|
|
33
|
-
end
|
data/task/stats
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# Simple code count analysis.
|
|
4
|
-
#
|
|
5
|
-
# This ratchet scan source code counting files,
|
|
6
|
-
# lines of code and comments and presents a
|
|
7
|
-
# report of it's findings.
|
|
8
|
-
|
|
9
|
-
main :stats do
|
|
10
|
-
statistics
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
DEFAULT_STATS_FILES = [ 'lib/**/*', 'ext/**/*', 'bin/**/*' ]
|
|
14
|
-
|
|
15
|
-
# Basic statics on line count.
|
|
16
|
-
#
|
|
17
|
-
# This task counts the file and lines of code in your
|
|
18
|
-
# project and provided some statistical figures.
|
|
19
|
-
#
|
|
20
|
-
# files Files to include and/or exclude in
|
|
21
|
-
# analysis. '+' and '-' files patterns
|
|
22
|
-
# are accepted. The default includes all
|
|
23
|
-
# files in the lib/ and ext/ directories.
|
|
24
|
-
#
|
|
25
|
-
# TODO Support - and + augmentations for configuration.
|
|
26
|
-
|
|
27
|
-
def statistics
|
|
28
|
-
config = configuration['stats'] || {}
|
|
29
|
-
scripts = config['files'] || DEFAULT_STATS_FILES
|
|
30
|
-
files = scripts.inject([]){ |memo, find| memo.concat(glob(find)); memo }
|
|
31
|
-
#Dir.multiglob_with_default(DEFAULT_STATS_FILES)
|
|
32
|
-
|
|
33
|
-
fc, l, c, r, t, s = *line_count(*files)
|
|
34
|
-
|
|
35
|
-
fct, lt, ct, rt, tt, st = *([0]*6)
|
|
36
|
-
if File.directory?('test')
|
|
37
|
-
fct, lt, ct, rt, tt, st = *line_count('test/**/*')
|
|
38
|
-
t = lt if lt > 0
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
rat = lambda do |d,n|
|
|
42
|
-
if d > n and n != 0
|
|
43
|
-
"%.1f" % [ d.to_f / n ]
|
|
44
|
-
elsif n > d and d != 0
|
|
45
|
-
"-" #"%.1f:1" % [ n.to_f / d ]
|
|
46
|
-
elsif d == 0 or n == 0
|
|
47
|
-
"-"
|
|
48
|
-
else
|
|
49
|
-
"1.0"
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
per = lambda do |n,d|
|
|
54
|
-
if d != 0
|
|
55
|
-
(((n.to_f / d)*100).to_i).to_s + "%"
|
|
56
|
-
else
|
|
57
|
-
"-"
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
max = l.to_s.size + 4
|
|
62
|
-
|
|
63
|
-
puts
|
|
64
|
-
#puts "FILES:"
|
|
65
|
-
#puts " source: #{fc}"
|
|
66
|
-
#puts " test : #{fct}"
|
|
67
|
-
#puts " total : #{fc+fct}"
|
|
68
|
-
#puts
|
|
69
|
-
#puts "LINES:"
|
|
70
|
-
#puts " code : %#{max}s %4s" % [ c.to_s, per[c,l] ]
|
|
71
|
-
#puts " docs : %#{max}s %4s" % [ r.to_s, per[r,l] ]
|
|
72
|
-
#puts " space : %#{max}s %4s" % [ s.to_s, per[s,l] ]
|
|
73
|
-
#puts " test : %#{max}s %4s" % [ t.to_s, per[t,l] ]
|
|
74
|
-
#puts " total : %#{max}s %4s" % [ l.to_s, per[l,l] ]
|
|
75
|
-
#puts
|
|
76
|
-
#puts "Ratio to 1 :"
|
|
77
|
-
#puts " code to test : #{rat[c,t]} #{per[c,t]}"
|
|
78
|
-
|
|
79
|
-
head = ["Total", "Code", "-%-", "Docs", "-%-", "Blank", "-%-", "Files"]
|
|
80
|
-
prod = [l.to_s, c.to_s, per[c,l], r.to_s, per[r,l], s.to_s, per[s,l], fc]
|
|
81
|
-
test = [lt.to_s, ct.to_s, per[ct,l], rt.to_s, per[rt,l], st.to_s, per[st,l], fct]
|
|
82
|
-
totl = [(l+lt), (c+ct), per[c+ct,l+lt], (r+rt), per[r+rt,l+lt], (s+st), per[s+st,l+lt], (fc+fct)]
|
|
83
|
-
|
|
84
|
-
puts "TYPE %#{max}s %#{max}s %4s %#{max}s %4s %#{max}s %4s %#{max}s" % head
|
|
85
|
-
puts "Source %#{max}s %#{max}s %4s %#{max}s %4s %#{max}s %4s %#{max}s" % prod
|
|
86
|
-
puts "Test %#{max}s %#{max}s %4s %#{max}s %4s %#{max}s %4s %#{max}s" % test
|
|
87
|
-
puts "Total %#{max}s %#{max}s %4s %#{max}s %4s %#{max}s %4s %#{max}s" % totl
|
|
88
|
-
puts
|
|
89
|
-
puts "RATIO Code Docs Blank Test Total"
|
|
90
|
-
puts "Code %7s %7s %7s %7s %7s" % [ rat[c,c], rat[c,r], rat[c,s], rat[c,t], rat[c,l] ]
|
|
91
|
-
puts "Docs %7s %7s %7s %7s %7s" % [ rat[r,c], rat[r,r], rat[r,s], rat[r,t], rat[r,l] ]
|
|
92
|
-
puts "Blank %7s %7s %7s %7s %7s" % [ rat[s,c], rat[s,r], rat[s,s], rat[s,t], rat[s,l] ]
|
|
93
|
-
puts "Test %7s %7s %7s %7s %7s" % [ rat[t,c], rat[t,r], rat[t,s], rat[t,t], rat[t,l] ]
|
|
94
|
-
puts "Total %7s %7s %7s %7s %7s" % [ rat[l,c], rat[l,r], rat[l,s], rat[l,t], rat[l,l] ]
|
|
95
|
-
puts
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
private
|
|
99
|
-
|
|
100
|
-
# Return line counts for files.
|
|
101
|
-
|
|
102
|
-
def line_count( *files )
|
|
103
|
-
files = files.inject([]) do |memo, find|
|
|
104
|
-
memo.concat(Dir.glob(find)); memo
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
fc, l, c, t, r = 0, 0, 0, 0, 0
|
|
108
|
-
bt, rb = false, false
|
|
109
|
-
|
|
110
|
-
files.each do |fname|
|
|
111
|
-
next unless fname =~ /.*rb/ # TODO should this be done?
|
|
112
|
-
fc += 1
|
|
113
|
-
File.open( fname ) do |f|
|
|
114
|
-
while line = f.gets
|
|
115
|
-
l += 1
|
|
116
|
-
next if line =~ /^\s*$/
|
|
117
|
-
case line
|
|
118
|
-
when /^=begin\s+test/
|
|
119
|
-
tb = true; t+=1
|
|
120
|
-
when /^=begin/
|
|
121
|
-
rb = true; r+=1
|
|
122
|
-
when /^=end/
|
|
123
|
-
t+=1 if tb
|
|
124
|
-
r+=1 if rb
|
|
125
|
-
rb, tb = false, false
|
|
126
|
-
when /^\s*#/
|
|
127
|
-
r += 1
|
|
128
|
-
else
|
|
129
|
-
c+=1 if !(rb or tb)
|
|
130
|
-
r+=1 if rb
|
|
131
|
-
t+=1 if tb
|
|
132
|
-
end
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
end
|
|
136
|
-
s = l - c - r - t
|
|
137
|
-
return fc, l, c, r, t, s
|
|
138
|
-
end
|
data/task/test/cross
DELETED
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# Run cross comparison tests.
|
|
4
|
-
#
|
|
5
|
-
# This tool runs unit tests in pairs to make
|
|
6
|
-
# sure there is cross library compatibility.
|
|
7
|
-
|
|
8
|
-
require 'facets/hash/rekey'
|
|
9
|
-
require 'facets/string/tabs'
|
|
10
|
-
require 'facets/progressbar'
|
|
11
|
-
|
|
12
|
-
require 'test/unit/ui/testrunnermediator' #require 'test/unit'
|
|
13
|
-
::Test::Unit.run = true # Don't autorun tests!
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
main :crosstest do
|
|
17
|
-
run_crosstests
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Run unit-tests. The tests are run in pairs in a separate interpretor
|
|
21
|
-
# to prevent script clash. This makes for a more robust test
|
|
22
|
-
# facility and discover potential conflicts between test scripts.
|
|
23
|
-
#
|
|
24
|
-
# tests Test files (eg. test/tc_**/*.rb) [test/**/*]
|
|
25
|
-
# libs Directories to include in load path.
|
|
26
|
-
# ('./lib' is always included)
|
|
27
|
-
# live Deactive use of local libs and test against install.
|
|
28
|
-
# reqs List of files to require prior to running tests.
|
|
29
|
-
#
|
|
30
|
-
# To isolate tests this tool marshals test results across a
|
|
31
|
-
# stdout->stdin shell pipe. This prevents interfence of one
|
|
32
|
-
# pair of script's tests on another. But consequently it is
|
|
33
|
-
# not always possible to send debug info to stdout in the tests
|
|
34
|
-
# themselves (eg. #p and #puts).
|
|
35
|
-
|
|
36
|
-
def run_crosstests
|
|
37
|
-
info = configuration['test']
|
|
38
|
-
|
|
39
|
-
if commandline.arguments.empty?
|
|
40
|
-
tests = info['files'] || 'test/unit/**/test_*.rb'
|
|
41
|
-
else
|
|
42
|
-
tests = commandline.arguments
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
libs = info['libpath']
|
|
46
|
-
reqs = info['require']
|
|
47
|
-
live = info['live']
|
|
48
|
-
#extract = info['extract']
|
|
49
|
-
|
|
50
|
-
tests = [ tests ].flatten
|
|
51
|
-
libs = [ libs ].flatten
|
|
52
|
-
|
|
53
|
-
results = TestResults.new #(style)
|
|
54
|
-
|
|
55
|
-
# get test files
|
|
56
|
-
test_libs = libs.join(':')
|
|
57
|
-
test_files = Dir.multiglob(*tests)
|
|
58
|
-
if test_files.empty?
|
|
59
|
-
puts "Tests [NONE]"
|
|
60
|
-
return
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
# run tests
|
|
64
|
-
|
|
65
|
-
if trace?
|
|
66
|
-
pbar = nil
|
|
67
|
-
size = test_files.collect{|f| f.size}.max * 2 + 5
|
|
68
|
-
dots = '.' * size
|
|
69
|
-
else
|
|
70
|
-
pbar = Console::ProgressBar.new('Testing', test_files.size ** 2)
|
|
71
|
-
pbar.inc
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
test_files.each do |test_file|
|
|
75
|
-
next unless File.file?(test_file)
|
|
76
|
-
|
|
77
|
-
test_files.each do |test_file_x|
|
|
78
|
-
next unless File.file?(test_file_x)
|
|
79
|
-
next if test_file == test_file_x
|
|
80
|
-
|
|
81
|
-
pbar.inc if pbar
|
|
82
|
-
unless pbar
|
|
83
|
-
out = test_file +' : ' + test_file_x
|
|
84
|
-
print out + dots[out.size..-1]
|
|
85
|
-
$stdout.flush
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
r = fork_test( test_file, test_file_x, :libs=>libs, :reqs=>reqs, :live=>live )
|
|
89
|
-
|
|
90
|
-
unless pbar
|
|
91
|
-
puts r.passed? ? "[PASS]" : "[FAIL]"
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
results << r
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
pbar.finish if pbar
|
|
99
|
-
|
|
100
|
-
# display results
|
|
101
|
-
puts results
|
|
102
|
-
|
|
103
|
-
fails, errrs = results.failure_count, results.error_count
|
|
104
|
-
#CHECKLIST << :test if fails > 0
|
|
105
|
-
#CHECKLIST << :test if errrs > 0
|
|
106
|
-
return (fails + errrs > 0)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
# Run a test in a separate process.
|
|
110
|
-
#
|
|
111
|
-
# Currently send program output to null device.
|
|
112
|
-
# Could send to a logger in future version.
|
|
113
|
-
#
|
|
114
|
-
# Key parameters are libs, reqs, live.
|
|
115
|
-
|
|
116
|
-
def fork_test( file, xfile, keys )
|
|
117
|
-
keys = keys.rekey(:to_s)
|
|
118
|
-
|
|
119
|
-
libs = keys['lib'] || []
|
|
120
|
-
reqs = keys['req'] || []
|
|
121
|
-
live = keys['live']
|
|
122
|
-
|
|
123
|
-
src = ''
|
|
124
|
-
|
|
125
|
-
unless live
|
|
126
|
-
l = File.join( Dir.pwd, 'lib' )
|
|
127
|
-
if File.directory?( l )
|
|
128
|
-
src << %{$:.unshift('#{l}')\n}
|
|
129
|
-
end
|
|
130
|
-
libs.each { |r| src << %{$:.unshift('#{r}')\n} }
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
src << %{
|
|
134
|
-
#require 'test/unit'
|
|
135
|
-
require 'test/unit/collector'
|
|
136
|
-
require 'test/unit/collector/objectspace'
|
|
137
|
-
require 'test/unit/ui/testrunnermediator'
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
reqs.each do |fix|
|
|
141
|
-
src << %Q{
|
|
142
|
-
require '#{fix}'
|
|
143
|
-
}
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
src << %{
|
|
147
|
-
def warn(*null); end # silence warnings
|
|
148
|
-
|
|
149
|
-
output = STDOUT.dup
|
|
150
|
-
STDOUT.reopen( PLATFORM =~ /mswin/ ? "NUL" : "/dev/null" )
|
|
151
|
-
|
|
152
|
-
load('#{file}')
|
|
153
|
-
load('#{xfile}')
|
|
154
|
-
|
|
155
|
-
tests = Test::Unit::Collector::ObjectSpace.new.collect
|
|
156
|
-
runner = Test::Unit::UI::TestRunnerMediator.new( tests )
|
|
157
|
-
result = runner.run_suite
|
|
158
|
-
|
|
159
|
-
begin
|
|
160
|
-
marshalled = Marshal.dump(result)
|
|
161
|
-
rescue TypeError => e
|
|
162
|
-
$stderr << "MARSHAL ERROR\n"
|
|
163
|
-
$stderr << "TEST: #{file}\n"
|
|
164
|
-
$stderr << "XTEST: #{xfile}\n"
|
|
165
|
-
$stderr << "DATA:" << result.inspect
|
|
166
|
-
exit -1
|
|
167
|
-
end
|
|
168
|
-
output << marshalled
|
|
169
|
-
|
|
170
|
-
STDOUT.reopen(output)
|
|
171
|
-
output.close
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
result = IO.popen("ruby","w+") do |ruby|
|
|
175
|
-
ruby.puts src
|
|
176
|
-
ruby.close_write
|
|
177
|
-
ruby.read
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
begin
|
|
181
|
-
marsh = Marshal.load(result)
|
|
182
|
-
rescue ArgumentError
|
|
183
|
-
$stderr << "\nCannot load marshalled test data.\n"
|
|
184
|
-
$stderr << result << "\n"
|
|
185
|
-
exit -1
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
return marsh
|
|
189
|
-
end
|
|
190
|
-
|
|
191
|
-
#
|
|
192
|
-
# Support class for collecting test results.
|
|
193
|
-
#
|
|
194
|
-
|
|
195
|
-
class TestResults
|
|
196
|
-
attr_reader :assertion_count,
|
|
197
|
-
:run_count,
|
|
198
|
-
:failure_count,
|
|
199
|
-
:error_count
|
|
200
|
-
|
|
201
|
-
attr_accessor :style
|
|
202
|
-
|
|
203
|
-
def initialize( style=nil )
|
|
204
|
-
@style = style
|
|
205
|
-
|
|
206
|
-
@results = []
|
|
207
|
-
|
|
208
|
-
@assertion_count = 0
|
|
209
|
-
@run_count = 0
|
|
210
|
-
@failure_count = 0
|
|
211
|
-
@error_count = 0
|
|
212
|
-
end
|
|
213
|
-
|
|
214
|
-
# Add a result to the results collection.
|
|
215
|
-
|
|
216
|
-
def <<( result )
|
|
217
|
-
@results << result
|
|
218
|
-
|
|
219
|
-
@assertion_count += result.assertion_count
|
|
220
|
-
@run_count += result.run_count
|
|
221
|
-
@failure_count += result.failure_count
|
|
222
|
-
@error_count += result.error_count
|
|
223
|
-
end
|
|
224
|
-
|
|
225
|
-
#
|
|
226
|
-
|
|
227
|
-
def errors
|
|
228
|
-
errors = []
|
|
229
|
-
@results.each do |r|
|
|
230
|
-
unless r.passed?
|
|
231
|
-
errors << r.instance_variable_get('@errors')
|
|
232
|
-
end
|
|
233
|
-
end
|
|
234
|
-
errors.reject! { |e| e == [] }
|
|
235
|
-
errors
|
|
236
|
-
end
|
|
237
|
-
|
|
238
|
-
#
|
|
239
|
-
|
|
240
|
-
def failures
|
|
241
|
-
failures = []
|
|
242
|
-
@results.each do |r|
|
|
243
|
-
unless r.passed?
|
|
244
|
-
failures << r.instance_variable_get('@failures')
|
|
245
|
-
end
|
|
246
|
-
end
|
|
247
|
-
failures.reject! { |e| e == [] }
|
|
248
|
-
failures
|
|
249
|
-
end
|
|
250
|
-
|
|
251
|
-
# Output format for test results.
|
|
252
|
-
|
|
253
|
-
def to_s
|
|
254
|
-
return @results.to_s if style == 'pease'
|
|
255
|
-
|
|
256
|
-
s = []
|
|
257
|
-
# Display failures
|
|
258
|
-
unless failures.empty?
|
|
259
|
-
s << ''
|
|
260
|
-
s << "FAILURES:"
|
|
261
|
-
failures.reverse.each do |fails|
|
|
262
|
-
fails.reverse.each do |failure|
|
|
263
|
-
#puts
|
|
264
|
-
s << %{ - test : #{failure.test_name}}
|
|
265
|
-
s << %{ location : #{failure.location}}
|
|
266
|
-
if failure.message.index("\n")
|
|
267
|
-
s << %{ message : >}
|
|
268
|
-
s << failure.message.tabto(6)
|
|
269
|
-
else
|
|
270
|
-
s << %{ message : #{failure.message}}
|
|
271
|
-
end
|
|
272
|
-
end
|
|
273
|
-
end
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
# Display errors
|
|
277
|
-
unless errors.empty?
|
|
278
|
-
s << ''
|
|
279
|
-
s << "ERRORS:"
|
|
280
|
-
errors.reverse.each do |errs|
|
|
281
|
-
errs.reverse.each do |err|
|
|
282
|
-
s << ''
|
|
283
|
-
s << %{ - test : #{err.test_name}}
|
|
284
|
-
s << %{ message : #{err.exception.message}}
|
|
285
|
-
s << %{ backtrace :}
|
|
286
|
-
err.exception.backtrace[0...-1].each { |bt| s << %Q{ - #{bt}} }
|
|
287
|
-
end
|
|
288
|
-
end
|
|
289
|
-
end
|
|
290
|
-
|
|
291
|
-
# Display final results
|
|
292
|
-
s << ''
|
|
293
|
-
s << "Summary:"
|
|
294
|
-
s << " Tests : #{@run_count}"
|
|
295
|
-
s << " Assertions : #{@assertion_count}"
|
|
296
|
-
s << " Failures : #{@failure_count}"
|
|
297
|
-
s << " Errors : #{@error_count}"
|
|
298
|
-
s << ''
|
|
299
|
-
s << ''
|
|
300
|
-
|
|
301
|
-
return s.join("\n")
|
|
302
|
-
end
|
|
303
|
-
|
|
304
|
-
# Delegate missing call to the results array.
|
|
305
|
-
|
|
306
|
-
def method_missing(*a,&b)
|
|
307
|
-
@results.send(*a,&b)
|
|
308
|
-
end
|
|
309
|
-
end
|