facets 2.9.0.pre.1 → 2.9.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -0
- data/COPYING +1 -2
- data/HISTORY.rdoc +16 -8
- data/lib/core/facets/hash/subset.rb +24 -0
- data/lib/core/facets/hash/zip.rb +18 -0
- data/lib/core/facets/kernel/try.rb +3 -3
- data/lib/core/facets/module/home.rb +90 -0
- data/lib/core/facets/module/homename.rb +1 -0
- data/lib/core/facets/module/housing.rb +1 -0
- data/lib/core/facets/module/modname.rb +1 -22
- data/lib/core/facets/na.rb +11 -5
- data/lib/core/facets/object/clone.rb +1 -0
- data/lib/core/facets/{kernel/try_dup.rb → object/dup.rb} +41 -35
- data/lib/core/facets/{kernel → object}/object_state.rb +15 -18
- data/lib/core/facets/object/replace.rb +43 -0
- data/lib/core/facets/object/try_dup.rb +1 -0
- data/lib/core/facets/string/cleanlines.rb +2 -0
- data/lib/core/facets/time/ago.rb +1 -1
- data/lib/core/facets/time/in.rb +1 -93
- data/lib/core/facets/time/less.rb +1 -0
- data/lib/core/facets/time/shift.rb +95 -0
- data/lib/more/facets/interval.rb +284 -0
- data/lib/more/facets/math.rb +6 -0
- data/lib/more/facets/math/abs.rb +8 -0
- data/lib/more/facets/math/acot.rb +8 -0
- data/lib/more/facets/math/acoth.rb +8 -0
- data/lib/more/facets/math/acsc.rb +8 -0
- data/lib/more/facets/math/acsch.rb +8 -0
- data/lib/more/facets/math/amd.rb +17 -0
- data/lib/more/facets/math/approx_equal.rb +15 -0
- data/lib/more/facets/math/asec.rb +8 -0
- data/lib/more/facets/math/asech.rb +8 -0
- data/lib/more/facets/math/atkinson_index.rb +16 -0
- data/lib/more/facets/math/beta.rb +9 -0
- data/lib/more/facets/math/cdf.rb +10 -0
- data/lib/more/facets/math/ceil.rb +8 -0
- data/lib/more/facets/math/cot.rb +8 -0
- data/lib/more/facets/math/coth.rb +8 -0
- data/lib/more/facets/math/csc.rb +8 -0
- data/lib/more/facets/math/csch.rb +8 -0
- data/lib/more/facets/math/delta.rb +8 -0
- data/lib/more/facets/math/epsilon.rb +21 -0
- data/lib/more/facets/math/exp10.rb +8 -0
- data/lib/more/facets/math/exp2.rb +8 -0
- data/lib/more/facets/math/factorial.rb +37 -0
- data/lib/more/facets/math/floor.rb +8 -0
- data/lib/more/facets/math/gamma.rb +12 -0
- data/lib/more/facets/math/gcd.rb +23 -0
- data/lib/more/facets/math/gini_coefficient.rb +33 -0
- data/lib/more/facets/math/kldivergence.rb +19 -0
- data/lib/more/facets/math/lcm.rb +15 -0
- data/lib/more/facets/math/lgamma.rb +21 -0
- data/lib/more/facets/math/linsolve.rb +10 -0
- data/lib/more/facets/math/log2.rb +14 -0
- data/lib/more/facets/math/max.rb +1 -0
- data/lib/more/facets/math/mean.rb +16 -0
- data/lib/more/facets/math/median.rb +15 -0
- data/lib/more/facets/math/min.rb +35 -0
- data/lib/more/facets/math/pow.rb +8 -0
- data/lib/more/facets/math/pstd.rb +1 -0
- data/lib/more/facets/math/pvariance.rb +1 -0
- data/lib/more/facets/math/rmd.rb +16 -0
- data/lib/more/facets/math/root.rb +8 -0
- data/lib/more/facets/math/sec.rb +8 -0
- data/lib/more/facets/math/sech.rb +8 -0
- data/lib/more/facets/math/sign.rb +9 -0
- data/lib/more/facets/math/sinc.rb +8 -0
- data/lib/more/facets/math/sqr.rb +8 -0
- data/lib/more/facets/math/sqsolve.rb +53 -0
- data/lib/more/facets/math/std.rb +27 -0
- data/lib/more/facets/math/stderr.rb +1 -0
- data/lib/more/facets/math/sum.rb +16 -0
- data/lib/more/facets/math/summed_sqdevs.rb +14 -0
- data/lib/more/facets/math/theil_index.rb +24 -0
- data/lib/more/facets/math/variance.rb +31 -0
- data/lib/more/facets/thread.rb +24 -0
- data/lib/tour/facets/array/op_pow.rb +5 -0
- data/lib/tour/facets/module/enclosure.rb +15 -1
- data/lib/tour/facets/module/preextend.rb +26 -0
- data/lib/tour/facets/module/prepend.rb +39 -13
- data/meta/gemfile +1 -1
- data/qed/core/binding/caller.rdoc +1 -3
- data/test/core/array/test_after.rb +1 -1
- data/test/core/array/test_before.rb +1 -1
- data/test/core/array/test_conjoin.rb +1 -1
- data/test/core/array/test_store.rb +1 -1
- data/test/core/hash/test_argumentize.rb +1 -1
- data/test/core/hash/test_join.rb +1 -1
- data/test/core/kernel/test_dup.rb +1 -1
- data/test/core/kernel/test_get.rb +1 -1
- data/test/core/kernel/test_qua_class.rb +1 -1
- data/test/core/time/test_ago.rb +5 -117
- data/test/core/time/test_hence.rb +2 -2
- data/test/core/time/test_in.rb +4 -115
- data/test/core/time/test_less.rb +137 -0
- data/test/core/time/test_set.rb +1 -1
- data/test/core/time/test_shift.rb +126 -0
- data/test/more/test_date.rb +1 -1
- data/test/tour/module/test_cattr.rb +1 -1
- data/test/tour/module/test_class_extend.rb +1 -1
- data/test/tour/module/test_instance_function.rb +1 -1
- data/test/tour/module/test_method_space.rb +1 -1
- metadata +76 -10
- data/lib/core/facets/hash/zipnew.rb +0 -18
- data/lib/core/facets/kernel/clone.rb +0 -1
- data/lib/core/facets/kernel/dup.rb +0 -34
- data/lib/core/facets/kernel/replace.rb +0 -1
@@ -1,18 +0,0 @@
|
|
1
|
-
class Hash
|
2
|
-
|
3
|
-
# Creates a new hash from two arrays --a keys array and
|
4
|
-
# a values array.
|
5
|
-
#
|
6
|
-
# Hash.zipnew(["a","b","c"], [1,2,3])
|
7
|
-
# #=> { "a"=>1, "b"=>2, "c"=>3 }
|
8
|
-
#
|
9
|
-
# CREDIT: Trans, Ara T. Howard
|
10
|
-
|
11
|
-
def self.zipnew(keys,values) # or some better name
|
12
|
-
h = {}
|
13
|
-
keys.size.times{ |i| h[ keys[i] ] = values[i] }
|
14
|
-
h
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
require 'facets/kernel/dup'
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'facets/kernel/try_dup'
|
2
|
-
|
3
|
-
class Object # module Kernel ?
|
4
|
-
# Can you safely call #dup on this object?
|
5
|
-
# False for nil, false, true, symbols, and numbers; true otherwise.
|
6
|
-
def dup? ; true ; end
|
7
|
-
def clone? ; true ; end
|
8
|
-
end
|
9
|
-
|
10
|
-
class NilClass
|
11
|
-
def dup? ; false ; end
|
12
|
-
def clone? ; false ; end
|
13
|
-
end
|
14
|
-
|
15
|
-
class FalseClass
|
16
|
-
def dup? ; false ; end
|
17
|
-
def clone? ; false ; end
|
18
|
-
end
|
19
|
-
|
20
|
-
class TrueClass
|
21
|
-
def dup? ; false ; end
|
22
|
-
def clone? ; false ; end
|
23
|
-
end
|
24
|
-
|
25
|
-
class Symbol
|
26
|
-
def dup? ; false ; end
|
27
|
-
def clone? ; false ; end
|
28
|
-
end
|
29
|
-
|
30
|
-
class Numeric
|
31
|
-
def dup? ; false ; end
|
32
|
-
def clone? ; false ; end
|
33
|
-
end
|
34
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
require 'facets/kernel/object_state'
|