power_strip 0.3.0 → 1.0.0

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
  SHA256:
3
- metadata.gz: 653cf22671aa77f68902a8e7d90d08fd4e0c783f2c748f39f0af8f79ebfd225c
4
- data.tar.gz: 3937236883fe65bc62e6cc75f46944b82d0a0a05fbb68f9f4bfd555a03162dd5
3
+ metadata.gz: 693b603d16616b0027b8a3e7bca16d2dc3a18a8b80b6631374f3dd0cfa347d26
4
+ data.tar.gz: bbdcba8994a9aefaa90760ecb189f158c8f9251341a2c099b342ffeca540f125
5
5
  SHA512:
6
- metadata.gz: 1c0c35f302b3f82ad8a8008badf015e4a8b421082c7ffd37b52d91c75ff77e2460c8a680ae77047551129880e1dd56e01439fe78dc15c6c0071eb8b706d09449
7
- data.tar.gz: fe43d7691d6885a32064036383cd8e63d6edcfaec5c959df65a09f196354678f0e61b69667b5d9d1d1b6b679cf81a2ea2bc42ba4a6d07f666be673363ccb9d95
6
+ metadata.gz: 0cc17fc6d0200d0597fa88c7647ae51ed62fbddfed25ba2a3f4b29add5b997a6c7cdf4063fc1b953d54a5bdbe18da721eb8278c8c8f795561b74d653d7a4e7a2
7
+ data.tar.gz: a4ec9862653d412cdc22b42281dc8636cefccddce89857e8da0941829b7f7689109c34f0df123bb36460613efd95707410cf7712c550f81b4349476899cb26d1
@@ -53,6 +53,9 @@ begin
53
53
  require 'opal'
54
54
  Opal.append_path File.expand_path('../../opal', __FILE__)
55
55
  rescue LoadError
56
- require 'sprockets'
57
- Sprockets.append_path File.expand_path('../js', __FILE__)
56
+ begin
57
+ require 'sprockets'
58
+ Sprockets.append_path File.expand_path('../js', __FILE__)
59
+ rescue LoadError
60
+ end
58
61
  end
@@ -1,3 +1,3 @@
1
1
  module PowerStrip
2
- VERSION = "0.3.0"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  require 'bowser/websocket'
2
- require 'promise'
2
+ require 'bowser/promise'
3
3
 
4
4
  module PowerStrip
5
5
  class Client
@@ -63,7 +63,7 @@ module PowerStrip
63
63
  end
64
64
 
65
65
  def send_message channel=nil, event=nil, data=nil
66
- promise = Promise.new
66
+ promise = Bowser::Promise.new
67
67
 
68
68
  if @socket.connected?
69
69
  @socket.send_message({ channel: channel, event: event, data: data }
@@ -78,7 +78,11 @@ module PowerStrip
78
78
 
79
79
  promise
80
80
  rescue => exception
81
- promise.fail exception
81
+ promise.reject exception
82
+ end
83
+
84
+ def close
85
+ @socket.close
82
86
  end
83
87
  end
84
88
 
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.add_runtime_dependency "faye-websocket", "~> 0.10.4"
21
21
  spec.add_runtime_dependency "grand_central"
22
22
  spec.add_runtime_dependency "redis"
23
- spec.add_runtime_dependency "sprockets", "~> 3.6.0"
23
+ spec.add_runtime_dependency "bowser", "~> 1.0.2"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.12"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: power_strip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Gaskins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-21 00:00:00.000000000 Z
11
+ date: 2018-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faye-websocket
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: sprockets
56
+ name: bowser
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.6.0
61
+ version: 1.0.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 3.6.0
68
+ version: 1.0.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project:
155
- rubygems_version: 2.7.3
155
+ rubygems_version: 2.7.6
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Push data from server to client with Ruby