wedge 0.1.51 → 0.1.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wedge/middleware.rb +19 -1
- data/lib/wedge/opal.rb +0 -11
- data/lib/wedge/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: a70f7009ba5b2069a4d05afe8da0c7d534e4b23f
|
4
|
+
data.tar.gz: 9745f755aee6277fdb2162ce8f7e087415464048
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d763d59eebc9999b3b82c95b782630849c10e86a77dd6e41829c4d7618599cbdb91f78c9ce7994d5d2e0e40ea131cc9b00bb955c0ef6e1eed685d8d023d06a46
|
7
|
+
data.tar.gz: c1d981a77a58e63097403fbe58a82eb25340ea656ff55e9cec0518c497fc940b273aef022a06bceaa5738d9cd2e6dd20023271376b6176c7767aa6d3c16b9cdc
|
data/lib/wedge/middleware.rb
CHANGED
@@ -107,7 +107,25 @@ class Wedge
|
|
107
107
|
@opal[:sprockets].call e
|
108
108
|
end
|
109
109
|
else
|
110
|
-
@opal[:server].call env
|
110
|
+
status, headers, body = @opal[:server].call env
|
111
|
+
|
112
|
+
headers['Content-Type'] = 'application/javascript; charset=UTF-8'
|
113
|
+
|
114
|
+
if Wedge.config.gzip_assets
|
115
|
+
require 'zlib'
|
116
|
+
|
117
|
+
headers['Content-Encoding'] = 'gzip'
|
118
|
+
|
119
|
+
wio = StringIO.new("")
|
120
|
+
w_gz = Zlib::GzipWriter.new(wio)
|
121
|
+
w_gz.write(body.last.to_s)
|
122
|
+
w_gz.close
|
123
|
+
body = wio.string
|
124
|
+
|
125
|
+
headers['Content-Length'] = body.length.to_s
|
126
|
+
end
|
127
|
+
|
128
|
+
[status, headers, [body]]
|
111
129
|
end
|
112
130
|
end
|
113
131
|
else
|
data/lib/wedge/opal.rb
CHANGED
@@ -138,17 +138,6 @@ unless RUBY_ENGINE == 'opal'
|
|
138
138
|
if env['PATH_INFO'][@server.prefix]
|
139
139
|
status, headers, body = @app.call env
|
140
140
|
|
141
|
-
headers = {
|
142
|
-
'Content-Type' => 'application/javascript; charset=UTF-8'
|
143
|
-
}.merge headers
|
144
|
-
|
145
|
-
if server.gzip
|
146
|
-
require 'zlib'
|
147
|
-
|
148
|
-
headers['Content-Encoding'] = 'gzip'
|
149
|
-
body = Zlib::Deflate.deflate body
|
150
|
-
end
|
151
|
-
|
152
141
|
[status, headers.merge(@server.headers), [body]]
|
153
142
|
else
|
154
143
|
@app.call env
|
data/lib/wedge/version.rb
CHANGED