mini_magick 3.8.0 → 3.8.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of mini_magick might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/mini_magick.rb +12 -26
- data/lib/mini_magick/command_builder.rb +6 -22
- data/lib/mini_magick/image.rb +121 -102
- data/lib/mini_magick/utilities.rb +26 -0
- data/lib/mini_magick/version.rb +15 -1
- data/spec/files/actually_a_gif.jpg +0 -0
- data/spec/files/animation.gif +0 -0
- data/spec/files/composited.jpg +0 -0
- data/spec/files/erroneous.jpg +0 -0
- data/spec/files/layers.psd +0 -0
- data/spec/files/leaves (spaced).tiff +0 -0
- data/spec/files/not_an_image.php +1 -0
- data/spec/files/png.png +0 -0
- data/spec/files/simple-minus.gif +0 -0
- data/spec/files/simple.gif +0 -0
- data/spec/files/trogdor.jpg +0 -0
- data/spec/files/trogdor_capitalized.JPG +0 -0
- data/spec/lib/mini_magick/command_builder_spec.rb +153 -0
- data/spec/lib/mini_magick/image_spec.rb +499 -0
- data/spec/lib/mini_magick_spec.rb +63 -0
- data/spec/spec_helper.rb +29 -0
- metadata +40 -8
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MiniMagick do
|
4
|
+
context 'which util' do
|
5
|
+
it 'identifies when mogrify exists' do
|
6
|
+
expect(MiniMagick::Utilities.which('mogrify')).not_to be_nil
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'identifies when gm exists' do
|
10
|
+
expect(MiniMagick::Utilities.which('gm')).not_to be_nil
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'returns nil on nonexistent executables' do
|
14
|
+
expect(MiniMagick::Utilities.which('yogrify')).to be_nil
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context '.mogrify?' do
|
19
|
+
it 'returns true if minimagick is using mogrify' do
|
20
|
+
described_class.processor = :mogrify
|
21
|
+
expect(described_class.mogrify?).to eq true
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns false if minimagick is not using mogrify' do
|
25
|
+
described_class.processor = :gm
|
26
|
+
expect(described_class.mogrify?).to eq false
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'sets the processor if not set' do
|
30
|
+
described_class.processor = nil
|
31
|
+
described_class.mogrify?
|
32
|
+
expect(described_class.processor).to eq :mogrify
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context '.gm?' do
|
37
|
+
it 'returns true if minimagick is using gm' do
|
38
|
+
described_class.processor = :gm
|
39
|
+
expect(described_class).to be_gm
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'returns false if minimagick is not using gm' do
|
43
|
+
described_class.processor = :mogrify
|
44
|
+
expect(described_class).not_to be_gm
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'sets the processor if not set' do
|
48
|
+
described_class.processor = nil
|
49
|
+
described_class.gm?
|
50
|
+
expect(described_class.processor).to eq :mogrify
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'validation' do
|
55
|
+
it 'validates on create' do
|
56
|
+
expect(MiniMagick.validate_on_create).to eq(true)
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'validates on write' do
|
60
|
+
expect(MiniMagick.validate_on_write).to eq(true)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'rspec'
|
4
|
+
require 'mocha/api'
|
5
|
+
|
6
|
+
require 'mini_magick'
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.mock_framework = :mocha
|
10
|
+
config.color = true
|
11
|
+
config.formatter = 'documentation'
|
12
|
+
config.raise_errors_for_deprecations!
|
13
|
+
end
|
14
|
+
|
15
|
+
# Image files from testunit port to RSpec
|
16
|
+
test_files = File.expand_path(File.dirname(__FILE__) + '/files')
|
17
|
+
TEST_FILES_PATH = test_files
|
18
|
+
SIMPLE_IMAGE_PATH = test_files + '/simple.gif'
|
19
|
+
MINUS_IMAGE_PATH = test_files + '/simple-minus.gif'
|
20
|
+
TIFF_IMAGE_PATH = test_files + '/leaves (spaced).tiff'
|
21
|
+
NOT_AN_IMAGE_PATH = test_files + '/not_an_image.php'
|
22
|
+
GIF_WITH_JPG_EXT = test_files + '/actually_a_gif.jpg'
|
23
|
+
EXIF_IMAGE_PATH = test_files + '/trogdor.jpg'
|
24
|
+
CAP_EXT_PATH = test_files + '/trogdor_capitalized.JPG'
|
25
|
+
ANIMATION_PATH = test_files + '/animation.gif'
|
26
|
+
PNG_PATH = test_files + '/png.png'
|
27
|
+
COMP_IMAGE_PATH = test_files + '/composited.jpg'
|
28
|
+
ERRONEOUS_IMAGE_PATH = test_files + '/erroneous.jpg'
|
29
|
+
PSD_IMAGE_PATH = test_files + '/layers.psd'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_magick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Johnson
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-
|
15
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: subexec
|
@@ -60,16 +60,16 @@ dependencies:
|
|
60
60
|
name: rspec
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- - "
|
63
|
+
- - "~>"
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
65
|
+
version: 3.0.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- - "
|
70
|
+
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
72
|
+
version: 3.0.0
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: mocha
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,7 +84,7 @@ dependencies:
|
|
84
84
|
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
|
-
description:
|
87
|
+
description: Manipulate images with minimal use of memory via ImageMagick / GraphicsMagick
|
88
88
|
email:
|
89
89
|
- probablycorey@gmail.com
|
90
90
|
- hcatlin@gmail.com
|
@@ -104,6 +104,22 @@ files:
|
|
104
104
|
- lib/mini_magick/image.rb
|
105
105
|
- lib/mini_magick/utilities.rb
|
106
106
|
- lib/mini_magick/version.rb
|
107
|
+
- spec/files/actually_a_gif.jpg
|
108
|
+
- spec/files/animation.gif
|
109
|
+
- spec/files/composited.jpg
|
110
|
+
- spec/files/erroneous.jpg
|
111
|
+
- spec/files/layers.psd
|
112
|
+
- spec/files/leaves (spaced).tiff
|
113
|
+
- spec/files/not_an_image.php
|
114
|
+
- spec/files/png.png
|
115
|
+
- spec/files/simple-minus.gif
|
116
|
+
- spec/files/simple.gif
|
117
|
+
- spec/files/trogdor.jpg
|
118
|
+
- spec/files/trogdor_capitalized.JPG
|
119
|
+
- spec/lib/mini_magick/command_builder_spec.rb
|
120
|
+
- spec/lib/mini_magick/image_spec.rb
|
121
|
+
- spec/lib/mini_magick_spec.rb
|
122
|
+
- spec/spec_helper.rb
|
107
123
|
homepage: https://github.com/minimagick/minimagick
|
108
124
|
licenses:
|
109
125
|
- MIT
|
@@ -129,4 +145,20 @@ rubygems_version: 2.2.2
|
|
129
145
|
signing_key:
|
130
146
|
specification_version: 4
|
131
147
|
summary: Manipulate images with minimal use of memory via ImageMagick / GraphicsMagick
|
132
|
-
test_files:
|
148
|
+
test_files:
|
149
|
+
- spec/files/actually_a_gif.jpg
|
150
|
+
- spec/files/animation.gif
|
151
|
+
- spec/files/composited.jpg
|
152
|
+
- spec/files/erroneous.jpg
|
153
|
+
- spec/files/layers.psd
|
154
|
+
- spec/files/leaves (spaced).tiff
|
155
|
+
- spec/files/not_an_image.php
|
156
|
+
- spec/files/png.png
|
157
|
+
- spec/files/simple-minus.gif
|
158
|
+
- spec/files/simple.gif
|
159
|
+
- spec/files/trogdor.jpg
|
160
|
+
- spec/files/trogdor_capitalized.JPG
|
161
|
+
- spec/lib/mini_magick/command_builder_spec.rb
|
162
|
+
- spec/lib/mini_magick/image_spec.rb
|
163
|
+
- spec/lib/mini_magick_spec.rb
|
164
|
+
- spec/spec_helper.rb
|