syntropy 0.44.0 → 0.46.0
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 +4 -4
- data/CHANGELOG.md +9 -0
- data/cmd/serve.rb +5 -1
- data/lib/syntropy/controller_extensions.rb +7 -3
- data/lib/syntropy/http/server_connection.rb +11 -0
- data/lib/syntropy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df919d19da5de1a1f8a1ed198aaf7de1cbd1497827425275f28e8f1e2644cadf
|
|
4
|
+
data.tar.gz: d89d935fe3ccb8246b1686215ca29749ec5e21b4712e62ee2675ab3e8bf7f0ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d94dae96c9e743234a3830305920c1fad451ba851496eca1689ce61e12f6823f93d67c2b93137d9153698397080335d60839f6476eccaff117ccf63a19e09c2d
|
|
7
|
+
data.tar.gz: c35da5de968bd444ccefd165cb065ec51d86f674a283ef85d1083a6137a11d264e0e7a2e4b1e65ee91c2e77d009aeeb3f46bf0ceff47482cd35aa593ff0dd482
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
# 0.46.0 2026-11-09
|
|
2
|
+
|
|
3
|
+
- Add `--hot-reload`/`-H` option to `syntropy serve` for hot reloading in production mode
|
|
4
|
+
- Fix `dispatch_by_host` to not create multiple instances of same app
|
|
5
|
+
|
|
6
|
+
# 0.45.0 2026-11-08
|
|
7
|
+
|
|
8
|
+
- Add `ServerConnection.count` method
|
|
9
|
+
|
|
1
10
|
# 0.44.0 2026-11-05
|
|
2
11
|
|
|
3
12
|
- Rename `Request#json_pretty_response` to `Request#respond_json_pretty`
|
data/cmd/serve.rb
CHANGED
|
@@ -51,6 +51,10 @@ parser = OptionParser.new do |o|
|
|
|
51
51
|
env[:server_extensions] = nil
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
+
o.on('-H', '--hot-reload', 'Hot-reload changed files') do
|
|
55
|
+
env[:watch_files] = true
|
|
56
|
+
end
|
|
57
|
+
|
|
54
58
|
o.on('-s', '--silent', 'Silent mode') do
|
|
55
59
|
env[:banner] = nil
|
|
56
60
|
env[:logger] = nil
|
|
@@ -79,7 +83,7 @@ end
|
|
|
79
83
|
|
|
80
84
|
Syntropy.dev_mode = env[:mode] == 'development'
|
|
81
85
|
Syntropy.load_config(env)
|
|
82
|
-
env[:watch_files]
|
|
86
|
+
env[:watch_files] ||= Syntropy.dev_mode
|
|
83
87
|
|
|
84
88
|
if !File.directory?(env[:app_root])
|
|
85
89
|
puts "#{File.expand_path(env[:app_root])} Not a directory"
|
|
@@ -91,9 +91,13 @@ module Syntropy
|
|
|
91
91
|
def setup_mapped_sites(map, site_map)
|
|
92
92
|
app_root = @app ? @app.app_root : @env[:app_root]
|
|
93
93
|
map.each do |name, ref|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
if (app = site_map[ref])
|
|
95
|
+
site_map[name] = app
|
|
96
|
+
else
|
|
97
|
+
ref = File.join(File.dirname(@ref), ref) if ref !~ /^\//
|
|
98
|
+
site_root = File.join(app_root, ref)
|
|
99
|
+
site_map[name] = make_app(site_root)
|
|
100
|
+
end
|
|
97
101
|
end
|
|
98
102
|
end
|
|
99
103
|
|
|
@@ -13,6 +13,15 @@ module Syntropy
|
|
|
13
13
|
class ServerConnection
|
|
14
14
|
attr_reader :fd, :io, :response_headers, :logger
|
|
15
15
|
|
|
16
|
+
@@connection_count = 0
|
|
17
|
+
|
|
18
|
+
# Returns the number of current connections
|
|
19
|
+
#
|
|
20
|
+
# @return [Integer]
|
|
21
|
+
def self.count
|
|
22
|
+
@@connection_count
|
|
23
|
+
end
|
|
24
|
+
|
|
16
25
|
# Initializes a server connection.
|
|
17
26
|
#
|
|
18
27
|
# @param machine [UringMachine] machine instance
|
|
@@ -38,6 +47,7 @@ module Syntropy
|
|
|
38
47
|
#
|
|
39
48
|
# @return [void]
|
|
40
49
|
def run
|
|
50
|
+
@@connection_count += 1
|
|
41
51
|
loop do
|
|
42
52
|
persist = serve_request
|
|
43
53
|
break if !persist
|
|
@@ -54,6 +64,7 @@ module Syntropy
|
|
|
54
64
|
error: e
|
|
55
65
|
)
|
|
56
66
|
ensure
|
|
67
|
+
@@connection_count -= 1
|
|
57
68
|
@io.clear
|
|
58
69
|
@machine.close_async(@fd)
|
|
59
70
|
end
|
data/lib/syntropy/version.rb
CHANGED