leap 0.4.2 → 0.4.3

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 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.11"
14
+ gem.add_development_dependency "characterizable", ">=0.0.11"
15
15
  gem.add_dependency 'blockenspiel', '>=0.3.2'
16
16
  gem.add_dependency 'activesupport', '>=3.0.0.beta2'
17
17
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{leap}
8
- s.version = "0.4.2"
8
+ s.version = "0.4.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-08-05}
12
+ s.date = %q{2010-08-12}
13
13
  s.description = %q{Leap to conclusions}
14
14
  s.email = %q{andy@rossmeissl.net}
15
15
  s.extra_rdoc_files = [
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "lib/leap/core_ext.rb",
30
30
  "lib/leap/decision.rb",
31
31
  "lib/leap/deliberation.rb",
32
+ "lib/leap/implicit_attributes.rb",
32
33
  "lib/leap/quorum.rb",
33
34
  "lib/leap/report.rb",
34
35
  "lib/leap/subject.rb",
@@ -51,7 +52,7 @@ Gem::Specification.new do |s|
51
52
 
52
53
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
53
54
  s.add_development_dependency(%q<shoulda>, [">= 0"])
54
- s.add_runtime_dependency(%q<characterizable>, [">= 0.0.11"])
55
+ s.add_development_dependency(%q<characterizable>, [">= 0.0.11"])
55
56
  s.add_runtime_dependency(%q<blockenspiel>, [">= 0.3.2"])
56
57
  s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0.beta2"])
57
58
  else
@@ -15,6 +15,7 @@ require 'leap/quorum'
15
15
  require 'leap/decision'
16
16
  require 'leap/report'
17
17
  require 'leap/deliberation'
18
+ require 'leap/implicit_attributes'
18
19
 
19
20
  module Leap
20
21
  def self.included(base)
@@ -4,7 +4,7 @@ module Leap
4
4
 
5
5
  def initialize(goal, options)
6
6
  @goal = goal
7
- @signature_method = options[:with]
7
+ @signature_method = options[:with] || :_leap_implicit_attributes
8
8
  @committees = []
9
9
  end
10
10
 
@@ -0,0 +1,7 @@
1
+ module Leap
2
+ module ImplicitAttributes
3
+ def _leap_implicit_attributes
4
+ Hash[*instance_variables.map { |variable| variable.delete('@').to_sym }.zip(instance_variables.map { |variable| instance_variable_get variable }).flatten]
5
+ end
6
+ end
7
+ end
@@ -3,6 +3,7 @@ module Leap
3
3
  def self.extended(base)
4
4
  base.instance_variable_set :@decisions, {}
5
5
  base.send :attr_reader, :deliberations
6
+ base.send :include, ::Leap::ImplicitAttributes
6
7
  end
7
8
  attr_reader :decisions
8
9
  def decide(goal, options = {}, &blk)
@@ -81,14 +81,8 @@ class Place
81
81
  @seasonality = options[:seasonality] if options[:seasonality]
82
82
  end
83
83
 
84
- include Characterizable
85
- characterize do
86
- has :name
87
- has :seasonality
88
- end
89
-
90
84
  include Leap
91
- decide :weather, :with => :characteristics do
85
+ decide :weather do
92
86
  committee :weather do
93
87
  quorum 'from seasonality', :needs => :seasonality do |characteristics, season|
94
88
  characteristics[:seasonality][season]
@@ -102,8 +96,7 @@ end
102
96
 
103
97
  class Thing
104
98
  include Leap
105
- def characteristics; {} end
106
- decide :anything, :with => :characteristics do
99
+ decide :anything do
107
100
  committee(:anything) {}
108
101
  end
109
102
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 2
9
- version: 0.4.2
8
+ - 3
9
+ version: 0.4.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-08-05 00:00:00 -05:00
18
+ date: 2010-08-12 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -42,7 +42,7 @@ dependencies:
42
42
  - 0
43
43
  - 11
44
44
  version: 0.0.11
45
- type: :runtime
45
+ type: :development
46
46
  version_requirements: *id002
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: blockenspiel
@@ -95,6 +95,7 @@ files:
95
95
  - lib/leap/core_ext.rb
96
96
  - lib/leap/decision.rb
97
97
  - lib/leap/deliberation.rb
98
+ - lib/leap/implicit_attributes.rb
98
99
  - lib/leap/quorum.rb
99
100
  - lib/leap/report.rb
100
101
  - lib/leap/subject.rb