mini_magick 4.2.1 → 4.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49b81b26769187774c378282a38bcdc9dfdacc8b
4
- data.tar.gz: cce11e45efbe18ab9a6a2d4d70d5d6ff4f2d02b4
3
+ metadata.gz: 8aceebe51bb1048d1c278bc2e62cc380d69478a1
4
+ data.tar.gz: 680cf6fbd416b7e6ad4eb6be6ac4c4511043c12d
5
5
  SHA512:
6
- metadata.gz: 665e1299b109c62778a9d75569e1fd3db842af8d1bd6c19bdf6026a325f9c971a52d6f6700d90bf3e748278c42cb25f03e1a1339cbf61890cf67c3e1112bc170
7
- data.tar.gz: 846180eb935c1209a479dcb3bfbb3960855b9fe10164ea01f747ede2f6604df01e35aad2afa29e706d1c7fa5a3c5d78ebf3fe7444cf8b8cce285e511ed79c96a
6
+ metadata.gz: 94248ff16bec98b38585bd742623e777d2b2019f5af568939d74829d104642f2cb2932a2eedf707e050360baf75b81ea77dc9729a5bd0c173237e84e025fd5c6
7
+ data.tar.gz: dcc5e762bafebbc6b44f6e1db27375ba139f09475f06a3ecc97b874b46c2927f123698e20a9aa2444e126125d9565220d5b580930217a99623251a3669045cda
@@ -36,8 +36,6 @@ module MiniMagick
36
36
  @info.clear
37
37
  end
38
38
 
39
- private
40
-
41
39
  def cheap_info(value)
42
40
  @info.fetch(value) do
43
41
  format, width, height, size = self["%m %w %h %b"].split(" ")
@@ -52,6 +50,8 @@ module MiniMagick
52
50
 
53
51
  @info.fetch(value)
54
52
  end
53
+ rescue ArgumentError, TypeError
54
+ raise MiniMagick::Invalid, "image data can't be read"
55
55
  end
56
56
 
57
57
  def colorspace
@@ -103,18 +103,15 @@ module MiniMagick
103
103
  details_string.each_line.with_object([]).inject({}) do |details_hash, (line, key_stack)|
104
104
  level = line[/^\s*/].length / 2 - 1
105
105
  next details_hash if level == -1 # we ignore the root level
106
+ key_stack.pop if level < key_stack.size
107
+
108
+ key, _, value = line.partition(/:[\s\n]/).map(&:strip)
106
109
  hash = key_stack.inject(details_hash) { |hash, key| hash.fetch(key) }
107
- key, value = line.split(":", 2).map(&:strip)
108
-
109
- if level == key_stack.size
110
- if value.empty?
111
- hash[key] = {}
112
- key_stack.push key
113
- else
114
- hash[key] = value
115
- end
116
- elsif level < key_stack.size
117
- key_stack.pop
110
+ if value.empty?
111
+ hash[key] = {}
112
+ key_stack.push key
113
+ else
114
+ hash[key] = value
118
115
  end
119
116
 
120
117
  details_hash
@@ -489,14 +489,12 @@ module MiniMagick
489
489
  end
490
490
  end
491
491
 
492
- private
493
-
494
492
  def mogrify(page = nil)
495
493
  @info.clear
496
494
 
497
495
  MiniMagick::Tool::Mogrify.new do |builder|
498
496
  builder.instance_eval do
499
- def format(*)
497
+ def format(*args)
500
498
  fail NoMethodError,
501
499
  "you must call #format on a MiniMagick::Image directly"
502
500
  end
@@ -23,8 +23,6 @@ module MiniMagick
23
23
  end
24
24
  end
25
25
 
26
- private
27
-
28
26
  def output(data)
29
27
  printf @io, "#{format}\n", data
30
28
  end
@@ -42,8 +42,6 @@ module MiniMagick
42
42
  ["", "executable not found: \"#{command.first}\"", 127]
43
43
  end
44
44
 
45
- private
46
-
47
45
  def execute_open3(*command)
48
46
  require "open3"
49
47
  Open3.capture3(*command)
@@ -184,8 +184,6 @@ module MiniMagick
184
184
  self << ")"
185
185
  end
186
186
 
187
- private
188
-
189
187
  ##
190
188
  # Dynamically generates modules with dynamically generated option methods
191
189
  # for each command-line tool. It uses the `-help` page of a command-line
@@ -9,7 +9,7 @@ module MiniMagick
9
9
  module VERSION
10
10
  MAJOR = 4
11
11
  MINOR = 2
12
- TINY = 1
12
+ TINY = 4
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
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: 4.2.1
4
+ version: 4.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Johnson
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2015-04-06 00:00:00.000000000 Z
16
+ date: 2015-05-11 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rake
@@ -118,4 +118,3 @@ signing_key:
118
118
  specification_version: 4
119
119
  summary: Manipulate images with minimal use of memory via ImageMagick / GraphicsMagick
120
120
  test_files: []
121
- has_rdoc: