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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dab3266d8c95bbdef871f2dc1d8cc2ec5658e62a
4
- data.tar.gz: 278ff6700254daf5770925e589dc8958207cbe48
3
+ metadata.gz: ae08cf980f2a0aa96eef607230ebd65b94a32252
4
+ data.tar.gz: 18ba7683a23f59d5b5cb9bf29d23360f3c0172d4
5
5
  SHA512:
6
- metadata.gz: 92c6aec06acb45efbf1fe27ec7bde8dd476dcc28da9e5d7930b05dbc79d6aabb26f6e4a72d8832966919ea37ad4232e073f8b35c210165486a89685336486d1c
7
- data.tar.gz: ab7f88af93d1d150323e43fd6197305c95c92c6cbe35b0cdfb83c71852e0dd8429db63014d0842aaddc4c1febfb7f437ff4aed977a99323699424a1e2804dbbd
6
+ metadata.gz: 24ec1b8679c04d46979f1f35119c1640e8cc7ee2c808eddef22337c996b27b80d26fe667c572f6dbcb2efb8e197b6e2e1cfba97570e3dc5bdbcb11f9ba9ea077
7
+ data.tar.gz: 4e4fc8134b6a612e75c5c515331cf0a9c460ec1b0e6ba787104421641c69148ade9012562fb16ac9833f22804f59d7b5242ca869a2a161f3a732651c08fd1c59
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.7.43'
2
+ VERSION = '0.7.44'
3
3
  end
@@ -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.43
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-04 00:00:00.000000000 Z
11
+ date: 2016-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg