leap 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/leap.gemspec +2 -2
- data/lib/leap/decision.rb +1 -1
- data/test/helper.rb +3 -0
- data/test/test_leap.rb +10 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
data/leap.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
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.3"
|
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"]
|
12
|
-
s.date = %q{2010-07-
|
12
|
+
s.date = %q{2010-07-07}
|
13
13
|
s.description = %q{Leap to conclusions}
|
14
14
|
s.email = %q{andy@rossmeissl.net}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/leap/decision.rb
CHANGED
@@ -9,7 +9,7 @@ module Leap
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def make(characteristics, *considerations)
|
12
|
-
committees.reverse.inject(Deliberation.new(characteristics)) do |deliberation, committee|
|
12
|
+
committees.reject { |c| characteristics.keys.include? c.name }.reverse.inject(Deliberation.new(characteristics)) do |deliberation, committee|
|
13
13
|
if report = committee.report(deliberation.characteristics, considerations)
|
14
14
|
deliberation.reports.unshift report
|
15
15
|
deliberation.characteristics[committee.name] = report.conclusion
|
data/test/helper.rb
CHANGED
@@ -14,11 +14,13 @@ class Person
|
|
14
14
|
attr_reader :name
|
15
15
|
attr_reader :age
|
16
16
|
attr_reader :date_of_birth
|
17
|
+
attr_reader :magic_integer
|
17
18
|
|
18
19
|
def initialize(options = {})
|
19
20
|
@name = options[:name].upcase if options[:name] && options[:name].is_a?(String)
|
20
21
|
@age = options[:age].round if options[:age] && options[:age].is_a?(Numeric) && options[:age].round > 0
|
21
22
|
@date_of_birth = options[:date_of_birth] if options[:date_of_birth] && options[:date_of_birth].is_a?(Date)
|
23
|
+
@magic_integer = options[:magic_integer] if options[:magic_integer] && options[:magic_integer].is_a?(Integer)
|
22
24
|
end
|
23
25
|
|
24
26
|
include Characterizable
|
@@ -27,6 +29,7 @@ class Person
|
|
27
29
|
has :name
|
28
30
|
has :age
|
29
31
|
has :date_of_birth
|
32
|
+
has :magic_integer
|
30
33
|
end
|
31
34
|
|
32
35
|
include Leap
|
data/test/test_leap.rb
CHANGED
@@ -36,6 +36,16 @@ class TestLeap < Test::Unit::TestCase
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
context "A clever aged person" do
|
40
|
+
setup do
|
41
|
+
@person = Person.new :magic_integer => 42, :age => 5
|
42
|
+
end
|
43
|
+
|
44
|
+
should 'be able to use his own magic integer in determining his lucky number' do
|
45
|
+
assert_equal 1764, @person.lucky_number
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
39
49
|
context "A generic place" do
|
40
50
|
setup do
|
41
51
|
@place = Place.new
|
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
|
+
- 3
|
9
|
+
version: 0.3.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Andy Rossmeissl
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-07 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|