capistrano-the-best-compression 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/tasks/compress.rake +14 -4
- data/lib/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 74f3233cd3fca0a093c569805226e69e6891175a0ccd1317ff9aedf55a77f8c6
|
|
4
|
+
data.tar.gz: 6450a84c473efcad02a4d8f89d448a29fcdf4f10b44865012416d43a018c4a83
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e42ab6d52058409be93a72f01dccd6ec7a7a813253ae19177c33cd6f2776e136ca722762d5a0fbce017bf8252fb94f681f7119c569da8dac2a70a34f9734a12
|
|
7
|
+
data.tar.gz: 64f35eb9836b901fd105b6aca5b7e4c7c9d14a9e86759ece48c71bbd0a09d5f1c2277d01026e4bcc00fbbeb746eb35d28c8b86d12494ec2c5a631d97fcb74984
|
data/lib/tasks/compress.rake
CHANGED
|
@@ -2,18 +2,28 @@ namespace :deploy do
|
|
|
2
2
|
desc 'Compress assets'
|
|
3
3
|
task :compress_assets, :names do |_, args|
|
|
4
4
|
on roles(:app) do
|
|
5
|
-
assets_path = release_path.join('public'
|
|
5
|
+
assets_path = release_path.join('public')
|
|
6
6
|
names = args[:names].is_a?(Array) && !(args[:names].empty?) ? args[:names] : %w(*.js *.css *.ico *.svg *.pdf)
|
|
7
7
|
names_args = "#{names.join('" -o -name "')}"
|
|
8
|
-
execute "
|
|
8
|
+
execute "mkdir -p #{ assets_path + '{assets,packs}' }"
|
|
9
|
+
execute "find -L #{assets_path + '{assets,packs}' } -type f \\( -name \"#{names_args}\" \\) -exec bash -c \"[ ! -f '{}.gz' ] && zopfli --gzip --i20 '{}'\" \\;"
|
|
9
10
|
end
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
desc 'Compress pngs'
|
|
13
14
|
task :compress_png do
|
|
14
15
|
on roles(:app) do
|
|
15
|
-
assets_path = release_path.join('public'
|
|
16
|
-
execute "
|
|
16
|
+
assets_path = release_path.join('public')
|
|
17
|
+
execute "mkdir -p #{ assets_path + '{assets,packs}' }"
|
|
18
|
+
execute "find -L #{assets_path + '{assets,packs}'} -type f \\( -name *.png \\) -not \\( -name 'zopflied_*.png' \\) -exec bash -c 'FULLPATH='{}'; FILENAME=${FULLPATH##*/}; BASEDIRECTORY=${FULLPATH%$FILENAME}; [ ! -f \"${BASEDIRECTORY}zopflied_${FILENAME}\" ] && zopflipng \"${FULLPATH}\" \"${BASEDIRECTORY}zopflied_${FILENAME}\" ' \\;"
|
|
17
19
|
end
|
|
18
20
|
end
|
|
21
|
+
|
|
22
|
+
desc 'Intall compressor hooks'
|
|
23
|
+
task :install_compressor_hooks do
|
|
24
|
+
before 'deploy:publishing', 'deploy:compress_assets'
|
|
25
|
+
before 'deploy:publishing', 'deploy:compress_png'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
before :starting, :install_compressor_hooks
|
|
19
29
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: capistrano-the-best-compression
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SumatoSoft
|
|
@@ -40,8 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
41
|
version: '0'
|
|
42
42
|
requirements: []
|
|
43
|
-
|
|
44
|
-
rubygems_version: 2.4.6
|
|
43
|
+
rubygems_version: 3.1.4
|
|
45
44
|
signing_key:
|
|
46
45
|
specification_version: 4
|
|
47
46
|
summary: Capistrano the Best Compression
|