capistrano-ops 1.0.0 → 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: '03096171fc878362361e6d4f5c525db4e28fc2acfe10f7b2dcb15852ed8e6b99'
4
- data.tar.gz: f50d51428cf175cff22f739373f5ce81e79982cfcb1e484323586fc181834aa8
3
+ metadata.gz: 11e337322ee460de5e0abca9879513190ccb1eaf57ebf338b5575efcd4f7eb33
4
+ data.tar.gz: 59f16b666897fdd8f93f21d0d7d91590e394fdfa4f9c942accb84be8720c94d7
5
5
  SHA512:
6
- metadata.gz: 0d32c02dfc012ed82cdbe2adf0a968d19eca1332661a1765158a1be92b12bd45e63755a0533a52b814b7d383a6124d436fd3d10b85907d262deb9207437d177e
7
- data.tar.gz: 404850e368cddef350bf54ea6b3e681fa123029fa2a0bc7dfb74786ebc16e5c948e8fec1d0e182bc5c99d83fa073d4c26e5b3a7d61d63a3cd272f5b4ea8ee474
6
+ metadata.gz: aafa5d8ed0745ac496462fb42840381dd3104478b77eac904b19b1959f94ea14d3d06fc7cccc62cbfa072aa0a7a36c945d49acd4eef6e23322a12a2e45b55247
7
+ data.tar.gz: b1c212fcf862c2635b9a079cf3c2eb72095b2f6a4c26d918dd971db550e7a2f5f2a55a27495042b66622a64931dab6059038bba66011dfa50bc82f4f532ddf80
data/README.md CHANGED
@@ -352,7 +352,7 @@ Once logrotate is installed, you can use the capistrano-ops tasks to manage it.
352
352
 
353
353
  ## Wkhtmltopdf Setup
354
354
 
355
- This script is used to setup `wkhtmltopdf-binary` in your deployment environment. It is designed to work with Capistrano.
355
+ This script is used to setup `wkhtmltopdf-binary` in your deployment environment for `WickedPdf`. It is designed to work with Capistrano.
356
356
 
357
357
  The main task `setup` is hooked to run after the `deploy:symlink:release` task.
358
358
  It performs the following operations:
@@ -368,6 +368,7 @@ for example:
368
368
  # config/initializers/wicked_pdf.rb
369
369
  WickedPdf.config = {
370
370
  exe_path: "#{Bundler.bundle_path}/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_ubuntu_18.04_amd64",
371
+ # Attention: set the used binary file version also in the Gemfile
371
372
  }
372
373
  ```
373
374
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Capistrano
4
4
  module Ops
5
- VERSION = '1.0.0'
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
@@ -15,5 +15,5 @@ module TaskLoader
15
15
  end
16
16
  end
17
17
 
18
- TaskLoader.load_tasks_if_gem_present('wicked-pdf', 'wkhtmltopdf/tasks',
18
+ TaskLoader.load_tasks_if_gem_present('wicked_pdf', 'wkhtmltopdf/tasks',
19
19
  'WARNING: Gemfile does not include wkhtmltopdf-binary gem which is required for wkhtmltopdf tasks')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Crusius
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-11 00:00:00.000000000 Z
11
+ date: 2024-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3