rmagick 2.14.0 → 2.15.0

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
  SHA1:
3
- metadata.gz: 7f1d40197e527e46372e4ad8c265c3f2e929eddd
4
- data.tar.gz: d559dc36017d771ac142cc90029037402c355e4d
3
+ metadata.gz: beb83114bca52271ffbe728210030f1fe165e0b3
4
+ data.tar.gz: aa899f36246d733532c30056f5a2c25a96e4e111
5
5
  SHA512:
6
- metadata.gz: 577e9dcde875183b07218696b2302e73849e292b632c5464294320583e2c209971e0958cf96faf14a3c45e11c76b2af90eab1b5c0b743fdeefabd87296d9ae74
7
- data.tar.gz: 63ccbc7117ba02dbd5229f3ebbb52bf1d135aea0a73ca1bbcd5d1df80088798926e6cb9eb29d29552972e2cf283d33d79a7dbf8af4135f6965345448d2ef994a
6
+ metadata.gz: b05b73eb4085af7f55727f85febbe437625c217380312828d06110767b67ee6108fd0bd74d6a0949b9eb93f759243048d25a84a8061d8892be0b698684d8fbd9
7
+ data.tar.gz: 430a64346546bf3f8efcbcada84b88f501b4db0713e7d44aafd6ec333152232d61d19eb07d1ef17b7f4163e9738c9d5cdb5d4912bfe9d31d692c76c3aa43ab16
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
@@ -1,9 +1,22 @@
1
- # This configuration was generated by `rubocop --auto-gen-config`
2
- # on 2015-02-08 00:25:41 +0300 using RuboCop version 0.29.0.
3
- # The point is for the user to remove these configuration records
4
- # one by one as the offenses are removed from the code base.
5
- # Note that changes in the inspected code, or installation of new
6
- # versions of RuboCop, may require this file to be generated again.
1
+ # Custom configuration, edit with care! This gem needs to be backwards
2
+ # compatible with Ruby 1.8:
3
+
4
+ Style/HashSyntax:
5
+ EnforcedStyle: hash_rockets
6
+
7
+ Style/DeprecatedHashMethods:
8
+ Enabled: false
9
+
10
+ # TODO: How to warn if stabby proc is used?
11
+ Style/Lambda:
12
+ Enabled: false
13
+
14
+ # Auto-generated config to be cleaned up and deleted:
15
+
16
+ # Offense count: 2
17
+ # Cop supports --auto-correct.
18
+ Lint/BlockAlignment:
19
+ Enabled: false
7
20
 
8
21
  # Offense count: 1
9
22
  Lint/HandleExceptions:
@@ -35,9 +48,9 @@ Lint/UnusedMethodArgument:
35
48
  Lint/UselessAssignment:
36
49
  Enabled: false
37
50
 
38
- # Offense count: 187
51
+ # Offense count: 183
39
52
  Metrics/AbcSize:
40
- Max: 567
53
+ Max: 559
41
54
 
42
55
  # Offense count: 1
43
56
  Metrics/BlockNesting:
@@ -46,18 +59,18 @@ Metrics/BlockNesting:
46
59
  # Offense count: 17
47
60
  # Configuration parameters: CountComments.
48
61
  Metrics/ClassLength:
49
- Max: 1124
62
+ Max: 1099
50
63
 
51
64
  # Offense count: 22
52
65
  Metrics/CyclomaticComplexity:
53
66
  Max: 42
54
67
 
55
- # Offense count: 886
68
+ # Offense count: 844
56
69
  # Configuration parameters: AllowURI, URISchemes.
57
70
  Metrics/LineLength:
58
- Max: 278
71
+ Max: 276
59
72
 
60
- # Offense count: 180
73
+ # Offense count: 178
61
74
  # Configuration parameters: CountComments.
62
75
  Metrics/MethodLength:
63
76
  Max: 157
@@ -85,7 +98,12 @@ Style/BarePercentLiterals:
85
98
  Style/CaseEquality:
86
99
  Enabled: false
87
100
 
88
- # Offense count: 14
101
+ # Offense count: 63
102
+ # Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
103
+ Style/CaseIndentation:
104
+ Enabled: false
105
+
106
+ # Offense count: 13
89
107
  Style/ClassAndModuleCamelCase:
90
108
  Enabled: false
91
109
 
@@ -94,23 +112,25 @@ Style/ClassAndModuleCamelCase:
94
112
  Style/ClassAndModuleChildren:
95
113
  Enabled: false
96
114
 
97
- # Offense count: 126
98
- Style/ConstantName:
115
+ # Offense count: 1
116
+ # Cop supports --auto-correct.
117
+ Style/ClosingParenthesisIndentation:
99
118
  Enabled: false
100
119
 
101
- # Offense count: 12
120
+ # Offense count: 5
102
121
  # Cop supports --auto-correct.
103
- Style/DeprecatedHashMethods:
122
+ Style/CommentIndentation:
104
123
  Enabled: false
105
124
 
106
- # Offense count: 63
107
- Style/Documentation:
125
+ # Offense count: 126
126
+ Style/ConstantName:
108
127
  Enabled: false
109
128
 
110
- Style/DotPosition:
111
- EnforcedStyle: leading
129
+ # Offense count: 62
130
+ Style/Documentation:
131
+ Enabled: false
112
132
 
113
- # Offense count: 24
133
+ # Offense count: 23
114
134
  # Configuration parameters: Exclude.
115
135
  Style/FileName:
116
136
  Enabled: false
@@ -120,31 +140,35 @@ Style/FileName:
120
140
  Style/FormatString:
121
141
  Enabled: false
122
142
 
123
- # Offense count: 43
143
+ # Offense count: 45
124
144
  # Configuration parameters: AllowedVariables.
125
145
  Style/GlobalVars:
126
146
  Enabled: false
127
147
 
128
- # Offense count: 7
148
+ # Offense count: 8
129
149
  # Configuration parameters: MinBodyLength.
130
150
  Style/GuardClause:
131
151
  Enabled: false
132
152
 
153
+ # Offense count: 29
133
154
  # Cop supports --auto-correct.
134
- Style/HashSyntax:
135
- EnforcedStyle: hash_rockets
136
-
137
- # Offense count: 28
138
155
  # Configuration parameters: MaxLineLength.
139
156
  Style/IfUnlessModifier:
140
157
  Enabled: false
141
158
 
142
- # Offense count: 1
159
+ # Offense count: 651
143
160
  # Cop supports --auto-correct.
144
- Style/Lambda:
161
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
162
+ Style/IndentationConsistency:
145
163
  Enabled: false
146
164
 
147
- # Offense count: 48
165
+ # Offense count: 1049
166
+ # Cop supports --auto-correct.
167
+ # Configuration parameters: Width.
168
+ Style/IndentationWidth:
169
+ Enabled: false
170
+
171
+ # Offense count: 47
148
172
  # Cop supports --auto-correct.
149
173
  Style/LeadingCommentSpace:
150
174
  Enabled: false
@@ -154,8 +178,11 @@ Style/LeadingCommentSpace:
154
178
  Style/MethodName:
155
179
  Enabled: false
156
180
 
181
+ # Offense count: 9
182
+ # Cop supports --auto-correct.
183
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
157
184
  Style/MultilineOperationIndentation:
158
- EnforcedStyle: indented
185
+ Enabled: false
159
186
 
160
187
  # Offense count: 1
161
188
  Style/MultilineTernaryOperator:
@@ -175,7 +202,7 @@ Style/NumericLiterals:
175
202
  Style/OpMethod:
176
203
  Enabled: false
177
204
 
178
- # Offense count: 19
205
+ # Offense count: 9
179
206
  # Cop supports --auto-correct.
180
207
  # Configuration parameters: PreferredDelimiters.
181
208
  Style/PercentLiteralDelimiters:
@@ -191,8 +218,9 @@ Style/PerlBackrefs:
191
218
  Style/PredicateName:
192
219
  Enabled: false
193
220
 
194
- # Offense count: 3
195
- # Configuration parameters: MaxSlashes.
221
+ # Offense count: 1
222
+ # Cop supports --auto-correct.
223
+ # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
196
224
  Style/RegexpLiteral:
197
225
  Enabled: false
198
226
 
@@ -200,6 +228,12 @@ Style/RegexpLiteral:
200
228
  Style/RescueModifier:
201
229
  Enabled: false
202
230
 
231
+ # Offense count: 2
232
+ # Cop supports --auto-correct.
233
+ # Configuration parameters: AllowAsExpressionSeparator.
234
+ Style/Semicolon:
235
+ Enabled: false
236
+
203
237
  # Offense count: 2
204
238
  # Configuration parameters: Methods.
205
239
  Style/SingleLineBlockParams:
@@ -210,7 +244,7 @@ Style/SingleLineBlockParams:
210
244
  Style/SingleSpaceBeforeFirstArg:
211
245
  Enabled: false
212
246
 
213
- # Offense count: 1112
247
+ # Offense count: 1114
214
248
  # Cop supports --auto-correct.
215
249
  Style/SpaceAfterComma:
216
250
  Enabled: false
@@ -221,18 +255,19 @@ Style/SpaceAfterComma:
221
255
  Style/SpaceAroundEqualsInParameterDefault:
222
256
  Enabled: false
223
257
 
224
- # Offense count: 1060
258
+ # Offense count: 1066
225
259
  # Cop supports --auto-correct.
260
+ # Configuration parameters: MultiSpaceAllowedForOperators.
226
261
  Style/SpaceAroundOperators:
227
262
  Enabled: false
228
263
 
229
- # Offense count: 2
264
+ # Offense count: 3
230
265
  # Cop supports --auto-correct.
231
266
  # Configuration parameters: EnforcedStyle, SupportedStyles.
232
267
  Style/SpaceBeforeBlockBraces:
233
268
  Enabled: false
234
269
 
235
- # Offense count: 209
270
+ # Offense count: 204
236
271
  # Cop supports --auto-correct.
237
272
  # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
238
273
  Style/SpaceInsideBlockBraces:
@@ -251,15 +286,9 @@ Style/SpaceInsideHashLiteralBraces:
251
286
 
252
287
  # Offense count: 35
253
288
  # Cop supports --auto-correct.
254
- # Many method calls in consecutive lines in RMagick have parameters aligned vertically.
255
- # Therefore this cop should better be disabled.
256
- # But you can delete this rule temporarily, run `rubocop -a`, and commit good fixes only.
257
289
  Style/SpaceInsideParens:
258
290
  Enabled: false
259
291
 
260
- Style/StringLiterals:
261
- EnforcedStyle: single_quotes
262
-
263
292
  # Offense count: 12
264
293
  # Cop supports --auto-correct.
265
294
  # Configuration parameters: IgnoredMethods.
@@ -272,6 +301,11 @@ Style/SymbolProc:
272
301
  Style/TrailingComma:
273
302
  Enabled: false
274
303
 
304
+ # Offense count: 204
305
+ # Cop supports --auto-correct.
306
+ Style/TrailingWhitespace:
307
+ Enabled: false
308
+
275
309
  # Offense count: 2
276
310
  # Configuration parameters: EnforcedStyle, SupportedStyles.
277
311
  Style/VariableName:
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ *This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)*
@@ -4,7 +4,9 @@ RMagick Contributor's Guide
4
4
  Welcome
5
5
  -------
6
6
 
7
- Thank you for considering contributing to RMagick. Your contribution is always welcome!
7
+ Thank you for considering contributing to RMagick. Your contribution is always welcome and appreciated!
8
+
9
+ Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
8
10
 
9
11
 
10
12
  Background
@@ -18,5 +20,21 @@ RMagick is a Ruby gem with a C extension. The extension wraps the ImageMagick C
18
20
  Priorities
19
21
  ----------
20
22
 
21
- 9. Green build of the gem on all operating systems. You can see the current build state on [the project page at Travis CI](https://travis-ci.org/gemhome/rmagick). You are welcome to improve it.
22
- 9. [Open issues](https://github.com/gemhome/rmagick/issues). You are welcome to reproduce them, report current state, suggest solutions, open pull requests with fixes.
23
+ 1. Green build of the gem on all operating systems. You can see the current build state on [the project page at Travis CI](https://travis-ci.org/gemhome/rmagick). You are welcome to improve it.
24
+ 2. [Open issues](https://github.com/gemhome/rmagick/issues). You are welcome to reproduce them, report current state, suggest solutions, open pull requests with fixes. If you don't know where to start, sort issues by least recently updated. You can also [subscribe to receive random issues by email](http://www.codetriage.com/gemhome/rmagick).
25
+
26
+
27
+ Testing
28
+ -------
29
+
30
+ Our goal is to migrate to [RSpec](http://rspec.info).
31
+
32
+ If you write new tests, please do it in RSpec.
33
+
34
+ You are also welcome to convert existing Test/Unit tests to RSpec.
35
+
36
+
37
+ Committing
38
+ ----------
39
+
40
+ It is better if you follow [Git Style Guide](https://github.com/agis-/git-style-guide).
data/ChangeLog CHANGED
@@ -1,4 +1,9 @@
1
- HEAD
1
+ RMagick 2.15.0
2
+ o Ability to remove alpha channel - @ollie
3
+ o C local variables guarded against GC to avoid segfaults - @u338steven
4
+ o trace_proc protected with a mutex to avoid segfaults - @u338steven
5
+
6
+ RMagick 2.14.0
2
7
  o RMagick.rb moved to deprecated directory - @mockdeep
3
8
  o Better ImageMagick feature detection - @bf4
4
9
  o Prevent compilation failures if prefix is an empty string - @voxik
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ task :config do
21
21
  end
22
22
  end
23
23
 
24
- desc 'abort when repo nto clean or has uncommited code'
24
+ desc 'abort when repo is not clean or has uncommited code'
25
25
  task :assert_clean_repo do
26
26
  sh('git diff --exit-code')
27
27
  abort 'Git repo not clean' unless $CHILD_STATUS.success?
@@ -165,6 +165,8 @@ end
165
165
 
166
166
  require 'rake/extensiontask'
167
167
  require 'rake/testtask'
168
+ require 'rspec/core/rake_task'
169
+ RSpec::Core::RakeTask.new(:spec)
168
170
 
169
171
  Rake::ExtensionTask.new('RMagick2') do |ext|
170
172
  ext.ext_dir = 'ext/RMagick'
@@ -175,11 +177,12 @@ Rake::TestTask.new(:test) do |t|
175
177
  end
176
178
 
177
179
  task :test => :compile
180
+ task :spec => :compile
178
181
 
179
182
  if ENV['STYLE_CHECKS']
180
183
  require 'rubocop/rake_task'
181
184
  RuboCop::RakeTask.new
182
- task :default => [:test, :rubocop]
185
+ task :default => [:spec, :test, :rubocop]
183
186
  else
184
- task :default => :test
187
+ task :default => [:spec, :test]
185
188
  end
@@ -357,7 +357,8 @@ SRC
357
357
  #check_sizeof("Image *", headers)
358
358
 
359
359
  have_enum_values('AlphaChannelType', ['CopyAlphaChannel', # 6.4.3-7
360
- 'BackgroundAlphaChannel'], headers) # 6.5.2-5
360
+ 'BackgroundAlphaChannel', # 6.5.2-5
361
+ 'RemoveAlphaChannel'], headers) # 6.7.5-1
361
362
  have_enum_values('CompositeOperator', ['BlurCompositeOp', # 6.5.3-7
362
363
  'DistortCompositeOp', # 6.5.3-10
363
364
  'LinearBurnCompositeOp', # 6.5.4-3
@@ -34,7 +34,7 @@ Magick_colors(VALUE class)
34
34
  {
35
35
  const ColorInfo **color_info_list;
36
36
  size_t number_colors, x;
37
- volatile VALUE ary;
37
+ VALUE ary;
38
38
  ExceptionInfo *exception;
39
39
 
40
40
  exception = AcquireExceptionInfo();
@@ -62,6 +62,7 @@ Magick_colors(VALUE class)
62
62
  }
63
63
 
64
64
  magick_free((void *)color_info_list);
65
+ RB_GC_GUARD(ary);
65
66
  return ary;
66
67
  }
67
68
  }
@@ -83,7 +84,7 @@ Magick_fonts(VALUE class)
83
84
  {
84
85
  const TypeInfo **type_info;
85
86
  size_t number_types, x;
86
- volatile VALUE ary;
87
+ VALUE ary;
87
88
  ExceptionInfo *exception;
88
89
 
89
90
  exception = AcquireExceptionInfo();
@@ -108,6 +109,7 @@ Magick_fonts(VALUE class)
108
109
  (void) rb_ary_push(ary, Import_TypeInfo((const TypeInfo *)type_info[x]));
109
110
  }
110
111
  magick_free((void *)type_info);
112
+ RB_GC_GUARD(ary);
111
113
  return ary;
112
114
  }
113
115
 
@@ -167,7 +169,7 @@ Magick_init_formats(VALUE class)
167
169
  {
168
170
  const MagickInfo **magick_info;
169
171
  size_t number_formats, x;
170
- volatile VALUE formats;
172
+ VALUE formats;
171
173
  ExceptionInfo *exception;
172
174
 
173
175
  class = class; // defeat "never referenced" message from icc
@@ -186,6 +188,7 @@ Magick_init_formats(VALUE class)
186
188
  , rb_str_new2(magick_info[x]->name)
187
189
  , MagickInfo_to_format((const MagickInfo *)magick_info[x]));
188
190
  }
191
+ RB_GC_GUARD(formats);
189
192
  return formats;
190
193
  }
191
194
 
@@ -206,7 +209,7 @@ Magick_init_formats(VALUE class)
206
209
  VALUE
207
210
  Magick_limit_resource(int argc, VALUE *argv, VALUE class)
208
211
  {
209
- volatile VALUE resource, limit;
212
+ VALUE resource, limit;
210
213
  ResourceType res = UndefinedResource;
211
214
  char *str;
212
215
  ID id;
@@ -280,6 +283,8 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
280
283
  break;
281
284
  }
282
285
 
286
+ RB_GC_GUARD(resource);
287
+
283
288
  cur_limit = GetMagickResourceLimit(res);
284
289
 
285
290
  if (argc > 1)
@@ -287,6 +292,8 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
287
292
  (void) SetMagickResourceLimit(res, (MagickSizeType)NUM2ULONG(limit));
288
293
  }
289
294
 
295
+ RB_GC_GUARD(limit);
296
+
290
297
  return ULONG2NUM(cur_limit);
291
298
  }
292
299