roda 3.89.0 → 3.90.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/lib/roda/plugins/common_logger.rb +4 -3
- data/lib/roda/plugins/middleware.rb +1 -3
- data/lib/roda/plugins/module_include.rb +1 -0
- data/lib/roda/plugins/sinatra_helpers.rb +1 -3
- data/lib/roda/plugins.rb +15 -0
- data/lib/roda/session_middleware.rb +1 -0
- data/lib/roda/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c42c5f4d45d0f7fe64602e9d2a32bec3c690606c98709f7bd0bde537dd7a6463
|
4
|
+
data.tar.gz: c5f4edfdf88244770bd0184220df443ea5183c017f11c7342b4192db158d8d6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19ccf7e44d75f36bc372f2dcad01bb9bf23831c12397d142ea94d1e5f10d0cfe1be3f62f8f45e584ab9e4d0510c8d6acba7dd13e5d9df0680dece3838a43f5a6
|
7
|
+
data.tar.gz: 48e7c8fc21d75df1adfb616fa5fa88c2b410b290168b2fa1b14ab2c53f8f33167e039f310007dc19831e0571c4ce2b2d34c023b8b88c07d4ff666afe4b426ce9
|
@@ -56,14 +56,15 @@ class Roda
|
|
56
56
|
|
57
57
|
env = @_request.env
|
58
58
|
|
59
|
-
line = "#{env['HTTP_X_FORWARDED_FOR'] || env["REMOTE_ADDR"] || "-"} - #{env["REMOTE_USER"] || "-"} [#{Time.now.strftime("%d/%b/%Y:%H:%M:%S %z")}] \"#{env["REQUEST_METHOD"]} #{env["SCRIPT_NAME"]}#{env["PATH_INFO"]}#{"?#{env["QUERY_STRING"]}" if ((qs = env["QUERY_STRING"]) && !qs.empty?)} #{@_request.http_version}\" #{status} #{((length = headers[RodaResponseHeaders::CONTENT_LENGTH]) && (length unless length == '0')) || '-'} #{elapsed_time}
|
59
|
+
line = "#{env['HTTP_X_FORWARDED_FOR'] || env["REMOTE_ADDR"] || "-"} - #{env["REMOTE_USER"] || "-"} [#{Time.now.strftime("%d/%b/%Y:%H:%M:%S %z")}] \"#{env["REQUEST_METHOD"]} #{env["SCRIPT_NAME"]}#{env["PATH_INFO"]}#{"?#{env["QUERY_STRING"]}" if ((qs = env["QUERY_STRING"]) && !qs.empty?)} #{@_request.http_version}\" #{status} #{((length = headers[RodaResponseHeaders::CONTENT_LENGTH]) && (length unless length == '0')) || '-'} #{elapsed_time} "
|
60
60
|
if MUTATE_LINE
|
61
|
-
line.gsub!(/[^[:print:]
|
61
|
+
line.gsub!(/[^[:print:]]/){|c| sprintf("\\x%x", c.ord)}
|
62
62
|
# :nocov:
|
63
63
|
else
|
64
|
-
line = line.gsub(/[^[:print:]
|
64
|
+
line = line.gsub(/[^[:print:]]/){|c| sprintf("\\x%x", c.ord)}
|
65
65
|
# :nocov:
|
66
66
|
end
|
67
|
+
line[-1] = "\n"
|
67
68
|
opts[:common_logger_meth].call(line)
|
68
69
|
end
|
69
70
|
|
@@ -134,9 +134,7 @@ class Roda
|
|
134
134
|
# and store +app+ as the next middleware to call.
|
135
135
|
def initialize(mid, app, *args, &block)
|
136
136
|
@mid = Class.new(mid)
|
137
|
-
#
|
138
|
-
@mid.set_temporary_name("#{mid.name}(middleware)") if mid.name && RUBY_VERSION >= "3.3"
|
139
|
-
# :nocov:
|
137
|
+
RodaPlugins.set_temp_name(@mid){"#{mid}::middleware_subclass"}
|
140
138
|
if @mid.opts[:middleware_next_if_not_found]
|
141
139
|
@mid.plugin(:not_found, &NEXT_PROC)
|
142
140
|
end
|
@@ -354,9 +354,7 @@ class Roda
|
|
354
354
|
res.status = opts[:status] || s
|
355
355
|
headers.delete(RodaResponseHeaders::CONTENT_LENGTH)
|
356
356
|
headers.replace(h.merge!(headers))
|
357
|
-
res.
|
358
|
-
|
359
|
-
halt
|
357
|
+
halt res.finish_with_body(b)
|
360
358
|
rescue Errno::ENOENT
|
361
359
|
not_found
|
362
360
|
end
|
data/lib/roda/plugins.rb
CHANGED
@@ -49,5 +49,20 @@ class Roda
|
|
49
49
|
end
|
50
50
|
# :nocov:
|
51
51
|
end
|
52
|
+
|
53
|
+
if RUBY_VERSION >= '3.3'
|
54
|
+
# Create a new module using the block, and set the temporary name
|
55
|
+
# on it using the given a containing module and name.
|
56
|
+
def self.set_temp_name(mod)
|
57
|
+
mod.set_temporary_name(yield)
|
58
|
+
mod
|
59
|
+
end
|
60
|
+
# :nocov:
|
61
|
+
else
|
62
|
+
def self.set_temp_name(mod)
|
63
|
+
mod
|
64
|
+
end
|
65
|
+
end
|
66
|
+
# :nocov:
|
52
67
|
end
|
53
68
|
end
|
@@ -159,6 +159,7 @@ class RodaSessionMiddleware
|
|
159
159
|
# Setup the middleware, passing +opts+ as the Roda sessions plugin options.
|
160
160
|
def initialize(app, opts)
|
161
161
|
mid = Class.new(Roda)
|
162
|
+
Roda::RodaPlugins.set_temp_name(mid){"RodaSessionMiddleware::_RodaSubclass"}
|
162
163
|
mid.plugin :sessions, opts
|
163
164
|
@req_class = mid::RodaRequest
|
164
165
|
@req_class.send(:include, RequestMethods)
|
data/lib/roda/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.90.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-03-11 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rack
|