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 +4 -4
- data/lib/power_strip.rb +5 -2
- data/lib/power_strip/version.rb +1 -1
- data/opal/power_strip.rb +7 -3
- data/power_strip.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 693b603d16616b0027b8a3e7bca16d2dc3a18a8b80b6631374f3dd0cfa347d26
|
4
|
+
data.tar.gz: bbdcba8994a9aefaa90760ecb189f158c8f9251341a2c099b342ffeca540f125
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cc17fc6d0200d0597fa88c7647ae51ed62fbddfed25ba2a3f4b29add5b997a6c7cdf4063fc1b953d54a5bdbe18da721eb8278c8c8f795561b74d653d7a4e7a2
|
7
|
+
data.tar.gz: a4ec9862653d412cdc22b42281dc8636cefccddce89857e8da0941829b7f7689109c34f0df123bb36460613efd95707410cf7712c550f81b4349476899cb26d1
|
data/lib/power_strip.rb
CHANGED
@@ -53,6 +53,9 @@ begin
|
|
53
53
|
require 'opal'
|
54
54
|
Opal.append_path File.expand_path('../../opal', __FILE__)
|
55
55
|
rescue LoadError
|
56
|
-
|
57
|
-
|
56
|
+
begin
|
57
|
+
require 'sprockets'
|
58
|
+
Sprockets.append_path File.expand_path('../js', __FILE__)
|
59
|
+
rescue LoadError
|
60
|
+
end
|
58
61
|
end
|
data/lib/power_strip/version.rb
CHANGED
data/opal/power_strip.rb
CHANGED
@@ -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.
|
81
|
+
promise.reject exception
|
82
|
+
end
|
83
|
+
|
84
|
+
def close
|
85
|
+
@socket.close
|
82
86
|
end
|
83
87
|
end
|
84
88
|
|
data/power_strip.gemspec
CHANGED
@@ -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 "
|
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.
|
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-
|
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:
|
56
|
+
name: bowser
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
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:
|
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.
|
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
|