ludy 0.1.8 → 0.1.9
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 +26 -0
- data/Manifest.txt +28 -15
- data/NOTICE +9 -1
- data/README +7 -4
- data/Rakefile +11 -7
- data/lib/ludy.rb +3 -4
- data/lib/ludy/array/choice.rb +14 -0
- data/lib/ludy/array/combine.rb +1 -1
- data/lib/ludy/array/combos.rb +28 -19
- data/lib/ludy/array/count.rb +7 -0
- data/lib/ludy/array/head.rb +4 -0
- data/lib/ludy/array/pad.rb +13 -0
- data/lib/ludy/array/product.rb +14 -0
- data/lib/ludy/array/rotate.rb +3 -4
- data/lib/ludy/array/tail.rb +1 -0
- data/lib/ludy/hash.rb +3 -0
- data/lib/ludy/hash/reverse_merge.rb +11 -0
- data/lib/ludy/kernel/deep_copy.rb +6 -0
- data/lib/ludy/kernel/maybe.rb +6 -0
- data/lib/ludy/paginator.rb +1 -1
- data/lib/ludy/timer.rb +29 -0
- data/lib/puzzle_generator.rb +7 -5
- data/lib/puzzle_generator/chain.rb +5 -3
- data/lib/puzzle_generator/chained_map.rb +11 -11
- data/lib/puzzle_generator/map.rb +7 -7
- data/lib/puzzle_generator/misc.rb +7 -6
- data/lib/puzzle_generator/puzzle.rb +1 -4
- data/spec/ludy_spec.rb +8 -0
- data/spec/spec_helper.rb +17 -0
- data/tasks/doc.rake +1 -3
- data/tasks/gem.rake +2 -2
- data/tasks/manifest.rake +16 -2
- data/tasks/post_load.rake +18 -0
- data/tasks/setup.rb +47 -9
- data/tasks/spec.rake +3 -0
- data/test/example_puzzle.rb +7 -7
- data/test/helper.rb +3 -0
- data/test/{test_array.rb → ludy/test_array.rb} +12 -2
- data/test/{test_class.rb → ludy/test_class.rb} +1 -1
- data/test/{test_defun.rb → ludy/test_defun.rb} +1 -1
- data/test/{test_dices.rb → ludy/test_dices.rb} +1 -1
- data/test/ludy/test_hash.rb +13 -0
- data/test/{test_kernel.rb → ludy/test_kernel.rb} +1 -1
- data/test/{test_lazy.rb → ludy/test_lazy.rb} +1 -1
- data/test/{test_paginator.rb → ludy/test_paginator.rb} +2 -2
- data/test/{test_proc.rb → ludy/test_proc.rb} +2 -1
- data/test/{test_require_all.rb → ludy/test_require_all.rb} +1 -1
- data/test/{test_symbol.rb → ludy/test_symbol.rb} +1 -1
- data/test/{test_variable.rb → ludy/test_variable.rb} +1 -1
- data/test/{test_y_combinator.rb → ludy/test_y_combinator.rb} +1 -1
- data/test/{test_z_combinator.rb → ludy/test_z_combinator.rb} +1 -1
- data/test/multiruby.sh +2 -0
- metadata +54 -41
- data/lib/ludy/array/reverse_map.rb +0 -7
- data/lib/ludy/test/helper.rb +0 -3
data/test/helper.rb
ADDED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
|
-
require File.join(File.dirname(__FILE__), '..', '
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'helper')
|
3
3
|
require 'ludy/array'
|
4
|
-
require 'ludy/symbol/to_proc'
|
4
|
+
require 'ludy/symbol/to_proc' if RUBY_VERSION < '1.9.0'
|
5
5
|
|
6
6
|
class TestArray < Test::Unit::TestCase
|
7
7
|
def test_filter
|
@@ -49,5 +49,15 @@ class TestArray < Test::Unit::TestCase
|
|
49
49
|
def test_tail
|
50
50
|
assert_equal [2,3,4], [1,2,3,4].tail
|
51
51
|
end
|
52
|
+
def test_pad
|
53
|
+
assert_equal [1,2,3,nil,nil], [1,2,3].pad(5)
|
54
|
+
assert_equal [1,2,3], [1,2,3].pad(3)
|
55
|
+
assert_equal [1,2,3], [1,2,3].pad(2)
|
56
|
+
assert_equal [1,2,3], [1,2,3].pad(-2)
|
57
|
+
assert_equal [1,2,3], [1,2,3].pad(0)
|
58
|
+
a = [1,2,3]
|
59
|
+
a.pad! 5, 6
|
60
|
+
assert_equal [1,2,3,6,6], a
|
61
|
+
end
|
52
62
|
end
|
53
63
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'helper')
|
3
|
+
require 'ludy/hash'
|
4
|
+
|
5
|
+
class TestClass < Test::Unit::TestCase
|
6
|
+
def test_reverse_merge
|
7
|
+
opt = {:a => 1, :b => 2}
|
8
|
+
assert_equal opt, opt.reverse_merge({:a => 3})
|
9
|
+
assert_equal opt, opt.reverse_merge!({:a => 3})
|
10
|
+
assert_equal opt.merge({:c => 3}), opt.reverse_merge({:c => 3})
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
require File.join(File.dirname(__FILE__), '..', '
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'helper')
|
3
3
|
require 'ludy/paginator'
|
4
4
|
require 'ludy/symbol/to_proc' if RUBY_VERSION < '1.9.0'
|
5
5
|
|
@@ -49,7 +49,7 @@ class TestPaginator < Test::Unit::TestCase
|
|
49
49
|
end
|
50
50
|
class Topic
|
51
51
|
class << self
|
52
|
-
def count
|
52
|
+
def count opts = {}
|
53
53
|
101
|
54
54
|
end
|
55
55
|
def find all, opts = {}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
|
-
require File.join(File.dirname(__FILE__), '..', '
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'helper')
|
3
3
|
require 'ludy/proc'
|
4
|
+
require 'ludy/symbol/to_proc' if RUBY_VERSION < '1.9.0'
|
4
5
|
|
5
6
|
class TestProc < Test::Unit::TestCase
|
6
7
|
def test_bind
|
data/test/multiruby.sh
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ludy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Lin Jen-Shin (a.k.a. godfat \xE7\x9C\x9F\xE5\xB8\xB8)"
|
@@ -9,19 +9,11 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-02-07 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
17
|
-
version_requirement:
|
18
|
-
version_requirements: !ruby/object:Gem::Requirement
|
19
|
-
requirements:
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: "0"
|
23
|
-
version:
|
24
|
-
description: "== DESCRIPTION:"
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Aims to extend Ruby standard library, providing some useful tools that's not existed in the standard library, especially for functional programming.
|
25
17
|
email: "strip any number: 18god29fat7029 (at] godfat32 -dooot- 20org"
|
26
18
|
executables:
|
27
19
|
- ludy
|
@@ -38,10 +30,12 @@ extra_rdoc_files:
|
|
38
30
|
- tasks/doc.rake
|
39
31
|
- tasks/gem.rake
|
40
32
|
- tasks/manifest.rake
|
33
|
+
- tasks/post_load.rake
|
41
34
|
- tasks/rubyforge.rake
|
42
35
|
- tasks/spec.rake
|
43
36
|
- tasks/svn.rake
|
44
37
|
- tasks/test.rake
|
38
|
+
- test/multiruby.sh
|
45
39
|
files:
|
46
40
|
- CHANGES
|
47
41
|
- LICENSE
|
@@ -55,13 +49,17 @@ files:
|
|
55
49
|
- lib/ludy/all.rb
|
56
50
|
- lib/ludy/array.rb
|
57
51
|
- lib/ludy/array/body.rb
|
52
|
+
- lib/ludy/array/choice.rb
|
58
53
|
- lib/ludy/array/combine.rb
|
59
54
|
- lib/ludy/array/combos.rb
|
55
|
+
- lib/ludy/array/count.rb
|
60
56
|
- lib/ludy/array/filter.rb
|
61
57
|
- lib/ludy/array/foldl.rb
|
62
58
|
- lib/ludy/array/foldr.rb
|
59
|
+
- lib/ludy/array/head.rb
|
63
60
|
- lib/ludy/array/map_with_index.rb
|
64
|
-
- lib/ludy/array/
|
61
|
+
- lib/ludy/array/pad.rb
|
62
|
+
- lib/ludy/array/product.rb
|
65
63
|
- lib/ludy/array/rotate.rb
|
66
64
|
- lib/ludy/array/tail.rb
|
67
65
|
- lib/ludy/blackhole.rb
|
@@ -75,13 +73,17 @@ files:
|
|
75
73
|
- lib/ludy/deprecated/untranspose.rb
|
76
74
|
- lib/ludy/deprecated/unzip.rb
|
77
75
|
- lib/ludy/dices.rb
|
76
|
+
- lib/ludy/hash.rb
|
77
|
+
- lib/ludy/hash/reverse_merge.rb
|
78
78
|
- lib/ludy/helpers/check_box.rb
|
79
79
|
- lib/ludy/kernel.rb
|
80
|
+
- lib/ludy/kernel/deep_copy.rb
|
80
81
|
- lib/ludy/kernel/defun.rb
|
81
82
|
- lib/ludy/kernel/ergo.rb
|
82
83
|
- lib/ludy/kernel/id.rb
|
83
84
|
- lib/ludy/kernel/if_else.rb
|
84
85
|
- lib/ludy/kernel/m.rb
|
86
|
+
- lib/ludy/kernel/maybe.rb
|
85
87
|
- lib/ludy/kernel/public_send.rb
|
86
88
|
- lib/ludy/kernel/singleton_method.rb
|
87
89
|
- lib/ludy/kernel/tap.rb
|
@@ -106,7 +108,7 @@ files:
|
|
106
108
|
- lib/ludy/tasks/preprocess_cpp/debug_hook.rb
|
107
109
|
- lib/ludy/tasks/preprocess_cpp/header_guard.rb
|
108
110
|
- lib/ludy/tasks/preprocess_cpp/template_forward_parameters.rb
|
109
|
-
- lib/ludy/
|
111
|
+
- lib/ludy/timer.rb
|
110
112
|
- lib/ludy/variable.rb
|
111
113
|
- lib/ludy/y_combinator.rb
|
112
114
|
- lib/ludy/z_combinator.rb
|
@@ -118,10 +120,12 @@ files:
|
|
118
120
|
- lib/puzzle_generator/misc.rb
|
119
121
|
- lib/puzzle_generator/puzzle.rb
|
120
122
|
- spec/ludy_spec.rb
|
123
|
+
- spec/spec_helper.rb
|
121
124
|
- tasks/annotations.rake
|
122
125
|
- tasks/doc.rake
|
123
126
|
- tasks/gem.rake
|
124
127
|
- tasks/manifest.rake
|
128
|
+
- tasks/post_load.rake
|
125
129
|
- tasks/rubyforge.rake
|
126
130
|
- tasks/setup.rb
|
127
131
|
- tasks/spec.rake
|
@@ -134,23 +138,31 @@ files:
|
|
134
138
|
- test/deprecated/ts_ludy.rb
|
135
139
|
- test/deprecated/unzip_and_untranspose.rb
|
136
140
|
- test/example_puzzle.rb
|
137
|
-
- test/
|
138
|
-
- test/
|
139
|
-
- test/
|
140
|
-
- test/
|
141
|
-
- test/
|
142
|
-
- test/
|
143
|
-
- test/
|
144
|
-
- test/
|
145
|
-
- test/
|
146
|
-
- test/
|
147
|
-
- test/
|
148
|
-
- test/
|
149
|
-
- test/
|
141
|
+
- test/helper.rb
|
142
|
+
- test/ludy/test_array.rb
|
143
|
+
- test/ludy/test_class.rb
|
144
|
+
- test/ludy/test_defun.rb
|
145
|
+
- test/ludy/test_dices.rb
|
146
|
+
- test/ludy/test_hash.rb
|
147
|
+
- test/ludy/test_kernel.rb
|
148
|
+
- test/ludy/test_lazy.rb
|
149
|
+
- test/ludy/test_paginator.rb
|
150
|
+
- test/ludy/test_proc.rb
|
151
|
+
- test/ludy/test_require_all.rb
|
152
|
+
- test/ludy/test_symbol.rb
|
153
|
+
- test/ludy/test_variable.rb
|
154
|
+
- test/ludy/test_y_combinator.rb
|
155
|
+
- test/ludy/test_z_combinator.rb
|
156
|
+
- test/multiruby.sh
|
150
157
|
has_rdoc: true
|
151
158
|
homepage: http://ludy.rubyforge.org/
|
152
159
|
post_install_message:
|
153
160
|
rdoc_options:
|
161
|
+
- --diagram
|
162
|
+
- --charset=utf-8
|
163
|
+
- --inline-source
|
164
|
+
- --line-numbers
|
165
|
+
- --promiscuous
|
154
166
|
- --main
|
155
167
|
- README
|
156
168
|
require_paths:
|
@@ -175,16 +187,17 @@ signing_key:
|
|
175
187
|
specification_version: 2
|
176
188
|
summary: Aims to extend Ruby standard library, providing some useful tools that's not existed in the standard library, especially for functional programming.
|
177
189
|
test_files:
|
178
|
-
- test/test_array.rb
|
179
|
-
- test/test_class.rb
|
180
|
-
- test/test_defun.rb
|
181
|
-
- test/test_dices.rb
|
182
|
-
- test/
|
183
|
-
- test/
|
184
|
-
- test/
|
185
|
-
- test/
|
186
|
-
- test/
|
187
|
-
- test/
|
188
|
-
- test/
|
189
|
-
- test/
|
190
|
-
- test/
|
190
|
+
- test/ludy/test_array.rb
|
191
|
+
- test/ludy/test_class.rb
|
192
|
+
- test/ludy/test_defun.rb
|
193
|
+
- test/ludy/test_dices.rb
|
194
|
+
- test/ludy/test_hash.rb
|
195
|
+
- test/ludy/test_kernel.rb
|
196
|
+
- test/ludy/test_lazy.rb
|
197
|
+
- test/ludy/test_paginator.rb
|
198
|
+
- test/ludy/test_proc.rb
|
199
|
+
- test/ludy/test_require_all.rb
|
200
|
+
- test/ludy/test_symbol.rb
|
201
|
+
- test/ludy/test_variable.rb
|
202
|
+
- test/ludy/test_y_combinator.rb
|
203
|
+
- test/ludy/test_z_combinator.rb
|
data/lib/ludy/test/helper.rb
DELETED