caboose-cms 0.7.43 → 0.7.44
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/caboose/version.rb +1 -1
- data/lib/tasks/caboose.rake +28 -0
- 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: ae08cf980f2a0aa96eef607230ebd65b94a32252
|
4
|
+
data.tar.gz: 18ba7683a23f59d5b5cb9bf29d23360f3c0172d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24ec1b8679c04d46979f1f35119c1640e8cc7ee2c808eddef22337c996b27b80d26fe667c572f6dbcb2efb8e197b6e2e1cfba97570e3dc5bdbcb11f9ba9ea077
|
7
|
+
data.tar.gz: 4e4fc8134b6a612e75c5c515331cf0a9c460ec1b0e6ba787104421641c69148ade9012562fb16ac9833f22804f59d7b5242ca869a2a161f3a732651c08fd1c59
|
data/lib/caboose/version.rb
CHANGED
data/lib/tasks/caboose.rake
CHANGED
@@ -386,6 +386,34 @@ namespace :assets do
|
|
386
386
|
end
|
387
387
|
end
|
388
388
|
end
|
389
|
+
|
390
|
+
desc "Create .gz versions of assets"
|
391
|
+
task :gzip => :environment do
|
392
|
+
zip_types = /\.(?:css|js)$/
|
393
|
+
public_assets = File.join(Rails.root, "public", Rails.application.config.assets.prefix)
|
394
|
+
|
395
|
+
Dir["#{public_assets}/**/*"].each do |f|
|
396
|
+
next unless f =~ zip_types
|
397
|
+
|
398
|
+
mtime = File.mtime(f)
|
399
|
+
gz_file = "#{f}.gz"
|
400
|
+
next if File.exist?(gz_file) && File.mtime(gz_file) >= mtime
|
401
|
+
|
402
|
+
File.open(gz_file, "wb") do |dest|
|
403
|
+
gz = Zlib::GzipWriter.new(dest, Zlib::BEST_COMPRESSION)
|
404
|
+
gz.mtime = mtime.to_i
|
405
|
+
IO.copy_stream(open(f), gz)
|
406
|
+
gz.close
|
407
|
+
end
|
408
|
+
|
409
|
+
File.utime(mtime, mtime, gz_file)
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
# Hook into existing assets:precompile task
|
414
|
+
Rake::Task["assets:precompile"].enhance do
|
415
|
+
Rake::Task["assets:gzip"].invoke
|
416
|
+
end
|
389
417
|
|
390
418
|
desc "Fix variant sort order"
|
391
419
|
task :set_variant_sort_order => :environment do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.44
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|