ludy 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,12 @@
1
1
  = ludy changes history
2
2
 
3
+ == ludy 0.1.1, 2008.01.10
4
+
5
+ * add Array#tail and Array#map_with_index to make the task of
6
+ template forward parameters work again. (without depend on facets)
7
+
8
+ * add some todo notes.
9
+
3
10
  == ludy 0.1.0, 2008.01.08
4
11
 
5
12
  * directory structure rearranged
data/Manifest.txt CHANGED
@@ -15,8 +15,10 @@ lib/ludy/array/combos.rb
15
15
  lib/ludy/array/filter.rb
16
16
  lib/ludy/array/foldl.rb
17
17
  lib/ludy/array/foldr.rb
18
+ lib/ludy/array/map_with_index.rb
18
19
  lib/ludy/array/reverse_map.rb
19
20
  lib/ludy/array/rotate.rb
21
+ lib/ludy/array/tail.rb
20
22
  lib/ludy/blackhole.rb
21
23
  lib/ludy/class.rb
22
24
  lib/ludy/class/undef_all_methods.rb
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = ludy 0.1.0
1
+ = ludy 0.1.1
2
2
  by Lin Jen-Shin (a.k.a. godfat 真常)
3
3
  strip any number: 18god29fat7029 (at] godfat32 -dooot- 20org
4
4
  http://ludy.rubyforge.org
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ PROJ.description = paragraphs_of('README', 1).join("\n\n")
20
20
  PROJ.changes = paragraphs_of('CHANGES', 0..1).join("\n\n")
21
21
  PROJ.rubyforge_name = 'ludy'
22
22
 
23
- PROJ.version = '0.1.0'
23
+ PROJ.version = '0.1.1'
24
24
  PROJ.exclude << '.DS_Store' << '^tmp'
25
25
  PROJ.dependencies << 'rake'
26
26
 
@@ -0,0 +1,7 @@
1
+
2
+ class Array
3
+ def map_with_index
4
+ i = -1
5
+ map{ |e| i+=1; yield e, i; }
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+
2
+ class Array
3
+ def tail
4
+ self[1..-1]
5
+ end
6
+ end
@@ -35,6 +35,7 @@ module Ludy
35
35
  # else
36
36
  matcher = @matcher
37
37
  msg = @msg # make them close in the closure
38
+ # TODO: how to distinct that you want instance method or singleton method?
38
39
  define_method = @actor.kind_of?(Class) ? :define_method : :define_singleton_method
39
40
 
40
41
  # comment off &block in lambda for ruby 1.8 compatibility
@@ -1,6 +1,6 @@
1
1
 
2
2
  class Proc
3
- # TODO: missing traversal of chain
3
+ # TODO: missing traversal of chain
4
4
  # create a chain of proc. whenever you call the chain,
5
5
  # each proc would be called. the return value would be
6
6
  # all the results saved orderly in a array.
@@ -1,5 +1,7 @@
1
1
 
2
2
  require 'ludy/array/combos'
3
+ require 'ludy/array/map_with_index'
4
+ require 'ludy/array/tail'
3
5
 
4
6
  module Kernel
5
7
 
data/tasks/doc.rake CHANGED
@@ -24,6 +24,7 @@ namespace :doc do
24
24
  title = "#{PROJ.rubyforge_name}'s " + title if PROJ.rubyforge_name != title
25
25
 
26
26
  rd.options << "-t #{title}"
27
+ # FIXME: please add rdoc option to Rakefile, then i don't have to add this line.
27
28
  rd.options << '--charset=utf-8' << '--inline-source' << '--line-numbers'
28
29
  end
29
30
 
data/test/test_array.rb CHANGED
@@ -43,5 +43,11 @@ class TestArray < Test::Unit::TestCase
43
43
  assert_equal [[0,3],[0,4],[1,3],[1,4],[2,3],[2,4]], [[0,1,2],[3,4]].combos
44
44
  assert_equal [[0,2],[0,3],[0,4],[1,2],[1,3],[1,4]], [[0,1],[2,3,4]].combos
45
45
  end
46
+ def test_map_with_index
47
+ assert_equal [1,3,5], [1,2,3].map_with_index{|e,i|e+i}
48
+ end
49
+ def test_tail
50
+ assert_equal [2,3,4], [1,2,3,4].tail
51
+ end
46
52
  end
47
53
 
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Lin Jen-Shin (a.k.a. godfat \xE7\x9C\x9F\xE5\xB8\xB8)"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-09 00:00:00 +08:00
12
+ date: 2008-01-10 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -60,8 +60,10 @@ files:
60
60
  - lib/ludy/array/filter.rb
61
61
  - lib/ludy/array/foldl.rb
62
62
  - lib/ludy/array/foldr.rb
63
+ - lib/ludy/array/map_with_index.rb
63
64
  - lib/ludy/array/reverse_map.rb
64
65
  - lib/ludy/array/rotate.rb
66
+ - lib/ludy/array/tail.rb
65
67
  - lib/ludy/blackhole.rb
66
68
  - lib/ludy/class.rb
67
69
  - lib/ludy/class/undef_all_methods.rb