leap 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
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.2.4"
8
+ s.version = "0.2.5"
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"]
data/lib/leap/decision.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Leap
2
2
  class Decision
3
- attr_reader :goal, :signature_method, :committees
3
+ attr_reader :goal, :signature_method, :committees, :minutes
4
4
 
5
5
  def initialize(goal, options)
6
6
  @goal = goal
@@ -14,7 +14,7 @@ module Leap
14
14
  characteristics[committee.name] = report
15
15
  end
16
16
  characteristics
17
- end[goal]
17
+ end
18
18
  end
19
19
 
20
20
  include ::Blockenspiel::DSL
data/lib/leap/subject.rb CHANGED
@@ -2,13 +2,15 @@ module Leap
2
2
  module Subject
3
3
  def self.extended(base)
4
4
  base.instance_variable_set :@decisions, {}
5
+ base.send :attr_reader, :minutes
5
6
  end
6
7
  attr_reader :decisions
7
8
  def decide(goal, options = {}, &blk)
8
9
  decisions[goal] = ::Leap::Decision.new goal, options
9
10
  Blockenspiel.invoke(blk, decisions[goal])
10
11
  define_method goal do |*considerations|
11
- self.class.decisions[goal].make send(self.class.decisions[goal].signature_method), *considerations
12
+ @minutes = self.class.decisions[goal].make(send(self.class.decisions[goal].signature_method), *considerations)
13
+ @minutes[goal]
12
14
  end
13
15
  end
14
16
  end
data/test/test_leap.rb CHANGED
@@ -19,6 +19,15 @@ class TestLeap < Test::Unit::TestCase
19
19
  should 'indeed have a lucky number' do
20
20
  assert_equal 36, @person.lucky_number
21
21
  end
22
+
23
+ should 'nevertheless remember how his lucky number was determined' do
24
+ @person.lucky_number # make the decision
25
+ assert_equal({ :magic_integer => 6, :lucky_number => 36, :age => 5}, @person.minutes)
26
+ end
27
+
28
+ should 'but only as long as it had actually been determined' do
29
+ assert_nil @person.minutes
30
+ end
22
31
  end
23
32
 
24
33
  context "A generic place" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 4
9
- version: 0.2.4
8
+ - 5
9
+ version: 0.2.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andy Rossmeissl