ok-extensions 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,4 +19,10 @@ class Fixnum
19
19
  end
20
20
  end
21
21
  end
22
- end
22
+
23
+ def of(&block)
24
+ a = []
25
+ self.times { a << yield }
26
+ a
27
+ end
28
+ end
data/lib/ok_extensions.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class OkExtensions
2
- VERSION = '1.0.6'
2
+ VERSION = '1.0.7'
3
3
  end
4
4
 
5
5
  $LOAD_PATH << File.dirname(__FILE__)
@@ -34,4 +34,10 @@ class TestFixnum < Test::Unit::TestCase
34
34
  end
35
35
  assert_equal 1, i
36
36
  end
37
- end
37
+
38
+ def test_of
39
+ x = 0
40
+ a = 3.of { x += 1 }
41
+ assert_equal [1, 2, 3], a
42
+ end
43
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: ok-extensions
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.6
7
- date: 2007-12-11 00:00:00 +07:00
6
+ version: 1.0.7
7
+ date: 2007-12-23 00:00:00 +07:00
8
8
  summary: The author was too lazy to write a summary
9
9
  require_paths:
10
10
  - lib