state-notifier 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8ed956490ad32c8faecc84aee9bb8db94196a26
4
- data.tar.gz: 777a2ba40ff270a9382ff88f9c5dda5e87983296
3
+ metadata.gz: 60879f70445e58fda23bba385f6f363f78321d65
4
+ data.tar.gz: 42c05d12d55078e28194de8b6a71048ddc98509c
5
5
  SHA512:
6
- metadata.gz: b034c246058e029499738f24a93f370606c732eeea6ea25c5697f76a61e3227e511802f692dbd4e7d754ba1c3c60696b95861dd4d376e410cc1235077ea1eb8c
7
- data.tar.gz: 4db16ec677537145bbdfb47aae523139ad1171e2dae96e40a112e6aeb0a53cc7088e8325e78c54cea71b39f12f214d6d2b89bf6b580ac6110fc7ec349158429a
6
+ metadata.gz: faa8e1b270b662c0db0e34b8091fc62619694222c82386f611a7b428fe40c542908806a6d3bd85395afa49f5f59bf8b08123b224b1217dff3d33906c9d9ec221
7
+ data.tar.gz: 33f47dd3383487ae69c98a5289777bda9282e4bdbb851d610681caa7024d01bef7597e1b6cb0093eab596360e4d1efb4558f46d3d7683abe87fbe976990a33ce
data/README.md CHANGED
@@ -28,9 +28,14 @@ Or install it yourself as:
28
28
 
29
29
  For classes with a state machine the following calls are made:
30
30
 
31
- - `<event_name>`
32
- - `<target_state>` - only when its different from previous state
33
- - `<event_name>_<target_state>` - only when its different from previous state
31
+ `<event_name>` is notified every time.
32
+
33
+ Additionally, if the new state is different from the previous one, we also
34
+ get those 3 notifications:
35
+
36
+ - `state_changed`
37
+ - `<target_state>`
38
+ - `<event_name>_<target_state>`
34
39
 
35
40
  class Event
36
41
  belongs_to :provider, ...
@@ -1,5 +1,5 @@
1
1
  module State
2
2
  module Notifier
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -23,6 +23,7 @@ module State
23
23
  unless transition.to == transition.from
24
24
  notify_targets transition.to
25
25
  notify_targets "#{transition.event}_#{transition.to}"
26
+ notify_targets :state_changed
26
27
  end
27
28
  end
28
29
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state-notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Kushner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-19 00:00:00.000000000 Z
11
+ date: 2014-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler