ruby_extendsions 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,6 +32,11 @@ module RubyExtendsions
32
32
  return b
33
33
  end
34
34
 
35
+ #Random return an Array item
36
+ def random
37
+ return self[rand(self.size)]
38
+ end
39
+
35
40
  end#InstanceMethods
36
41
 
37
42
  module ClassMethods
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "ruby_extendsions"
5
- s.version = "0.1.5"
5
+ s.version = "0.1.6"
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.authors = ["blackanger"]
8
8
  s.email = ["blackanger.z@gmail.com"]
@@ -12,7 +12,6 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.required_rubygems_version = ">= 1.3.6"
14
14
  s.rubyforge_project = "ruby_extendsions"
15
-
16
15
  s.add_development_dependency "bundler", ">= 1.0.0"
17
16
  s.add_development_dependency "rspec"
18
17
 
data/spec/array_spec.rb CHANGED
@@ -31,4 +31,10 @@ describe "RubyExtend::ArrayExtendsions" do
31
31
  @arr4.is_nil_all?.should eql false
32
32
  end
33
33
 
34
+ it "should can random return an Array item" do
35
+ require 'ruby_extendsions'
36
+ arr = [1,2,3,4,5,6,7,8]
37
+ arr.random.should be_a_kind_of(Fixnum)
38
+ end
39
+
34
40
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_extendsions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - blackanger
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-04 00:00:00 +08:00
18
+ date: 2011-01-07 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency