File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ def configure(&block)
112
112
config . assets . compile = true
113
113
config . assets . digest = true
114
114
config . assets . cache_limit = 50 . megabytes
115
+ config . assets . gzip = true
115
116
116
117
config . assets . configure do |env |
117
118
config . assets . paths . each { |path | env . append_path ( path ) }
@@ -144,6 +145,10 @@ def configure(&block)
144
145
env . version = config . assets . version
145
146
end
146
147
148
+ config . assets . configure do |env |
149
+ env . gzip = config . assets . gzip
150
+ end
151
+
147
152
rake_tasks do |app |
148
153
require 'sprockets/rails/task'
149
154
Sprockets ::Rails ::Task . new ( app )
Original file line number Diff line number Diff line change @@ -165,6 +165,23 @@ def test_custom_compressors
165
165
assert_equal compressor , env . css_compressor
166
166
end
167
167
168
+ def test_default_gzip_config
169
+ app . initialize!
170
+
171
+ assert env = app . assets
172
+ assert_equal true , env . gzip?
173
+ end
174
+
175
+ def test_gzip_config
176
+ app . configure do
177
+ config . assets . gzip = false
178
+ end
179
+ app . initialize!
180
+
181
+ assert env = app . assets
182
+ assert_equal false , env . gzip?
183
+ end
184
+
168
185
def test_version
169
186
app . configure do
170
187
config . assets . version = 'v2'
You can’t perform that action at this time.
0 commit comments