bstard 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTk1NjBiMTg0MjFjMTNjM2IzMTEyNDNiYmRkMTZkNDFlMjY3OGQ2ZQ==
4
+ MTc5MTIxYjYyOGVkYWM2OTA0NzA0NzU3NWE5YTMyMGJiYjM2MmFkMA==
5
5
  data.tar.gz: !binary |-
6
- MTIyYzk5YjE1MmVjOTE5YjI5NzI0OWUyNmQ3OGFjMTA4MDUxYTQzOQ==
6
+ ZjEwNWEwZjZkMTNjMGIzNzhiMTVmN2RlYzQyMjQ0YmI1YWNjZjkxYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTk2YzFhZTEyYjdkNjM4Nzc4N2NmMTAyMDcwZjQ3MTQyNzM2MDI5ODY0ZTY5
10
- NjkyYjc1YjY0MzMyZWJiOTFmODc4MzQxMTRkNjE4Njg4YzgyY2RkMWFmM2Ix
11
- MGM0YWVmOWNhZTRjM2EyOGQyY2FmODEwMTcyNGY0MGYxZWJjOTY=
9
+ NDg0NzdiMTUxZTA5YjVlYjUwYzU2ZjkzNjg5ZWQ1ZDMyMjNlY2ZkMzBiYmIy
10
+ Mzk5NTkwOTgwYmEzZDhlMTA2NjBkMDkzODNmYThjMDE2YjJiZjE2YTM0YmMx
11
+ MGFhYTY1M2RlYWFjMDlmYzc1Mjg5MTkzZjljYTJhODI1YjA3ZjA=
12
12
  data.tar.gz: !binary |-
13
- MGM0NjE4YzU4MWU1ZDNiYTA3ZWI5YTZjMDZhMTQ0NzM5YjQ2ZjM1NTJiNDQ2
14
- MTE4ZmUzOGRjYmRhNWMzMDQ0OTQxZWQxNWRiYjc1ZGZiYmY2MzEwNjZjMTM1
15
- YjM3ODEwZThmMWI4MDBhYTQ4ODI2ZDZiYzRmYzFiZDA2NGM0OTY=
13
+ M2M1YTJhNDMzYjU4NjM0OWViZmQyMjhiNWVlYjE4NmIzMmFkNGFiZjhhNDBk
14
+ NDNjZDk5YzE1MzU0MDhiYTRlY2UzNmVlYWI1MjVkYWJiYzM4N2M4NWU3MjIy
15
+ MzI5Y2UwMGU4YTljMmE0NWJlNTY1ZjVmMTE5ZGY0ZTViNjgyZjk=
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
+ script: bundle exec rake test
data/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  A small state machine library with a simple interface. Designed around the concept of aggregation rather than inheritance enabling its use wherever you need it without the need to derive from it or mix it in.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/bstard.svg)](http://badge.fury.io/rb/bstard)
6
+ [![Build Status](https://travis-ci.org/tonyheadford/bstard.svg)](https://travis-ci.org/tonyheadford/bstard)
7
+
5
8
  ## Installation
6
9
 
7
10
  Add this line to your application's Gemfile:
@@ -52,7 +55,7 @@ The current state of the machine is accessed via the `current_state` method
52
55
  #=> :new
53
56
  ```
54
57
 
55
- Helper methods are automatically generated for each state consisting of the state name appended with a question mark. This method returns true is the current state matches the queried state or false otherwise.
58
+ Helper methods are automatically generated for each state consisting of the state name suffixed with a question mark. This method returns `true` if the current state matches the queried state or `false` otherwise.
56
59
 
57
60
  ``` ruby
58
61
  machine.new?
@@ -65,7 +68,7 @@ Helper methods are automatically generated for each state consisting of the stat
65
68
 
66
69
  ### Querying Transitions
67
70
 
68
- Helper methods are dynamically generated to enable querying whether an event is valid for the current state. These methods are named using the event name prefixed with 'can\_' and suffixed with a question mark.
71
+ Helper methods are dynamically generated to enable querying whether an event can transition the current state. These methods are named using the event name prefixed with 'can\_' and suffixed with a question mark.
69
72
 
70
73
  ```ruby
71
74
  machine.current_state
@@ -78,7 +81,7 @@ Helper methods are dynamically generated to enable querying whether an event is
78
81
 
79
82
  ### Triggering Events
80
83
 
81
- Trigger events by sending a message to the state machine using the event name suffixed with an exclamation mark.
84
+ Trigger events by sending a message using the event name suffixed with an exclamation mark.
82
85
 
83
86
  ```ruby
84
87
  machine.submit!
@@ -112,7 +115,7 @@ State change callbacks are configured with `when`
112
115
  end
113
116
  ```
114
117
 
115
- Use the symbol `:any` for event or state change callbacks that should by run when any event is triggered or after any state change.
118
+ Use the symbol `:any` for event or state change callbacks that should run when any event is triggered or after any state change.
116
119
 
117
120
  ``` ruby
118
121
  machine = Bstard.define do |fsm|
@@ -133,6 +136,7 @@ class MyModel < ActiveRecord::Base
133
136
  def make_draft
134
137
  # do stuff
135
138
  state.save!
139
+ save
136
140
  end
137
141
 
138
142
  private
data/bstard.gemspec CHANGED
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_development_dependency "bundler", "~> 1.8"
24
- spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "bundler"
24
+ spec.add_development_dependency "rake"
25
25
  spec.add_development_dependency "minitest"
26
26
  spec.add_development_dependency "minitest-reporters"
27
27
  end
@@ -1,4 +1,4 @@
1
1
  module Bstard
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bstard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Headford
@@ -14,30 +14,30 @@ dependencies:
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
- version: '1.8'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement