flojo 0.5.0 → 0.5.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.
- data/CHANGELOG +1 -0
- data/Manifest +0 -1
- data/README.rdoc +5 -3
- data/Rakefile +1 -1
- data/flojo.gemspec +3 -3
- data/lib/flojo.rb +7 -2
- data/test/test_db.sqlite3 +0 -0
- metadata +5 -5
data/CHANGELOG
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
0.5.1 Added workflow_states and transition parameter checks.
|
data/Manifest
CHANGED
data/README.rdoc
CHANGED
@@ -12,14 +12,16 @@
|
|
12
12
|
object.wf_current_state - Returns the objects current state.
|
13
13
|
|
14
14
|
To avoid method name collisions with your classes, Flojo methods are usually prefixed with "wf_".
|
15
|
+
The "wf_" is also handy when you need to interact with your objects in irb. Just type "wf_" and tab...
|
15
16
|
|
16
17
|
See test.rb, test_active_record.rb and test_helper.rb for concrete examples.
|
17
18
|
|
18
19
|
== Install
|
19
|
-
|
20
|
-
|
20
|
+
|
21
|
+
Install the gem with "gem install flojo".
|
22
|
+
Alternatively, download lib/flojo.rb.
|
21
23
|
If you are using rails, copy flojo.rb to your project's <b>lib</b> folder.
|
22
|
-
|
24
|
+
|
23
25
|
|
24
26
|
== Usage
|
25
27
|
|
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.
|
5
|
+
Echoe.new('flojo', '0.5.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,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{flojo}
|
5
|
-
s.version = "0.5.
|
5
|
+
s.version = "0.5.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-
|
9
|
+
s.date = %q{2010-12-11}
|
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"]
|
13
|
-
s.files = ["CHANGELOG", "MIT_LICENSE", "README.rdoc", "Rakefile", "
|
13
|
+
s.files = ["CHANGELOG", "MIT_LICENSE", "README.rdoc", "Rakefile", "lib/flojo.rb", "test/test_active_record.rb", "test/test_db.sqlite3", "test/test_helper.rb", "test/test_poro.rb", "Manifest", "flojo.gemspec"]
|
14
14
|
s.homepage = %q{http://github.com/alternegro/flojo}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Flojo", "--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
data/lib/flojo.rb
CHANGED
@@ -16,7 +16,12 @@ module Flojo
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.workflow_states(s)
|
19
|
-
@workflow_states = s.uniq
|
19
|
+
@workflow_states = s.uniq.compact
|
20
|
+
|
21
|
+
s.each do |st|
|
22
|
+
raise "Invalid Parameter. State array elements should be symbols" unless Symbol === st
|
23
|
+
end
|
24
|
+
|
20
25
|
self.synthesize_state_query_methods
|
21
26
|
end
|
22
27
|
|
@@ -29,7 +34,7 @@ module Flojo
|
|
29
34
|
end
|
30
35
|
|
31
36
|
def self.valid_state(*states)
|
32
|
-
states.each {|st| return false if !@workflow_states.include?(st) && (st != :any)}
|
37
|
+
states.each {|st| return false if (!@workflow_states.include?(st) && (st != :any)) || !(Symbol === st)}
|
33
38
|
return true
|
34
39
|
end
|
35
40
|
|
data/test/test_db.sqlite3
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flojo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 1
|
10
|
+
version: 0.5.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joey Adarkwah
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-11 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -34,13 +34,13 @@ files:
|
|
34
34
|
- MIT_LICENSE
|
35
35
|
- README.rdoc
|
36
36
|
- Rakefile
|
37
|
-
- flojo.gemspec
|
38
37
|
- lib/flojo.rb
|
39
38
|
- test/test_active_record.rb
|
40
39
|
- test/test_db.sqlite3
|
41
40
|
- test/test_helper.rb
|
42
41
|
- test/test_poro.rb
|
43
42
|
- Manifest
|
43
|
+
- flojo.gemspec
|
44
44
|
has_rdoc: true
|
45
45
|
homepage: http://github.com/alternegro/flojo
|
46
46
|
licenses: []
|