gruff 0.12.1 → 0.12.2

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
  SHA256:
3
- metadata.gz: d2c91b51c13f0a433ce00a02ab66606bea2c0bb091391c47f68c2ba4ba1e0866
4
- data.tar.gz: 229c79b85d56aeb4607aa74e90a1c1ce23f355c744fff97709fcd7804bd6dae1
3
+ metadata.gz: ea00c2968e40f335c5505b4ce5461fb9b5ec6488bfe48293829848fd2c57e2fc
4
+ data.tar.gz: 860569d2e37c2b14aee89671d2bd4e76b409221a8e54712008009000c054a144
5
5
  SHA512:
6
- metadata.gz: 98eb0019308fa0bfdd33d500c90dd03f1da45e59b6f7ce62d3f175565f179723d1d189ca2df38c00e8d4890fa427d9edf42e89d368e4522dee835449a8352f3a
7
- data.tar.gz: aa3ff8ca53dc5853a21f2d12ad4bd7f050596634f63287d53f4832fcfc3035859c9b44b59bfd95cc91d58969761b66ad685c660bdbc8ac58d115cb4fb3abbdfc
6
+ metadata.gz: ec50aef23be4941687dc0822b02aec8daf083f1986f50054cae56562937c1788c4e6ff4f03bff6689732b3e88787fbbf42ea3bc6324d89f4b47dddfed23bbcb3
7
+ data.tar.gz: 87d063e7f87081ad123e47610d173dc62e4f3c6200887021af40d389b39892b20b34d73757989eae383447308e34598198e47af33a48d1a184738c4a275361b9
data/.rubocop_todo.yml CHANGED
@@ -1,11 +1,25 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-10-17 05:39:30 UTC using RuboCop version 0.93.1.
3
+ # on 2021-03-07 06:12:58 UTC using RuboCop version 1.11.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/DateAssignment:
14
+ Exclude:
15
+ - 'gruff.gemspec'
16
+
17
+ # Offense count: 1
18
+ # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
19
+ Lint/DuplicateBranch:
20
+ Exclude:
21
+ - 'test/gruff_test_case.rb'
22
+
9
23
  # Offense count: 1
10
24
  Lint/DuplicateMethods:
11
25
  Exclude:
@@ -36,13 +50,13 @@ Lint/Void:
36
50
  - 'lib/gruff/patch/rmagick.rb'
37
51
 
38
52
  # Offense count: 54
39
- # Configuration parameters: IgnoredMethods.
53
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
40
54
  Metrics/AbcSize:
41
55
  Max: 82
42
56
 
43
57
  # Offense count: 1
44
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
45
- # ExcludedMethods: refine
58
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
59
+ # IgnoredMethods: refine
46
60
  Metrics/BlockLength:
47
61
  Max: 29
48
62
 
@@ -57,12 +71,12 @@ Metrics/CyclomaticComplexity:
57
71
  Max: 21
58
72
 
59
73
  # Offense count: 121
60
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
74
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
61
75
  Metrics/MethodLength:
62
76
  Max: 81
63
77
 
64
78
  # Offense count: 3
65
- # Configuration parameters: CountKeywordArgs.
79
+ # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
66
80
  Metrics/ParameterLists:
67
81
  Max: 7
68
82
 
@@ -88,6 +102,16 @@ Naming/MethodParameterName:
88
102
  - 'lib/gruff/pie.rb'
89
103
  - 'lib/gruff/renderer/text.rb'
90
104
 
105
+ # Offense count: 6
106
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
107
+ # SupportedStyles: snake_case, normalcase, non_integer
108
+ # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
109
+ Naming/VariableNumber:
110
+ Exclude:
111
+ - 'test/test_bar.rb'
112
+ - 'test/test_bezier.rb'
113
+ - 'test/test_line.rb'
114
+
91
115
  # Offense count: 1
92
116
  # Configuration parameters: MinSize.
93
117
  Performance/CollectionLiteralInLoop:
@@ -122,12 +146,18 @@ Style/CombinableLoops:
122
146
  Exclude:
123
147
  - 'test/test_line.rb'
124
148
 
149
+ # Offense count: 3
150
+ Style/DocumentDynamicEvalDefinition:
151
+ Exclude:
152
+ - 'test/gruff_test_case.rb'
153
+
125
154
  # Offense count: 132
126
155
  # Configuration parameters: RequireForNonPublicMethods.
127
156
  Style/DocumentationMethod:
128
157
  Enabled: false
129
158
 
130
159
  # Offense count: 3
160
+ # Cop supports --auto-correct.
131
161
  Style/EvalWithLocation:
132
162
  Exclude:
133
163
  - 'test/gruff_test_case.rb'
@@ -151,3 +181,10 @@ Style/StringConcatenation:
151
181
  - 'lib/gruff/photo_bar.rb'
152
182
  - 'test/gruff_test_case.rb'
153
183
 
184
+ # Offense count: 2
185
+ # Configuration parameters: EnforcedStyle.
186
+ # SupportedStyles: forbid_mixed_logical_operators, forbid_logical_operators
187
+ Style/UnlessLogicalOperators:
188
+ Exclude:
189
+ - 'lib/gruff/bar.rb'
190
+ - 'lib/gruff/scatter.rb'
data/.travis.yml CHANGED
@@ -7,7 +7,8 @@ rvm:
7
7
  - 2.5
8
8
  - 2.6
9
9
  - 2.7
10
- - jruby-9.2.13.0
10
+ - 3.0
11
+ - jruby-9.2.14.0
11
12
 
12
13
  jobs:
13
14
  include:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.12.2
4
+ - Avoid SEGV caused with '%S' in Draw#get_type_metrics by old ImageMagick (6.9.9 or below) (#490)
5
+
3
6
  ## 0.12.0
4
7
  - Mark Gruff::Base#to_blob as deprecated (#473)
5
8
  - Add Gruff::Base#to_image method (#472)
data/gruff.gemspec CHANGED
@@ -29,8 +29,8 @@ Gem::Specification.new do |s|
29
29
  s.add_dependency 'rmagick4j'
30
30
  else
31
31
  s.add_dependency 'rmagick'
32
- s.add_development_dependency 'rubocop', '~> 1.0.0'
33
- s.add_development_dependency 'rubocop-performance', '~> 1.8'
32
+ s.add_development_dependency 'rubocop', '~> 1.11.0'
33
+ s.add_development_dependency 'rubocop-performance', '~> 1.10.1'
34
34
  end
35
35
  s.add_dependency 'histogram'
36
36
  s.required_ruby_version = '>= 2.4.0'
data/lib/gruff/pie.rb CHANGED
@@ -77,7 +77,7 @@ private
77
77
 
78
78
  slices.sort_by(&:value) if @sort
79
79
 
80
- total = slices.map(&:value).sum.to_f
80
+ total = slices.sum(&:value).to_f
81
81
  slices.each { |slice| slice.total = total }
82
82
  end
83
83
  end
@@ -51,7 +51,14 @@ module Gruff
51
51
 
52
52
  draw.font_weight = font_weight
53
53
  draw.pointsize = size
54
- draw.get_type_metrics(image, text.to_s)
54
+
55
+ # The old ImageMagick causes SEGV with string which has '%' + alphabet (eg. '%S').
56
+ # This format is used to embed value into a string using image properties.
57
+ # However, gruff use plain image as canvas which does not have any property.
58
+ # So, in here, it just escape % in order to avoid SEGV.
59
+ text = text.to_s.gsub(/(%+)/) { ('%' * Regexp.last_match(1).size * 2).to_s }
60
+
61
+ draw.get_type_metrics(image, text)
55
62
  end
56
63
  end
57
64
  end
data/lib/gruff/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gruff
4
- VERSION = '0.12.1'
4
+ VERSION = '0.12.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoffrey Grosenbach
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-10-31 00:00:00.000000000 Z
12
+ date: 2021-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rmagick
@@ -31,28 +31,28 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 1.0.0
34
+ version: 1.11.0
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 1.0.0
41
+ version: 1.11.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rubocop-performance
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '1.8'
48
+ version: 1.10.1
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '1.8'
55
+ version: 1.10.1
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: histogram
58
58
  requirement: !ruby/object:Gem::Requirement