mojo_magick 0.5.7 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +25 -0
- data/.github/dependabot.yml +8 -0
- data/.rubocop-common.yml +99 -0
- data/.rubocop-performance.yml +2 -0
- data/.rubocop.yml +11 -0
- data/Gemfile +6 -1
- data/Gemfile.lock +48 -15
- data/README.md +40 -4
- data/Rakefile +15 -6
- data/examples/animated_gif.rb +11 -13
- data/examples/composite.rb +11 -13
- data/init.rb +1 -1
- data/lib/image_magick/fonts.rb +4 -11
- data/lib/mojo_magick.rb +93 -76
- data/lib/mojo_magick/command_status.rb +1 -1
- data/lib/mojo_magick/commands.rb +32 -0
- data/lib/mojo_magick/errors.rb +2 -0
- data/lib/mojo_magick/font.rb +1 -2
- data/lib/mojo_magick/opt_builder.rb +16 -27
- data/lib/mojo_magick/util/font_parser.rb +43 -0
- data/lib/mojo_magick/util/parser.rb +11 -56
- data/lib/mojo_magick/version.rb +1 -1
- data/mojo_magick.gemspec +19 -16
- data/test/fixtures/roll with it.jpg +0 -0
- data/test/{parser_test.rb → font_parser_test.rb} +7 -7
- data/test/font_test.rb +5 -5
- data/test/mojo_magick_test.rb +99 -88
- data/test/opt_builder_test.rb +99 -80
- data/test/test_helper.rb +7 -6
- metadata +47 -16
- data/lib/image_magick/resource_limits.rb +0 -91
- data/lib/initializers/hash.rb +0 -12
- data/test/fonts_test.rb +0 -11
- data/test/resource_limits_test.rb +0 -49
data/lib/initializers/hash.rb
DELETED
data/test/fonts_test.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'test_helper')
|
2
|
-
|
3
|
-
class FontsTest < MiniTest::Test
|
4
|
-
def test_get_fonts
|
5
|
-
fonts = MojoMagick.get_fonts
|
6
|
-
assert fonts.is_a? Array
|
7
|
-
assert fonts.length > 1
|
8
|
-
assert fonts.first.name
|
9
|
-
assert(fonts.first.name.is_a?(String))
|
10
|
-
end
|
11
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'test_helper')
|
2
|
-
|
3
|
-
class ResourceLimitsTest < MiniTest::Test
|
4
|
-
def setup
|
5
|
-
@orig_limits = MojoMagick.get_default_limits
|
6
|
-
end
|
7
|
-
|
8
|
-
def test_set_limits
|
9
|
-
# set area to 32mb limit
|
10
|
-
MojoMagick.set_limits(area: '32mb')
|
11
|
-
new_limits = MojoMagick.get_current_limits
|
12
|
-
assert_equal '32mb', new_limits[:area].downcase
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_get_limits
|
16
|
-
assert(@orig_limits.size >= 7)
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_resource_limits
|
20
|
-
orig_limits_test = @orig_limits.dup
|
21
|
-
orig_limits_test.delete_if do |resource, _value|
|
22
|
-
assert %i[throttle area map disk memory file thread time].include?(resource), "Found unexpected resource #{resource}"
|
23
|
-
true
|
24
|
-
end
|
25
|
-
assert_equal 0, orig_limits_test.size
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_get_current_limits
|
29
|
-
# remove limits on area
|
30
|
-
MojoMagick.remove_limits(:area)
|
31
|
-
new_limits = MojoMagick.get_current_limits
|
32
|
-
assert_equal @orig_limits[:area], new_limits[:area]
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_set_limits_again
|
36
|
-
# set memory to 64 mb, disk to 0 and
|
37
|
-
MojoMagick.set_limits(memory: '64mb', disk: '0b')
|
38
|
-
new_limits = MojoMagick.get_current_limits(show_actual_values: true)
|
39
|
-
assert_equal 61, new_limits[:memory]
|
40
|
-
assert_equal 0, new_limits[:disk]
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_unset_limits
|
44
|
-
# return to original/default limit values
|
45
|
-
MojoMagick.unset_limits
|
46
|
-
new_limits = MojoMagick.get_current_limits
|
47
|
-
assert_equal @orig_limits, new_limits
|
48
|
-
end
|
49
|
-
end
|