rubyist-aasm 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/aasm.rb +4 -5
  2. data/lib/event.rb +3 -3
  3. metadata +4 -4
data/lib/aasm.rb CHANGED
@@ -5,7 +5,7 @@ require File.join(File.dirname(__FILE__), 'persistence')
5
5
 
6
6
  module AASM
7
7
  def self.Version
8
- '2.0.5'
8
+ '2.0.6'
9
9
  end
10
10
 
11
11
  class InvalidTransition < RuntimeError
@@ -15,12 +15,11 @@ module AASM
15
15
  end
16
16
 
17
17
  def self.included(base) #:nodoc:
18
- # TODO - need to ensure that a machine is being created because
19
- # AASM was either included or arrived at via inheritance. It
20
- # cannot be both.
21
18
  base.extend AASM::ClassMethods
22
19
  AASM::Persistence.set_persistence(base)
23
- AASM::StateMachine[base] = AASM::StateMachine.new('')
20
+ unless AASM::StateMachine[base]
21
+ AASM::StateMachine[base] = AASM::StateMachine.new('')
22
+ end
24
23
  end
25
24
 
26
25
  module ClassMethods
data/lib/event.rb CHANGED
@@ -34,11 +34,11 @@ module AASM
34
34
 
35
35
  def execute_success_callback(obj)
36
36
  case success
37
- when String, Symbol:
37
+ when String, Symbol
38
38
  obj.send(success)
39
- when Array:
39
+ when Array
40
40
  success.each { |meth| obj.send(meth) }
41
- when Proc:
41
+ when Proc
42
42
  success.call(obj)
43
43
  end
44
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyist-aasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Barron
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-22 00:00:00 -08:00
12
+ date: 2009-05-16 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -37,10 +37,10 @@ files:
37
37
  - lib/state.rb
38
38
  - lib/state_machine.rb
39
39
  - lib/state_transition.rb
40
- - lib/version.rb
41
40
  - doc/jamis.rb
42
41
  has_rdoc: true
43
42
  homepage: http://github.com/rubyist/aasm
43
+ licenses:
44
44
  post_install_message:
45
45
  rdoc_options:
46
46
  - --line-numbers
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  requirements: []
67
67
 
68
68
  rubyforge_project:
69
- rubygems_version: 1.2.0
69
+ rubygems_version: 1.3.5
70
70
  signing_key:
71
71
  specification_version: 2
72
72
  summary: State machine mixin for Ruby objects