RubyGems
npm
Organizations
Log in
Sign up
RubyGems
can_has_fixtures
Versions diffs
0.1.2 → 0.1.3
can_has_fixtures 0.1.2 → 0.1.3
Sign up to get
free
protection for your applications and to get access to all the features.
Files changed (4)
hide
show
data/lib/can_has_fixtures/core_ext/fixnum.rb
+5
-1
data/lib/can_has_fixtures/core_ext/range.rb
+4
-0
data/lib/can_has_fixtures/version.rb
+1
-1
metadata
+1
-1
data/lib/can_has_fixtures/core_ext/fixnum.rb
CHANGED
Viewed
@@ -1,5 +1,9 @@
1
1
class Fixnum
2
-
def random
2
+
def random
(&block)
3
3
Random.chain(self)
4
4
end
5
+
6
+
def of(&block)
7
+
(1..self).to_a.collect(&block)
8
+
end
5
9
end
data/lib/can_has_fixtures/core_ext/range.rb
CHANGED
Viewed
@@ -2,4 +2,8 @@ class Range
2
2
def random
3
3
entries.random
4
4
end
5
+
6
+
def of(&block)
7
+
entries.random.of(&block)
8
+
end
5
9
end
data/lib/can_has_fixtures/version.rb
CHANGED
Viewed
@@ -1,3 +1,3 @@
1
1
module CanHasFixtures
2
-
VERSION = "0.1.
2
"
2
+
VERSION = "0.1.
3
"
3
3
end
metadata
CHANGED
Viewed
@@ -1,7 +1,7 @@
1
1
--- !ruby/object:Gem::Specification
2
2
name: can_has_fixtures
3
3
version: !ruby/object:Gem::Version
4
-
version: 0.1.
2
4
+
version: 0.1.
3
5
5
platform: ruby
6
6
authors: []
7
7