admin_it 1.2.3 → 1.2.4
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/README.md +6 -0
- data/lib/admin_it/context/context.rb +0 -1
- data/lib/admin_it/middleware.rb +4 -2
- data/lib/admin_it/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ea45ae12dfa39a5eb46b774a61d8741b98b872d
|
4
|
+
data.tar.gz: 5972652948f50c990f2615ef7fc404f83778f6bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4f8cca2ab698cfe6e8a88ced8993407f2ff4ddde7a4c1c269a76d0aee53a0711ae581a06a27010387ac71c79e1c24821bbebaa0654d6a8ebac3d313b9adf6b8
|
7
|
+
data.tar.gz: c5c0034fafd30b62402ac69b96b6fa2b5c618d5908942408c35f10b2f7470a9b3cf953d5bbd3e97f6b26a7eed31ede9c2abae2ab0eb9f4c07691046cafd38e2d
|
data/README.md
CHANGED
data/lib/admin_it/middleware.rb
CHANGED
@@ -33,7 +33,7 @@ module AdminIt
|
|
33
33
|
|
34
34
|
# AdminIt middleware
|
35
35
|
class Middleware
|
36
|
-
SUBST_REGEXP = /<!--\s*([a-zA-Z0-9_]+)\s*-->/
|
36
|
+
SUBST_REGEXP = /<!--\s*(?<name>[a-zA-Z0-9_]+)\s*-->/
|
37
37
|
|
38
38
|
def initialize(app)
|
39
39
|
@app = app
|
@@ -43,10 +43,12 @@ module AdminIt
|
|
43
43
|
request = env[Request::ENV_KEY] = Request.new(env)
|
44
44
|
status, headers, body = @app.call(env)
|
45
45
|
if request.process?
|
46
|
+
length = 0
|
46
47
|
body.each do |str|
|
47
|
-
# $1 not working here ???
|
48
48
|
str.gsub!(SUBST_REGEXP) { |s| request[SUBST_REGEXP.match(s)[1]] }
|
49
|
+
length += str.size
|
49
50
|
end
|
51
|
+
headers['Content-Length'] = length.to_s
|
50
52
|
end
|
51
53
|
[status, headers, body]
|
52
54
|
end
|
data/lib/admin_it/version.rb
CHANGED