dragonfly 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of dragonfly might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/History.md +10 -0
- data/README.md +7 -1
- data/dragonfly.gemspec +1 -1
- data/lib/dragonfly/image_magick/processors/convert.rb +3 -1
- data/lib/dragonfly/model/attachment_class_methods.rb +3 -1
- data/lib/dragonfly/version.rb +1 -1
- data/samples/memo.pdf +0 -0
- data/spec/dragonfly/image_magick/processors/convert_spec.rb +9 -0
- data/spec/dragonfly/model/model_spec.rb +8 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13de1169904aec53779af0935d6a07ecd59fe6a5
|
4
|
+
data.tar.gz: c5f99e7f5de7a1a7b93cbd93246e9737651f2c45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4852dbed8e8ef2cf0fbfab4c6eb93f9036315ce8e83d581cd00c12fefefdf7fc4b7b0e87107391e8c2b8ddad26503b64ecd63d1267a0eacc3d50033abde29859
|
7
|
+
data.tar.gz: e4f00871e4aca9c56e424dec1ef41d77183b0d305eaae765ba199cd39ec04516b084ce421171c1aa91f546c59dbd1c5549d02456d6246925afc39fea537c8d12
|
data/History.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
1.0.10 (2015-05-14)
|
2
|
+
===================
|
3
|
+
Features
|
4
|
+
--------
|
5
|
+
- Allow method signified by symbol in storage_options to take an attachment object
|
6
|
+
- Allow passing in "input_args" to convert processor
|
7
|
+
Fixes
|
8
|
+
-----
|
9
|
+
- correct Rack version
|
10
|
+
|
1
11
|
1.0.9 (2015-04-29)
|
2
12
|
===================
|
3
13
|
Fixes
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ Installation
|
|
44
44
|
|
45
45
|
or in your Gemfile
|
46
46
|
```ruby
|
47
|
-
gem 'dragonfly', '~> 1.0.
|
47
|
+
gem 'dragonfly', '~> 1.0.10'
|
48
48
|
```
|
49
49
|
|
50
50
|
Require with
|
@@ -57,6 +57,12 @@ See [the Articles wiki](http://github.com/markevans/dragonfly/wiki/Articles) for
|
|
57
57
|
|
58
58
|
Please feel free to contribute!!
|
59
59
|
|
60
|
+
Examples
|
61
|
+
========
|
62
|
+
See [the Wiki](http://github.com/markevans/dragonfly/wiki) and see the pages list for examples.
|
63
|
+
|
64
|
+
Please feel free to contribute!!
|
65
|
+
|
60
66
|
Plugins / add-ons
|
61
67
|
=================
|
62
68
|
See [the Add-ons wiki](http://github.com/markevans/dragonfly/wiki/Dragonfly-add-ons).
|
data/dragonfly.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
"README.md"
|
22
22
|
]
|
23
23
|
|
24
|
-
spec.add_runtime_dependency("rack", [">= 0"])
|
24
|
+
spec.add_runtime_dependency("rack", [">= 1.3.0"])
|
25
25
|
spec.add_runtime_dependency("multi_json", ["~> 1.0"])
|
26
26
|
spec.add_runtime_dependency("addressable", ["~> 2.3"])
|
27
27
|
|
@@ -7,9 +7,11 @@ module Dragonfly
|
|
7
7
|
convert_command = content.env[:convert_command] || 'convert'
|
8
8
|
format = opts['format']
|
9
9
|
|
10
|
+
input_args = opts['input_args'] if opts['input_args']
|
10
11
|
frame_string = "[#{opts['frame']}]" if opts['frame']
|
12
|
+
|
11
13
|
content.shell_update :ext => format do |old_path, new_path|
|
12
|
-
"#{convert_command} #{old_path}#{frame_string} #{args} #{new_path}"
|
14
|
+
"#{convert_command} #{input_args} #{old_path}#{frame_string} #{args} #{new_path}"
|
13
15
|
end
|
14
16
|
|
15
17
|
if format
|
@@ -126,7 +126,9 @@ module Dragonfly
|
|
126
126
|
storage_options_specs.inject({}) do |opts, spec|
|
127
127
|
options = case spec
|
128
128
|
when Proc then model.instance_exec(attachment, &spec)
|
129
|
-
when Symbol
|
129
|
+
when Symbol
|
130
|
+
meth = model.method(spec)
|
131
|
+
(1 === meth.arity) ? meth.call(attachment) : meth.call
|
130
132
|
else spec
|
131
133
|
end
|
132
134
|
opts.merge!(options)
|
data/lib/dragonfly/version.rb
CHANGED
data/samples/memo.pdf
ADDED
Binary file
|
@@ -8,6 +8,7 @@ describe Dragonfly::ImageMagick::Processors::Convert do
|
|
8
8
|
|
9
9
|
let(:app){ test_app }
|
10
10
|
let(:image){ sample_content('beach.png') } # 280x355
|
11
|
+
let(:pdf){ sample_content('memo.pdf') }
|
11
12
|
let(:processor){ Dragonfly::ImageMagick::Processors::Convert.new }
|
12
13
|
|
13
14
|
it "should allow for general convert commands" do
|
@@ -53,4 +54,12 @@ describe Dragonfly::ImageMagick::Processors::Convert do
|
|
53
54
|
one_frame_size.should < all_frames_size
|
54
55
|
end
|
55
56
|
|
57
|
+
it "accepts input arguments for convert commands" do
|
58
|
+
pdf2 = pdf.clone
|
59
|
+
processor.call(pdf, '-scale 85x110', 'format' => 'png')
|
60
|
+
processor.call(pdf2, '-scale 85x110', 'format' => 'png', 'input_args' => '-density 150')
|
61
|
+
|
62
|
+
pdf.should_not equal_image(pdf2)
|
63
|
+
end
|
64
|
+
|
56
65
|
end
|
@@ -881,6 +881,14 @@ describe "models" do
|
|
881
881
|
item.save!
|
882
882
|
end
|
883
883
|
|
884
|
+
it 'should pass the attachment object if the method allows' do
|
885
|
+
set_storage_options :special_ops
|
886
|
+
item = @item_class.new :title => 'lump', :preview_image => 'hello'
|
887
|
+
def item.special_ops(a); {:egg => (a.data + title)}; end
|
888
|
+
@app.datastore.should_receive(:write).with(anything, hash_including(:egg => 'hellolump'))
|
889
|
+
item.save!
|
890
|
+
end
|
891
|
+
|
884
892
|
it "should allow setting more than once" do
|
885
893
|
@item_class.class_eval do
|
886
894
|
dragonfly_accessor :preview_image do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dragonfly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Evans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.3.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: multi_json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- samples/beach.png
|
180
180
|
- samples/egg.png
|
181
181
|
- samples/gif.gif
|
182
|
+
- samples/memo.pdf
|
182
183
|
- samples/round.gif
|
183
184
|
- samples/sample.docx
|
184
185
|
- samples/taj.jpg
|
@@ -267,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
268
|
version: '0'
|
268
269
|
requirements: []
|
269
270
|
rubyforge_project:
|
270
|
-
rubygems_version: 2.
|
271
|
+
rubygems_version: 2.4.6
|
271
272
|
signing_key:
|
272
273
|
specification_version: 4
|
273
274
|
summary: Ideal gem for handling attachments in Rails, Sinatra and Rack applications.
|