dc-notifier-animate 0.0.1 → 0.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c7e85f5abe5356616cd770b18d5e14c11870746
4
- data.tar.gz: d99049a5f0c1ae4f2e079068db6e1d5a01fb75d9
3
+ metadata.gz: 429badb25b93177ceccf8ba65a67d9184c6cfc57
4
+ data.tar.gz: 5ffa9d064e68e03d12e662e95c6f95268abe7fbb
5
5
  SHA512:
6
- metadata.gz: 88abf2f7cea1ed27cd201231675c53aa0a06819b4087e5cfbdd57add5341bce9ea90ae549ee093c2cf210f30bde4d133741373f2da995c67ab9ca02f9d4dd4d5
7
- data.tar.gz: a06620a9a91905d9f1d8107275d4bb90ef0a3c93db75c79292e4a3ae1b489693b07e9096d4ed4ad6011ee259c3bc1975ee60ba26aaa2b60eda08b5fdcdf961c5
6
+ metadata.gz: 848f2724f3300c1201b8a874c826cfae02f4046708160656fd0565397a3c35b571b079ae9dcd66ea744ba00d5abb652240be10e26824d2d9f985b5e621de11e1
7
+ data.tar.gz: 2c3efbf852ad2a25b6b3eeb01c0ed79953b0e3bdb4161ba3cd5e7777e2805b902c323d194bc39b32357f1e085e28eb93b234ea24a83878ac455e377b4067631d
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "dc-notifier-animate"
5
- spec.version = "0.0.1"
5
+ spec.version = "0.1.0"
6
6
  spec.authors = [ "Andy Palmer" ]
7
7
  spec.email = [ "andy@andypalmer.com" ]
8
8
  spec.description = "Threaded animations for the DreamCheeky Email Notifier"
@@ -4,16 +4,17 @@ require "eventmachine"
4
4
  module DreamCheeky
5
5
  class Notifier
6
6
  def breathe(colour, rate)
7
- @thread = Thread.new {
8
- EM.run {
9
- n=1
10
- direction=1
11
- EM::PeriodicTimer.new(rate/20.0) {
12
- self.colour colour.adjust_brightness (-n*10)
13
- direction = -direction if n == 0 || n == 10
14
- n += direction
15
- }
16
- }
7
+ unless EM.reactor_running?
8
+ Thread.new { EM.run }
9
+ sleep 1
10
+ end
11
+ @animate.cancel if !!@animate
12
+ n=1
13
+ direction=1
14
+ @animate = EM::PeriodicTimer.new(rate/20.0) {
15
+ self.colour colour.adjust_brightness (-n*10)
16
+ direction = -direction if n == 0 || n == 10
17
+ n += direction
17
18
  }
18
19
  end
19
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dc-notifier-animate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-14 00:00:00.000000000 Z
11
+ date: 2014-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dc-notifier