WeightedSelection 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +10 -0
- data/Rakefile +3 -2
- data/lib/weighted_selection.rb +2 -2
- metadata +22 -5
data/CHANGELOG
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
weightselect (1.0.1)
|
2
|
+
|
3
|
+
[ Blaine Cook ]
|
4
|
+
* don't use deprecated to_a to parse options
|
5
|
+
* add dependencies so that tests will pass for firebrigade
|
6
|
+
(http://firebrigade.seattlerb.org)
|
7
|
+
|
8
|
+
-- Blaine Cook <romeda@gmail.com> Wed, 31 Jan 2007 17:40:39 -0800
|
9
|
+
|
10
|
+
|
1
11
|
weightselect (1.0.0)
|
2
12
|
|
3
13
|
[ Blaine Cook ]
|
data/Rakefile
CHANGED
@@ -23,8 +23,10 @@ require 'rake/rdoctask'
|
|
23
23
|
require 'rcov/rcovtask'
|
24
24
|
|
25
25
|
spec = Gem::Specification.new do |s|
|
26
|
+
s.add_dependency "rake"
|
27
|
+
s.add_dependency "rcov"
|
26
28
|
s.name = "WeightedSelection"
|
27
|
-
s.version = "1.0.
|
29
|
+
s.version = "1.0.1"
|
28
30
|
s.author = "Blaine Cook"
|
29
31
|
s.email = "romeda@gmail.com"
|
30
32
|
s.homepage = "http://weightedselect.rubyforge.org/"
|
@@ -32,7 +34,6 @@ spec = Gem::Specification.new do |s|
|
|
32
34
|
s.summary = "A simple library for obtaining weighted randomized selections"
|
33
35
|
s.files = FileList["{test,lib}/**/*", '[A-Z]*'].exclude("rdoc", ".svn").to_a
|
34
36
|
s.require_path = "lib"
|
35
|
-
s.autorequire = "weighted_selection"
|
36
37
|
s.test_files = Dir.glob("test/test_*.rb")
|
37
38
|
s.has_rdoc = true
|
38
39
|
s.extra_rdoc_files = ["README", "COPYING"]
|
data/lib/weighted_selection.rb
CHANGED
@@ -89,8 +89,8 @@ class WeightedSelection
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def <<(options)
|
92
|
-
raise TypeError, "expected name-weight pairs" unless options.respond_to?(:
|
93
|
-
selections = options.
|
92
|
+
raise TypeError, "expected name-weight pairs" unless options.respond_to?(:find_all)
|
93
|
+
selections = options.find_all { |opt| opt.respond_to?(:collect) and opt.size == 2 }
|
94
94
|
@selections.concat( selections )
|
95
95
|
@modified = true
|
96
96
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: WeightedSelection
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date:
|
6
|
+
version: 1.0.1
|
7
|
+
date: 2007-01-31 00:00:00 -08:00
|
8
8
|
summary: A simple library for obtaining weighted randomized selections
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -12,7 +12,7 @@ email: romeda@gmail.com
|
|
12
12
|
homepage: http://weightedselect.rubyforge.org/
|
13
13
|
rubyforge_project: weightedselect
|
14
14
|
description:
|
15
|
-
autorequire:
|
15
|
+
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
18
18
|
has_rdoc: true
|
@@ -48,5 +48,22 @@ extensions: []
|
|
48
48
|
|
49
49
|
requirements: []
|
50
50
|
|
51
|
-
dependencies:
|
52
|
-
|
51
|
+
dependencies:
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: rake
|
54
|
+
version_requirement:
|
55
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.0.0
|
60
|
+
version:
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rcov
|
63
|
+
version_requirement:
|
64
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.0.0
|
69
|
+
version:
|