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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c55f98a178c3f06947e9082106e0c8866945c68
4
- data.tar.gz: 5307f894bef758411e095ad00e8eb7bb7d976be3
3
+ metadata.gz: 46bbe594dc4d34672258a28ab0354d08bbabdf77
4
+ data.tar.gz: 2af71b55df8e94b85ccca4d888edcfb9951c6163
5
5
  SHA512:
6
- metadata.gz: c05a0d38a709d2708ffbdcdf65a6375b905cbc0b916880d9921054e94d69a75d64025d74b73344a84efe07cc9c65fc9f5a1a9f6d24ee93a53e55405b37f8475a
7
- data.tar.gz: f85c9afdc6328aa45f966585afe6b09a003dcbe9f95d7105ffca13db30f91abed295f1d0fdb463548a889ae92c810d210a5a282799ba93f2a9e61c1367190e1a
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
@@ -22,6 +22,7 @@ class Wedge
22
22
  assets_url: '/assets/wedge',
23
23
  assets_key: nil,
24
24
  assets_headers: {},
25
+ gzip_assets: false,
25
26
  cache_assets: false,
26
27
  is_plugin: false,
27
28
  compile_str: false,
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
@@ -1,3 +1,3 @@
1
1
  class Wedge
2
- VERSION = '0.1.47'
2
+ VERSION = '0.1.48'
3
3
  end
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.47
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-03 00:00:00.000000000 Z
11
+ date: 2015-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal