pdf_cover 0.1.2 → 0.1.3
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 +4 -4
- data/README.md +2 -1
- data/Rakefile +1 -0
- data/lib/paperclip/{pdf_cover.rb → pdf_cover_processor.rb} +1 -1
- data/lib/pdf_cover/version.rb +1 -1
- data/lib/pdf_cover.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 041bf2b0b4e8d17761d818adaa3cca98ea8dee87
|
4
|
+
data.tar.gz: 0feac95e45afb8f755c5a89627e68159043fab91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99b3463fccb8ecba16cf1343c18aae6f1a2554a40962a135ee05d1b5156547b375fc1bfb6c32bcdb98ef925a3595c5334594ed70f0bbe67f91ed113ecc6f9c75
|
7
|
+
data.tar.gz: dc3e1bc0fd69838228e004e5fab13db3108d0c2cac1c3c7ed76e36ae539072b5b90160f843159f8c5be28f0f9310d4b8db2700729a82f03aaa846169f42356b3
|
data/README.md
CHANGED
@@ -55,9 +55,10 @@ pdf to image feature.
|
|
55
55
|
After cloning this gem locally just run the `bin/setup` script to set everything
|
56
56
|
up. This will:
|
57
57
|
|
58
|
-
- Run `bundle` to install the development dependencies
|
58
|
+
- Run `bundle` to install the development dependencies.
|
59
59
|
- Initialize the database used by the `spec/dummy` rails application that
|
60
60
|
we use to test the ActiveRecord+(Paperclip|CarrierWave) integration.
|
61
|
+
- Generate JPEG files used in the specs.
|
61
62
|
|
62
63
|
## Running the specs
|
63
64
|
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ if Kernel.const_defined?(:Paperclip)
|
|
9
9
|
# @file the file that will be operated on (which is an instance of File)
|
10
10
|
# @options a hash of options that were defined in has_attached_file's style hash
|
11
11
|
# @attachment the Paperclip::Attachment itself
|
12
|
-
class
|
12
|
+
class PdfCoverProcessor < Processor
|
13
13
|
QUALITY_CONVERT_OPTION_REGEX = /-quality\s+(?<quality>\d+)/
|
14
14
|
RESOLUTION_CONVERT_OPTION_REGEX = /-density\s+(?<resolution>\d+)/
|
15
15
|
|
data/lib/pdf_cover/version.rb
CHANGED
data/lib/pdf_cover.rb
CHANGED
@@ -60,7 +60,7 @@ module PdfCover
|
|
60
60
|
# validates_attachment_content_type :pdf, content_type: %w(application/pdf)
|
61
61
|
# end
|
62
62
|
def pdf_cover_attachment(attachment_name, options = {})
|
63
|
-
options[:processors] = (options[:processors] || []).unshift(:
|
63
|
+
options[:processors] = (options[:processors] || []).unshift(:pdf_cover_processor)
|
64
64
|
|
65
65
|
has_attached_file attachment_name, options
|
66
66
|
end
|
@@ -72,6 +72,7 @@ module PdfCover
|
|
72
72
|
if carrierwave_defined?(base)
|
73
73
|
base.extend ClassMethods::CarrierWave
|
74
74
|
elsif paperclip_defined?
|
75
|
+
require "paperclip/pdf_cover_processor"
|
75
76
|
base.extend ClassMethods::Paperclip
|
76
77
|
else
|
77
78
|
fail "#{base} is not a CarrierWave::Uploader and Paperclip is not defined ¯\\_(ツ)_/¯"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdf_cover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan González
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -227,7 +227,7 @@ files:
|
|
227
227
|
- Rakefile
|
228
228
|
- bin/console
|
229
229
|
- bin/setup
|
230
|
-
- lib/paperclip/
|
230
|
+
- lib/paperclip/pdf_cover_processor.rb
|
231
231
|
- lib/pdf_cover.rb
|
232
232
|
- lib/pdf_cover/converter.rb
|
233
233
|
- lib/pdf_cover/version.rb
|