pdf_cover 0.1.2 → 0.1.3

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: 4844f04b68ea1b0c2649757bea3da227770c6638
4
- data.tar.gz: 8d808520c2eead74e4777c34b2c6157b341c9b50
3
+ metadata.gz: 041bf2b0b4e8d17761d818adaa3cca98ea8dee87
4
+ data.tar.gz: 0feac95e45afb8f755c5a89627e68159043fab91
5
5
  SHA512:
6
- metadata.gz: eb504ad4acb30488d133416c42f5203bcdeb8536b483afe67f0463c7736073c8e943141f9c6ddf30827780c3c32670aefc88e8df0decc7a76ca690d48c857088
7
- data.tar.gz: 79ee2d6d1a059256c9a100a90fdeae02e74e66e86c7246f39aed646ee1ff94b26fee72f0d3b4cc9820fc3ebad1afdb201ecfa7ff9fe5689c5ea14ca78ad3adce
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
@@ -6,6 +6,7 @@ ENV["RAILS_ENV"] ||= "test"
6
6
 
7
7
  RSpec::Core::RakeTask.new(:spec).tap do |rspec_task|
8
8
  rspec_task.rspec_opts = "--fail-fast"
9
+ rspec_task.rspec_opts += " --seed #{ENV['SEED']}" if ENV["SEED"]
9
10
  end
10
11
 
11
12
  RuboCop::RakeTask.new(:rubocop)
@@ -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 PdfCover < Processor
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
 
@@ -1,3 +1,3 @@
1
1
  module PdfCover
2
- VERSION = "0.1.2".freeze
2
+ VERSION = "0.1.3".freeze
3
3
  end
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(:pdf_cover)
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.2
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-01 00:00:00.000000000 Z
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/pdf_cover.rb
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