capistrano-ops 1.0.1 → 1.0.2

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
  SHA256:
3
- metadata.gz: 0ed2d908b8ec3ca6fc1c824ee868ac68ae9d22e123ee051fe45c27b6ad5ef8df
4
- data.tar.gz: ecd05a6efb4636281983d2a2a8ea61eff0ccd98181cbd49094a70212ee0b2d3d
3
+ metadata.gz: 11e337322ee460de5e0abca9879513190ccb1eaf57ebf338b5575efcd4f7eb33
4
+ data.tar.gz: 59f16b666897fdd8f93f21d0d7d91590e394fdfa4f9c942accb84be8720c94d7
5
5
  SHA512:
6
- metadata.gz: 229d0d86cdd193313cd869def5258f3dc8e694c6b75b3c260bdb63e0847fb3b5c102276be9c4795777bd3946ed93fb037d8d8cad97db6d5a4fbf43da5898a4de
7
- data.tar.gz: 9f2c4f1fed7e7388b538d9295310529aa60643516b4ac72dbe7ac052927d162b8230ebc55d5e976ea6f289b05415cfcc4a676a0d59d76f7a36374a0fa6768b61
6
+ metadata.gz: aafa5d8ed0745ac496462fb42840381dd3104478b77eac904b19b1959f94ea14d3d06fc7cccc62cbfa072aa0a7a36c945d49acd4eef6e23322a12a2e45b55247
7
+ data.tar.gz: b1c212fcf862c2635b9a079cf3c2eb72095b2f6a4c26d918dd971db550e7a2f5f2a55a27495042b66622a64931dab6059038bba66011dfa50bc82f4f532ddf80
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Capistrano
4
4
  module Ops
5
- VERSION = '1.0.1'
5
+ VERSION = '1.0.2'
6
6
  end
7
7
  end
@@ -2,48 +2,50 @@
2
2
 
3
3
  module Capistrano
4
4
  module Ops
5
- module Helper
6
- def binary_path
7
- gem_path = capture(:bundle, 'show', 'wkhtmltopdf-binary').strip
8
- "#{gem_path}/bin"
9
- end
5
+ module Wkhtmltopdf
6
+ module Helpers
7
+ def binary_path
8
+ gem_path = capture(:bundle, 'show', 'wkhtmltopdf-binary').strip
9
+ "#{gem_path}/bin"
10
+ end
10
11
 
11
- def gem_version
12
- capture(:cat, 'config/initializers/wicked_pdf.rb').scan(/wkhtmltopdf_ubuntu_(\d+\.\d+)_amd64/).flatten.first
13
- end
12
+ def gem_version
13
+ capture(:cat, 'config/initializers/wicked_pdf.rb').scan(/wkhtmltopdf_ubuntu_(\d+\.\d+)_amd64/).flatten.first
14
+ end
14
15
 
15
- def binary_path_and_version
16
- [binary_path, gem_version]
17
- end
16
+ def binary_path_and_version
17
+ [binary_path, gem_version]
18
+ end
18
19
 
19
- def file_existing?(file)
20
- test("[ -f #{file} ]")
21
- end
20
+ def file_existing?(file)
21
+ test("[ -f #{file} ]")
22
+ end
22
23
 
23
- def right_permissions?(file)
24
- test("[ $(stat -c '%a' #{file}) = '777' ]")
25
- end
24
+ def right_permissions?(file)
25
+ test("[ $(stat -c '%a' #{file}) = '777' ]")
26
+ end
26
27
 
27
- def check_file_and_permissions(binary_path, version)
28
- binary_file = "#{binary_path}/wkhtmltopdf_ubuntu_#{version}_amd64"
28
+ def check_file_and_permissions(binary_path, version)
29
+ binary_file = "#{binary_path}/wkhtmltopdf_ubuntu_#{version}_amd64"
29
30
 
30
- if file_existing?(binary_file)
31
- info('wkhtmltopdf binary already extracted')
31
+ if file_existing?(binary_file)
32
+ info('wkhtmltopdf binary already extracted')
32
33
 
33
- if right_permissions?(binary_file)
34
- info('wkhtmltopdf binary has already the right permissions')
34
+ if right_permissions?(binary_file)
35
+ info('wkhtmltopdf binary has already the right permissions')
36
+ else
37
+ info('adding right permissions to wkhtmltopdf binary')
38
+ execute("chmod 777 #{binary_file}")
39
+ end
35
40
  else
36
- info('adding right permissions to wkhtmltopdf binary')
41
+ info('extracting wkhtmltopdf binary')
42
+ # extract the binary but keep the gzip file
43
+ execute("cd #{binary_path} && gzip -dk wkhtmltopdf_ubuntu_#{version}_amd64.gz")
44
+ # add execute permission to the binary
37
45
  execute("chmod 777 #{binary_file}")
38
46
  end
39
- else
40
- info('extracting wkhtmltopdf binary')
41
- # extract the binary but keep the gzip file
42
- execute("cd #{binary_path} && gzip -dk wkhtmltopdf_ubuntu_#{version}_amd64.gz")
43
- # add execute permission to the binary
44
- execute("chmod 777 #{binary_file}")
47
+ info('wkhtmltopdf setup finished')
45
48
  end
46
- info('wkhtmltopdf setup finished')
47
49
  end
48
50
  end
49
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Crusius