flammarion_rails 0.2.6 → 0.2.7

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: 04b73f7146f74804c6d8c228a3bf527cf30e9f49
4
- data.tar.gz: 4a1e0fa6ee1ccda4241a4e994cf785600517e6a0
3
+ metadata.gz: 3aa363f05db0c6968af7ac03b5f15da22460ba1b
4
+ data.tar.gz: 751151fe862bf39fcc73c23d6c8e713ff7e8bd0e
5
5
  SHA512:
6
- metadata.gz: 7f5d193bd4143545983c8284311f9a68cc9f52d7bafc3297ee1f2de1bbe7e57b3d28195634ba0c66bc6d08199e5b822e29a55a8f5a3cfc7026190fafcb219da2
7
- data.tar.gz: 54dd0df94e58ebddca039c5a1d879ac964ee27d74ad71dd5a6f983bcda262086bc911543289aa795f085766df3145029e657ff86a40816239b9744ee15a2fa2c
6
+ metadata.gz: 3689e410958d20f7f4eaeed8778d60e90ef21c90e46b0d494c91ede89c933e1327b394ec8a62e5587aeb5fc866dff41ab1369c974eedd9b86c54a6b5edd05720
7
+ data.tar.gz: 5db0e01f807778c4b4253210a83a69461fcf112d5c8d6556108dc62aca219c4a9ca51b0886efaaea99d9a5e3983ae4415dc4a0e4a6b91150a513387578fb1bd0
@@ -22,8 +22,8 @@ module Flammarion
22
22
 
23
23
  start_server
24
24
  @window_id = @@server.register_window(self)
25
- open_a_window(options) unless options[:no_window]
26
- wait_for_a_connection unless options[:no_wait]
25
+ open_a_window(options)
26
+ wait_for_a_connection(options)
27
27
  end
28
28
 
29
29
  # Blocks the current thread until the window has been closed. All user
@@ -112,10 +112,6 @@ module Flammarion
112
112
  end
113
113
 
114
114
  def render(body)
115
- if @sockets.empty?
116
- open_a_window
117
- wait_for_a_connection
118
- end
119
115
  if body.is_a? Hash
120
116
  body = body.to_json
121
117
  else
@@ -124,7 +120,6 @@ module Flammarion
124
120
  @sockets.each do |ws|
125
121
  ws.send_data(body, binary)
126
122
  end
127
- nil
128
123
  end
129
124
 
130
125
  def parse_nested_query(query)
@@ -20,8 +20,8 @@ module Flammarion
20
20
  raise SetupError.new("You must have google-chrome installed and accesible via your path.") unless @browser
21
21
  end
22
22
 
23
- def wait_for_a_connection
24
- Timeout.timeout(40) { sleep 0.5 while @sockets.empty? }
23
+ def wait_for_a_connection(options)
24
+ Timeout.timeout(options[:wait] || 20) { sleep 0.5 while @sockets.empty? }
25
25
  rescue Timeout::Error
26
26
  raise SetupError.new("Timed out while waiting for a connecting using #{@browser.name}.")
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module FlammarionRails
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flammarion_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrice Lebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-13 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails