leap 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/leap.gemspec +4 -4
- data/lib/leap/committee.rb +1 -1
- data/lib/leap/quorum.rb +4 -0
- data/test/helper.rb +6 -0
- data/test/test_leap.rb +6 -1
- metadata +4 -4
data/Rakefile
CHANGED
|
@@ -11,7 +11,7 @@ begin
|
|
|
11
11
|
gem.homepage = "http://github.com/rossmeissl/leap"
|
|
12
12
|
gem.authors = ["Andy Rossmeissl", "Seamus Abshere"]
|
|
13
13
|
gem.add_development_dependency "shoulda", ">= 0"
|
|
14
|
-
gem.add_dependency "characterizable", ">=0.0.
|
|
14
|
+
gem.add_dependency "characterizable", ">=0.0.10"
|
|
15
15
|
gem.add_dependency 'blockenspiel'
|
|
16
16
|
gem.add_dependency 'activesupport', '= 3.0.0.beta4'
|
|
17
17
|
end
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.2
|
data/leap.gemspec
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{leap}
|
|
8
|
-
s.version = "0.3.
|
|
8
|
+
s.version = "0.3.2"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Andy Rossmeissl", "Seamus Abshere"]
|
|
@@ -51,18 +51,18 @@ Gem::Specification.new do |s|
|
|
|
51
51
|
|
|
52
52
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
|
53
53
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
|
54
|
-
s.add_runtime_dependency(%q<characterizable>, [">= 0.0.
|
|
54
|
+
s.add_runtime_dependency(%q<characterizable>, [">= 0.0.10"])
|
|
55
55
|
s.add_runtime_dependency(%q<blockenspiel>, [">= 0"])
|
|
56
56
|
s.add_runtime_dependency(%q<activesupport>, ["= 3.0.0.beta4"])
|
|
57
57
|
else
|
|
58
58
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
|
59
|
-
s.add_dependency(%q<characterizable>, [">= 0.0.
|
|
59
|
+
s.add_dependency(%q<characterizable>, [">= 0.0.10"])
|
|
60
60
|
s.add_dependency(%q<blockenspiel>, [">= 0"])
|
|
61
61
|
s.add_dependency(%q<activesupport>, ["= 3.0.0.beta4"])
|
|
62
62
|
end
|
|
63
63
|
else
|
|
64
64
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
|
65
|
-
s.add_dependency(%q<characterizable>, [">= 0.0.
|
|
65
|
+
s.add_dependency(%q<characterizable>, [">= 0.0.10"])
|
|
66
66
|
s.add_dependency(%q<blockenspiel>, [">= 0"])
|
|
67
67
|
s.add_dependency(%q<activesupport>, ["= 3.0.0.beta4"])
|
|
68
68
|
end
|
data/lib/leap/committee.rb
CHANGED
|
@@ -10,7 +10,7 @@ module Leap
|
|
|
10
10
|
def report(characteristics, considerations)
|
|
11
11
|
quorums.grab do |quorum|
|
|
12
12
|
next unless quorum.satisfied_by? characteristics
|
|
13
|
-
if conclusion = quorum.acknowledge(characteristics, considerations.dup)
|
|
13
|
+
if conclusion = quorum.acknowledge(characteristics.slice(*quorum.characteristics), considerations.dup)
|
|
14
14
|
::Leap::Report.new self, quorum => conclusion
|
|
15
15
|
end
|
|
16
16
|
end
|
data/lib/leap/quorum.rb
CHANGED
data/test/helper.rb
CHANGED
|
@@ -60,6 +60,12 @@ class Person
|
|
|
60
60
|
('A'..'Z').to_a.index(characteristics[:name].chars.to_a.first) / ('A'..'Z').to_a.index(characteristics[:name].chars.to_a.last)
|
|
61
61
|
end
|
|
62
62
|
end
|
|
63
|
+
|
|
64
|
+
committee :litmus do
|
|
65
|
+
quorum 'litmus', :appreciates => :dummy do |characteristics|
|
|
66
|
+
characteristics
|
|
67
|
+
end
|
|
68
|
+
end
|
|
63
69
|
end
|
|
64
70
|
end
|
|
65
71
|
|
data/test/test_leap.rb
CHANGED
|
@@ -22,13 +22,18 @@ class TestLeap < Test::Unit::TestCase
|
|
|
22
22
|
|
|
23
23
|
should 'nevertheless remember how his lucky number was determined' do
|
|
24
24
|
@person.lucky_number # make the decision
|
|
25
|
-
assert_equal({ :magic_integer => 6, :lucky_number => 36, :age => 5}, @person.deliberations[:lucky_number].characteristics)
|
|
25
|
+
assert_equal({ :magic_integer => 6, :lucky_number => 36, :age => 5, :litmus => {}}, @person.deliberations[:lucky_number].characteristics)
|
|
26
26
|
assert_equal 'ninja style', @person.deliberations[:lucky_number].reports.find{ |r| r.committee.name == :magic_integer }.quorum.name
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
should 'but only as long as it had actually been determined' do
|
|
30
30
|
assert_nil @person.deliberations
|
|
31
31
|
end
|
|
32
|
+
|
|
33
|
+
should 'only give quorums what they ask for' do
|
|
34
|
+
@person.lucky_number # make the decision
|
|
35
|
+
assert_equal({}, @person.deliberations[:lucky_number].reports.find{ |r| r.committee.name == :litmus }.conclusion)
|
|
36
|
+
end
|
|
32
37
|
end
|
|
33
38
|
|
|
34
39
|
context "A generic place" do
|
metadata
CHANGED
|
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
|
5
5
|
segments:
|
|
6
6
|
- 0
|
|
7
7
|
- 3
|
|
8
|
-
-
|
|
9
|
-
version: 0.3.
|
|
8
|
+
- 2
|
|
9
|
+
version: 0.3.2
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Andy Rossmeissl
|
|
@@ -40,8 +40,8 @@ dependencies:
|
|
|
40
40
|
segments:
|
|
41
41
|
- 0
|
|
42
42
|
- 0
|
|
43
|
-
-
|
|
44
|
-
version: 0.0.
|
|
43
|
+
- 10
|
|
44
|
+
version: 0.0.10
|
|
45
45
|
type: :runtime
|
|
46
46
|
version_requirements: *id002
|
|
47
47
|
- !ruby/object:Gem::Dependency
|