flojo 0.5.1 → 0.5.1.1

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.
Files changed (5) hide show
  1. data/CHANGELOG +2 -1
  2. data/Rakefile +1 -1
  3. data/flojo.gemspec +3 -4
  4. data/lib/flojo.rb +2 -2
  5. metadata +6 -5
data/CHANGELOG CHANGED
@@ -1 +1,2 @@
1
- 0.5.1 Added workflow_states and transition parameter checks.
1
+ 0.5.1 Added workflow_states and transition parameter checks.
2
+ 0.5.1.1 Renamed valid_state method to valid_states?
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('flojo', '0.5.1') do |p|
5
+ Echoe.new('flojo', '0.5.1.1') do |p|
6
6
  p.description = "ActiveRecord aware workflow (state machine) module that will also work with any plain old ruby object."
7
7
  p.summary = "When used within an ActiveRecord subclass, flojo events can automatically save a record after a transition.
8
8
 
data/flojo.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{flojo}
5
- s.version = "0.5.1"
5
+ s.version = "0.5.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Joey Adarkwah"]
9
- s.date = %q{2010-12-11}
9
+ s.date = %q{2011-01-23}
10
10
  s.description = %q{ActiveRecord aware workflow (state machine) module that will also work with any plain old ruby object.}
11
11
  s.email = %q{alternegro @nospam@ me.com}
12
12
  s.extra_rdoc_files = ["CHANGELOG", "README.rdoc", "lib/flojo.rb"]
@@ -15,12 +15,11 @@ Gem::Specification.new do |s|
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Flojo", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{flojo}
18
- s.rubygems_version = %q{1.3.7}
18
+ s.rubygems_version = %q{1.4.1}
19
19
  s.summary = %q{When used within an ActiveRecord subclass, flojo events can automatically save a record after a transition. After including the module in your class and configuring it with an event _event_, and a state _state_, you can interact with instances of that class using the dynamically generated methods of the following form: +object.wf_event+ - Triggers event and invokes any applicable transitions +object.wf_event!+ - Behaves just like +object.wf_event+ but will also persist object. +object.wf_state?+ - Returns true if the current workflow state is _state_. +object.wf_current_state+ - Returns the objects current state.}
20
20
  s.test_files = ["test/test_active_record.rb", "test/test_helper.rb", "test/test_poro.rb"]
21
21
 
22
22
  if s.respond_to? :specification_version then
23
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
24
23
  s.specification_version = 3
25
24
 
26
25
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
data/lib/flojo.rb CHANGED
@@ -33,14 +33,14 @@ module Flojo
33
33
  @workflow_states.each {|st| define_method("wf_#{st}?") { st.eql?(wf_current_state)}}
34
34
  end
35
35
 
36
- def self.valid_state(*states)
36
+ def self.valid_states?(*states)
37
37
  states.each {|st| return false if (!@workflow_states.include?(st) && (st != :any)) || !(Symbol === st)}
38
38
  return true
39
39
  end
40
40
 
41
41
  end
42
42
 
43
- host.class_eval("def self.transition(start_state, end_state); raise 'Invalid Transition State' unless self.valid_state(start_state, end_state); @wf_current_event_transition_map[start_state]=end_state; end")
43
+ host.class_eval("def self.transition(start_state, end_state); raise 'Invalid Transition State' unless self.valid_states?(start_state, end_state); @wf_current_event_transition_map[start_state]=end_state; end")
44
44
 
45
45
  host.class_eval do
46
46
  def self.event(e, &actions)
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flojo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
5
- prerelease: false
4
+ hash: 97
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
9
  - 1
10
- version: 0.5.1
10
+ - 1
11
+ version: 0.5.1.1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Joey Adarkwah
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-12-11 00:00:00 -05:00
19
+ date: 2011-01-23 00:00:00 -05:00
19
20
  default_executable:
20
21
  dependencies: []
21
22
 
@@ -77,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
78
  requirements: []
78
79
 
79
80
  rubyforge_project: flojo
80
- rubygems_version: 1.3.7
81
+ rubygems_version: 1.4.1
81
82
  signing_key:
82
83
  specification_version: 3
83
84
  summary: "When used within an ActiveRecord subclass, flojo events can automatically save a record after a transition. After including the module in your class and configuring it with an event _event_, and a state _state_, you can interact with instances of that class using the dynamically generated methods of the following form: +object.wf_event+ - Triggers event and invokes any applicable transitions +object.wf_event!+ - Behaves just like +object.wf_event+ but will also persist object. +object.wf_state?+ - Returns true if the current workflow state is _state_. +object.wf_current_state+ - Returns the objects current state."