yard 0.9.30 → 0.9.32
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.
Potentially problematic release.
This version of yard might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/yard/server/commands/static_file_helpers.rb +1 -2
- data/lib/yard/server/rack_adapter.rb +7 -11
- data/lib/yard/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: 3f605a509ca15a07baaa8f5c0055f6f09c3032f41d5d26e237101df6f35d1676
|
4
|
+
data.tar.gz: 18eb589b1e25e7ad9b17775c3b94ea865861e28ab802de1b6f4302e0f1d41ac7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 258b0fcdfc5d0ac3bf360cc7943374891d0eb456346814d33febc7c93f8c23290fcd7974819907c4a5238a26d2d201a3b59e9a9b95cbfe263b51e8b3079dc7e7
|
7
|
+
data.tar.gz: 724d0aca0dc5bdb5e167934dbe57eefad9211453d9ab20b992b4d18cebc2c7eaab8c8930f0f110d5e8d1f46a428b97e14b22115618ce747b0b5b8992f99a4874
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'webrick/httputils'
|
3
2
|
|
4
3
|
module YARD
|
5
4
|
module Server
|
@@ -7,7 +6,7 @@ module YARD
|
|
7
6
|
# Include this module to get access to {#static_template_file?}
|
8
7
|
# and {favicon?} helpers.
|
9
8
|
module StaticFileHelpers
|
10
|
-
include
|
9
|
+
include Server::HTTPUtils
|
11
10
|
|
12
11
|
# Serves an empty favicon.
|
13
12
|
# @raise [FinishRequest] finalizes an empty body if the path matches
|
@@ -12,16 +12,6 @@ module YARD
|
|
12
12
|
RackServer = Rack::Server
|
13
13
|
end
|
14
14
|
|
15
|
-
# Safely use refinements since Rack requires 2.4+
|
16
|
-
# @private
|
17
|
-
module RackRefinements
|
18
|
-
refine Rack::Request do
|
19
|
-
attr_accessor :version_supplied
|
20
|
-
alias query params
|
21
|
-
def xhr?; (env['HTTP_X_REQUESTED_WITH'] || "").casecmp("xmlhttprequest") == 0 end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
15
|
# This class wraps the {RackAdapter} into a Rack-compatible middleware.
|
26
16
|
# See {#initialize} for a list of options to pass via Rack's +#use+ method.
|
27
17
|
#
|
@@ -61,7 +51,6 @@ module YARD
|
|
61
51
|
# A server adapter to respond to requests using the Rack server infrastructure.
|
62
52
|
class RackAdapter < Adapter
|
63
53
|
include YARD::Server::HTTPUtils
|
64
|
-
using RackRefinements
|
65
54
|
|
66
55
|
# Responds to Rack requests and builds a response with the {Router}.
|
67
56
|
# @return [Array(Numeric,Hash,Array)] the Rack-style response
|
@@ -99,3 +88,10 @@ module YARD
|
|
99
88
|
end
|
100
89
|
end
|
101
90
|
end
|
91
|
+
|
92
|
+
# @private
|
93
|
+
class Rack::Request
|
94
|
+
attr_accessor :version_supplied
|
95
|
+
alias query params
|
96
|
+
def xhr?; (env['HTTP_X_REQUESTED_WITH'] || "").casecmp("xmlhttprequest") == 0 end
|
97
|
+
end
|
data/lib/yard/version.rb
CHANGED