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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 083a5d3e4fe51a9892e41c1b4271ccb84b40ccbd
4
- data.tar.gz: fc65f387b0eb8c3828a318d6c2029097f726ca5b
3
+ metadata.gz: a7f96d17a5d2ade09642360b9c18dd0191c9062f
4
+ data.tar.gz: e6787b8bbbe74e54533dda229d6697a6aa20d9c7
5
5
  SHA512:
6
- metadata.gz: ae792a668041bb5e91b1881f5f0b19374a6387ffed4218e07433eef65b307ac94ad314e39b4db75ae75f625132492153710cc4e80c4a305fae15b65f8900337c
7
- data.tar.gz: 29f30a7734ae412e10dc1256e277db04d3f7d66e66ef70116bd69cde2f2d78e03134042b5df1aee695f1e7d6b1d7a4393ddfd4cb5357c64fdb15e8397c20afed
6
+ metadata.gz: 9cb477f120297c9a5ece5bae4acd5f31104e09e193b5c8ad2b2f8de27a38bfdf2f4fed831a93cba0399cc907307dc89673a49915206051686785eca8455f3587
7
+ data.tar.gz: dddc339931207cefbe3e6da05bb517c78d4830faa827b27de08c363d072c9e8d5758c9f91b8e051a201d5102a43927bbff576144dc7a3b1b635448f2bda3cb22
@@ -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
@@ -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
- # Iodine.info("`start_placebo` is called while using the Iodine server. `start_placebo` directive being ignored.")
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
- puts "* Plezi #{Plezi::VERSION} Services will start with no Server...\n"
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: self
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.
@@ -1,3 +1,3 @@
1
1
  module Plezi
2
- VERSION = "0.12.3"
2
+ VERSION = "0.12.4"
3
3
  end
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.3
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-30 00:00:00.000000000 Z
11
+ date: 2015-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iodine