softwear-lib 2.1.4 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b957d5fb4f40c08589d75c8d1ab16f4b9085014
|
4
|
+
data.tar.gz: f5b7e611f9aa06f7df289604fb8ab337a8cb7386
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd18ab37690e9f95caa21928ec6aecce6a9e30c5a3e976465c834a0dc0571bf56316a735d82c9b24a1f0253e00f2e823d3c207c0c4ec4fbe559ce7d926878665
|
7
|
+
data.tar.gz: 60e22123c326ddae38b2a9f057411ef3c4df073babccf628049de97026da64364de44a2384366408422475ae02814aba5fc87f731dc2a7e2692e3e86ff3423d3
|
@@ -344,7 +344,7 @@ module Softwear
|
|
344
344
|
object
|
345
345
|
end
|
346
346
|
|
347
|
-
rescue JSON::ParserError =>
|
347
|
+
rescue JSON::ParserError => _e
|
348
348
|
Rails.logger.error "Bad user model JSON: ``` #{json} ```"
|
349
349
|
nil
|
350
350
|
end
|
@@ -401,9 +401,9 @@ module Softwear
|
|
401
401
|
def auth(token, app_name = nil)
|
402
402
|
response = validate_response query "auth #{app_name || Figaro.env.hub_app_name} #{token}"
|
403
403
|
|
404
|
-
return false unless response =~ /^yes
|
404
|
+
return false unless response =~ /^yes/
|
405
405
|
|
406
|
-
|
406
|
+
json = response.sub(/^yes/, '')
|
407
407
|
object = new(JSON.parse(json))
|
408
408
|
object.instance_variable_set(:@persisted, true)
|
409
409
|
object
|
@@ -16,8 +16,6 @@ def log(*a)
|
|
16
16
|
$stdout.puts(*a) unless Rails.env.test?
|
17
17
|
end
|
18
18
|
|
19
|
-
# TODO for production, we want to use the SSL server instead of straight up TCP.
|
20
|
-
|
21
19
|
# ==== Send Format: =======
|
22
20
|
# One line strings: "#{command} #{arg1} #{arg2} #{etc}"
|
23
21
|
# The last argument, depending on the command, may contain spaces (but usually does not need to)
|
@@ -55,6 +53,12 @@ def start_server!(*args)
|
|
55
53
|
|
56
54
|
loop do
|
57
55
|
Thread.start(server.accept) do |client|
|
56
|
+
begin
|
57
|
+
client.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
|
58
|
+
rescue Exception => e
|
59
|
+
puts "Couldn't set TCP_NODELAY"
|
60
|
+
end
|
61
|
+
|
58
62
|
client_count += 1
|
59
63
|
dev_log "New client! ##{client_count} #{address_of client}"
|
60
64
|
|
@@ -83,6 +87,7 @@ def start_server!(*args)
|
|
83
87
|
dev_log "<== #{line_in}"
|
84
88
|
ActiveRecord::Base.connection_pool.with_connection do
|
85
89
|
command.call(client, rest_of_command)
|
90
|
+
client.flush
|
86
91
|
end
|
87
92
|
end
|
88
93
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: softwear-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nigel Baillie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|