wedge 0.1.47 → 0.1.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wedge.rb +3 -2
- data/lib/wedge/config.rb +1 -0
- data/lib/wedge/opal.rb +9 -5
- data/lib/wedge/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46bbe594dc4d34672258a28ab0354d08bbabdf77
|
4
|
+
data.tar.gz: 2af71b55df8e94b85ccca4d888edcfb9951c6163
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75e9f523a17a824c275005a8d4abd361ef30e60b888072dee3bce60b5fdba9668ea873c162089b8591445573acbec541b12093f058a9679d60eff143791709f1
|
7
|
+
data.tar.gz: fc6b5ad205d0bd782a03eaef9a329eefd67845bcefe0bd0d187f59af81c2a7685956fde6393601c0a382e20287356fbd305281b0d2d13e4789796196adb3170c
|
data/lib/wedge.rb
CHANGED
@@ -47,10 +47,11 @@ class Wedge
|
|
47
47
|
end
|
48
48
|
|
49
49
|
Wedge.config.opal = { server: Wedge::Opal::Server.new { |s|
|
50
|
-
s.prefix = Wedge.assets_url
|
51
|
-
s.debug = Wedge.config.debug
|
52
50
|
s.append_path "#{Dir.pwd}/#{Wedge.config.app_dir}"
|
51
|
+
s.prefix = Wedge.assets_url
|
52
|
+
s.debug = Wedge.config.debug
|
53
53
|
s.headers = Wedge.config.assets_headers
|
54
|
+
s.gzip = Wedge.config.gzip_headers
|
54
55
|
}}
|
55
56
|
|
56
57
|
if Wedge.config.debug
|
data/lib/wedge/config.rb
CHANGED
data/lib/wedge/opal.rb
CHANGED
@@ -72,7 +72,7 @@ unless RUBY_ENGINE == 'opal'
|
|
72
72
|
end
|
73
73
|
|
74
74
|
class Server
|
75
|
-
attr_accessor :headers
|
75
|
+
attr_accessor :headers, :gzip
|
76
76
|
|
77
77
|
def initialize debug_or_options = {}
|
78
78
|
unless Hash === debug_or_options
|
@@ -84,6 +84,7 @@ unless RUBY_ENGINE == 'opal'
|
|
84
84
|
end
|
85
85
|
|
86
86
|
@headers = {}
|
87
|
+
@gzip = false
|
87
88
|
@use_index = true
|
88
89
|
@public_root = nil
|
89
90
|
@public_urls = ['/']
|
@@ -97,10 +98,6 @@ unless RUBY_ENGINE == 'opal'
|
|
97
98
|
create_app
|
98
99
|
end
|
99
100
|
|
100
|
-
def headers
|
101
|
-
@headers
|
102
|
-
end
|
103
|
-
|
104
101
|
def create_app
|
105
102
|
server, sprockets, prefix, headers = self, @sprockets, self.prefix, @headers
|
106
103
|
sprockets.logger.level ||= Logger::DEBUG
|
@@ -142,6 +139,13 @@ unless RUBY_ENGINE == 'opal'
|
|
142
139
|
|
143
140
|
if env['PATH_INFO'][@server.prefix]
|
144
141
|
status, headers, body = @app.call env
|
142
|
+
|
143
|
+
if server.gzip
|
144
|
+
require 'zlib'
|
145
|
+
Zlib::GzipWriter.open("#{path}.gz") do |gz|
|
146
|
+
body = gz.write(content)
|
147
|
+
end
|
148
|
+
end
|
145
149
|
[status, headers.merge(@server.headers), [body]]
|
146
150
|
else
|
147
151
|
@app.call env
|
data/lib/wedge/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wedge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.48
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|