plezi 0.12.3 → 0.12.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/plezi/common/api.rb +4 -2
- data/lib/plezi/handlers/placebo.rb +2 -1
- data/lib/plezi/handlers/ws_object.rb +1 -1
- data/lib/plezi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7f96d17a5d2ade09642360b9c18dd0191c9062f
|
4
|
+
data.tar.gz: e6787b8bbbe74e54533dda229d6697a6aa20d9c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cb477f120297c9a5ece5bae4acd5f31104e09e193b5c8ad2b2f8de27a38bfdf2f4fed831a93cba0399cc907307dc89673a49915206051686785eca8455f3587
|
7
|
+
data.tar.gz: dddc339931207cefbe3e6da05bb517c78d4830faa827b27de08c363d072c9e8d5758c9f91b8e051a201d5102a43927bbff576144dc7a3b1b635448f2bda3cb22
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
#Change Log
|
2
2
|
|
3
|
+
|
4
|
+
***
|
5
|
+
|
6
|
+
Change log v.0.12.4
|
7
|
+
|
8
|
+
**Fix**: unicasting should be type agnostic.
|
9
|
+
|
10
|
+
**Update**: When using `Plezi.start_placebo`. The Placebo class will now allways have the websocket broadcasting capabilities, even if Placebo isn't initializes (if Plezi is runing) - allowing you to call `Plezi.start_placebo MyPlacebo` and `MyPlacebo.broadcast` from within the server application and having only the Placebo application react.
|
11
|
+
|
3
12
|
***
|
4
13
|
|
5
14
|
Change log v.0.12.3
|
data/lib/plezi/common/api.rb
CHANGED
@@ -65,12 +65,14 @@ module Plezi
|
|
65
65
|
def start_placebo receiver = nil
|
66
66
|
# force start Iodine only if Iodine isn't used as the server
|
67
67
|
if ::Iodine.protocol == ::Iodine::Http::Http1 && (defined?(::Rack) ? (::Rack::Handler.default == ::Iodine::Http::Rack) : true)
|
68
|
-
|
68
|
+
Iodine.log("* `start_placebo` Placebo directive ignored, as this seems to be the main application.\n")
|
69
|
+
# just initialize the receiver class (no instance) and return
|
70
|
+
Plezi::Placebo.new(receiver, false) if receiver
|
69
71
|
return false
|
70
72
|
end
|
71
73
|
unless @placebo_initialized
|
72
74
|
raise "Placebo fatal error: Redis connection failed to load - make sure gem is required and `ENV['PL_REDIS_URL']` is set." unless redis # make sure the redis connection is activated
|
73
|
-
|
75
|
+
Iodine.log "* Plezi #{Plezi::VERSION} Services will start with no Server - This is the Placebo application\n"
|
74
76
|
::Iodine.protocol = :no_server
|
75
77
|
Iodine.force_start!
|
76
78
|
@placebo_initialized = true
|
@@ -91,7 +91,7 @@ module Plezi
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
module_function
|
94
|
-
def new placebo_class
|
94
|
+
def new placebo_class, create = true
|
95
95
|
new_class_name = "PlaceboPlezi__#{placebo_class.name.gsub /[\:\-\#\<\>\{\}\(\)\s]/, '_'}"
|
96
96
|
new_class = nil
|
97
97
|
new_class = Module.const_get new_class_name if Module.const_defined? new_class_name
|
@@ -101,6 +101,7 @@ module Plezi
|
|
101
101
|
end
|
102
102
|
Object.const_set(new_class_name, new_class)
|
103
103
|
end
|
104
|
+
return new_class unless create
|
104
105
|
i, o = IO.pipe
|
105
106
|
req = {}
|
106
107
|
handler = new_class.new(i, o, req)
|
@@ -218,7 +218,7 @@ module Plezi
|
|
218
218
|
def unicast target_uuid, method_name, *args
|
219
219
|
raise 'No target specified for unicasting!' unless target_uuid
|
220
220
|
@@uuid_cutoff ||= Plezi::Settings.uuid.length
|
221
|
-
_inner_broadcast method: method_name, data: args, target: target_uuid[@@uuid_cutoff..-1], to_server: target_uuid[0...@@uuid_cutoff], type:
|
221
|
+
_inner_broadcast method: method_name, data: args, target: target_uuid[@@uuid_cutoff..-1], to_server: target_uuid[0...@@uuid_cutoff], type: :all
|
222
222
|
end
|
223
223
|
|
224
224
|
# Use this to multicast an event to ALL websocket connections on EVERY controller, including Placebo controllers.
|
data/lib/plezi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plezi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iodine
|