hotchoc 0.1.0 → 0.2.0

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: 772df776e809aa41302d368813a4378aed3f4cc0
4
- data.tar.gz: 060a43cfd5352ab0ac2ee6aa7e637efc28c5314f
3
+ metadata.gz: 5a893ac926a79c8737afa2810911b2231cd5ad46
4
+ data.tar.gz: 0ec2c6f3085b60587ff1208c5b6de95994962786
5
5
  SHA512:
6
- metadata.gz: 0485bb80b24c5520f951394ecb880214f89ab800a27d2d2d01bbf5350c9a3bb172622fa5a12f3f51ea7f119a144b12a68d6c545f07e8fdc154aae4529f9644dd
7
- data.tar.gz: 8ef2d166f82a28e3f67ade1a05f2d68cc93acacce629a00b2ba0ec713a34ad19ddd9d68007ae13ff05fb98f238e8f3ab2246b6d9861a76d9c72293e2bba15486
6
+ metadata.gz: 48ac708583876ad9f9aff17ef88aaef4ba59e51c2df0fdcfd9e7bba7c5e796162807798d4cb76f52a22ad299c73064cf2c0ba098f6b59614c533d4887f42fc6a
7
+ data.tar.gz: 4483599c8dd62fe8d3a95144fade6f36b853da36f641c9e6dc5c0fae5bab0a50db4848feb12f7ba7631b693c73ca2d7e50a79df52c5b36b971bcbe7d532a7c07
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .DS_Store
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
data/.rubocop.yml ADDED
@@ -0,0 +1,558 @@
1
+ AllCops:
2
+ RunRailsCops: true
3
+
4
+
5
+ Style/AccessModifierIndentation:
6
+ Enabled: true
7
+ EnforcedStyle: indent
8
+
9
+ Style/AccessorMethodName:
10
+ Enabled: false
11
+
12
+ Style/Alias:
13
+ Enabled: true
14
+
15
+ Style/AlignArray:
16
+ Enabled: true
17
+
18
+ Style/AlignHash:
19
+ Enabled: false
20
+ EnforcedLastArgumentHashStyle: always_ignore
21
+
22
+ Style/AlignParameters:
23
+ Enabled: false
24
+
25
+ Style/AndOr:
26
+ Enabled: false
27
+
28
+ Style/ArrayJoin:
29
+ Enabled: true
30
+
31
+ Style/AsciiComments:
32
+ Enabled: true
33
+
34
+ Style/AsciiIdentifiers:
35
+ Enabled: true
36
+
37
+ Style/Attr:
38
+ Enabled: false
39
+
40
+ Style/BeginBlock:
41
+ Enabled: false
42
+
43
+ Style/BlockComments:
44
+ Enabled: false
45
+
46
+ Style/BlockNesting:
47
+ Enabled: false
48
+
49
+ Style/Blocks:
50
+ Enabled: false
51
+
52
+ Style/BracesAroundHashParameters:
53
+ Enabled: false
54
+
55
+ Style/CaseEquality:
56
+ Enabled: true
57
+
58
+ Style/CaseIndentation:
59
+ Enabled: true
60
+
61
+ Style/CharacterLiteral:
62
+ Enabled: false
63
+
64
+ Style/ClassAndModuleCamelCase:
65
+ Enabled: true
66
+
67
+ Style/ClassAndModuleChildren:
68
+ Enabled: false
69
+
70
+ Style/ClassCheck:
71
+ Enabled: true
72
+
73
+ Style/ClassLength:
74
+ Enabled: false
75
+
76
+ Style/ClassMethods:
77
+ Enabled: false
78
+
79
+ Style/ClassVars:
80
+ Enabled: false
81
+
82
+ Style/CollectionMethods:
83
+ Enabled: false
84
+
85
+ Style/ColonMethodCall:
86
+ Enabled: false
87
+
88
+ Style/CommentAnnotation:
89
+ Enabled: false
90
+
91
+ Style/CommentIndentation:
92
+ Enabled: true
93
+
94
+ Style/ConstantName:
95
+ Enabled: false
96
+
97
+ Style/CyclomaticComplexity:
98
+ Enabled: false
99
+
100
+ Style/DefWithParentheses:
101
+ Enabled: true
102
+
103
+ Style/DeprecatedHashMethods:
104
+ Enabled: true
105
+
106
+ Style/Documentation:
107
+ Enabled: false
108
+
109
+ Style/DotPosition:
110
+ Enabled: false
111
+
112
+ Style/DoubleNegation:
113
+ Enabled: false
114
+
115
+ Style/EachWithObject:
116
+ Enabled: true
117
+
118
+ Style/EmptyLineBetweenDefs:
119
+ Enabled: true
120
+
121
+ Style/EmptyLines:
122
+ Enabled: false
123
+
124
+ Style/EmptyLinesAroundAccessModifier:
125
+ Enabled: false
126
+
127
+ Style/EmptyLinesAroundBody:
128
+ Enabled: false
129
+
130
+ Style/EmptyLiteral:
131
+ Enabled: false
132
+
133
+ Style/Encoding:
134
+ Enabled: false
135
+
136
+ Style/EndBlock:
137
+ Enabled: false
138
+
139
+ Style/EndOfLine:
140
+ Enabled: true
141
+
142
+ Style/EvenOdd:
143
+ Enabled: false
144
+
145
+ Style/FileName:
146
+ Enabled: true
147
+
148
+ Style/FlipFlop:
149
+ Enabled: false
150
+
151
+ Style/For:
152
+ Enabled: true
153
+
154
+ Style/FormatString:
155
+ Enabled: false
156
+
157
+ Style/GlobalVars:
158
+ Enabled: false
159
+
160
+ Style/GuardClause:
161
+ Enabled: true
162
+
163
+ Style/HashSyntax:
164
+ Enabled: true
165
+
166
+ Style/IfUnlessModifier:
167
+ Enabled: false
168
+
169
+ Style/IfWithSemicolon:
170
+ Enabled: false
171
+
172
+ Style/IndentationConsistency:
173
+ Enabled: true
174
+
175
+ Style/IndentationWidth:
176
+ Enabled: false
177
+
178
+ Style/IndentArray:
179
+ Enabled: false
180
+
181
+ Style/IndentHash:
182
+ Enabled: false
183
+
184
+ Style/InlineComment:
185
+ Enabled: false
186
+
187
+ Style/Lambda:
188
+ Enabled: true
189
+
190
+ Style/LambdaCall:
191
+ Enabled: false
192
+
193
+ Style/LeadingCommentSpace:
194
+ Enabled: false
195
+
196
+ Style/LineEndConcatenation:
197
+ Enabled: false
198
+
199
+ Style/LineLength:
200
+ Max: 198
201
+ Enabled: true
202
+
203
+ Style/MethodCalledOnDoEndBlock:
204
+ Enabled: true
205
+
206
+ Style/MethodCallParentheses:
207
+ Enabled: false
208
+
209
+ Style/MethodDefParentheses:
210
+ Enabled: false
211
+
212
+ Style/MethodLength:
213
+ Enabled: false
214
+
215
+ Style/MethodName:
216
+ Enabled: false
217
+
218
+ Style/ModuleFunction:
219
+ Enabled: false
220
+
221
+ Style/MultilineBlockChain:
222
+ Enabled: false
223
+
224
+ Style/MultilineIfThen:
225
+ Enabled: false
226
+
227
+ Style/MultilineTernaryOperator:
228
+ Enabled: false
229
+
230
+ Style/NegatedIf:
231
+ Enabled: false
232
+
233
+ Style/NegatedWhile:
234
+ Enabled: false
235
+
236
+ Style/NestedTernaryOperator:
237
+ Enabled: false
238
+
239
+ Style/Next:
240
+ Enabled: true
241
+
242
+ Style/NilComparison:
243
+ Enabled: false
244
+
245
+ Style/NonNilCheck:
246
+ Enabled: false
247
+
248
+ Style/Not:
249
+ Enabled: true
250
+
251
+ Style/NumericLiterals:
252
+ Enabled: false
253
+
254
+ Style/OneLineConditional:
255
+ Enabled: false
256
+
257
+ Style/OpMethod:
258
+ Enabled: false
259
+
260
+ Style/ParameterLists:
261
+ Enabled: false
262
+
263
+ Style/ParenthesesAroundCondition:
264
+ Enabled: false
265
+
266
+ Style/PercentLiteralDelimiters:
267
+ Enabled: false
268
+
269
+ Style/PerlBackrefs:
270
+ Enabled: false
271
+
272
+ Style/PredicateName:
273
+ Enabled: false
274
+
275
+ Style/Proc:
276
+ Enabled: false
277
+
278
+ Style/RaiseArgs:
279
+ Enabled: false
280
+
281
+ Style/RedundantBegin:
282
+ Enabled: false
283
+
284
+ Style/RedundantException:
285
+ Enabled: false
286
+
287
+ Style/RedundantReturn:
288
+ Enabled: true
289
+
290
+ Style/RedundantSelf:
291
+ Enabled: false
292
+
293
+ Style/RegexpLiteral:
294
+ Enabled: false
295
+
296
+ Style/RescueModifier:
297
+ Enabled: false
298
+
299
+ Style/SelfAssignment:
300
+ Enabled: true
301
+
302
+ Style/Semicolon:
303
+ Enabled: true
304
+
305
+ Style/SignalException:
306
+ Enabled: false
307
+
308
+ Style/SingleLineBlockParams:
309
+ Enabled: false
310
+
311
+ Style/SingleLineMethods:
312
+ Enabled: true
313
+
314
+ Style/SingleSpaceBeforeFirstArg:
315
+ Enabled: true
316
+
317
+ Style/SpaceAfterColon:
318
+ Enabled: true
319
+
320
+ Style/SpaceAfterComma:
321
+ Enabled: true
322
+
323
+ Style/SpaceAfterControlKeyword:
324
+ Enabled: false
325
+
326
+ Style/SpaceAfterMethodName:
327
+ Enabled: false
328
+
329
+ Style/SpaceAfterNot:
330
+ Enabled: false
331
+
332
+ Style/SpaceAfterSemicolon:
333
+ Enabled: false
334
+
335
+ Style/SpaceBeforeBlockBraces:
336
+ Enabled: true
337
+
338
+ Style/SpaceBeforeComma:
339
+ Enabled: true
340
+
341
+ Style/SpaceBeforeComment:
342
+ Enabled: true
343
+
344
+ Style/SpaceBeforeSemicolon:
345
+ Enabled: true
346
+
347
+ Style/SpaceInsideBlockBraces:
348
+ Enabled: true
349
+
350
+ Style/SpaceAroundEqualsInParameterDefault:
351
+ Enabled: true
352
+
353
+ Style/SpaceAroundOperators:
354
+ Enabled: true
355
+
356
+ Style/SpaceBeforeModifierKeyword:
357
+ Enabled: true
358
+
359
+ Style/SpaceInsideBrackets:
360
+ Enabled: true
361
+
362
+ Style/SpaceInsideHashLiteralBraces:
363
+ Enabled: true
364
+
365
+ Style/SpaceInsideParens:
366
+ Enabled: false
367
+
368
+ Style/SpecialGlobalVars:
369
+ Enabled: false
370
+
371
+ Style/StringLiterals:
372
+ Enabled: false
373
+
374
+ Style/Tab:
375
+ Enabled: true
376
+
377
+ Style/Tab:
378
+ Enabled: true
379
+
380
+ Style/TrailingBlankLines:
381
+ Enabled: true
382
+
383
+ Style/TrailingComma:
384
+ Enabled: false
385
+
386
+ Style/TrailingWhitespace:
387
+ Enabled: true
388
+
389
+ Style/TrivialAccessors:
390
+ Enabled: false
391
+
392
+ Style/UnlessElse:
393
+ Enabled: true
394
+
395
+ Style/UnneededCapitalW:
396
+ Enabled: true
397
+
398
+ Style/UnneededPercentQ:
399
+ Enabled: true
400
+
401
+ Style/UnneededPercentX:
402
+ Enabled: true
403
+
404
+ Style/VariableInterpolation:
405
+ Enabled: false
406
+
407
+ Style/VariableName:
408
+ Enabled: false
409
+
410
+ Style/WhenThen:
411
+ Enabled: true
412
+
413
+ Style/WhileUntilDo:
414
+ Enabled: false
415
+
416
+ Style/WhileUntilModifier:
417
+ Enabled: false
418
+
419
+ Style/WordArray:
420
+ Enabled: false
421
+
422
+ #################### Lint ################################
423
+ ### Warnings
424
+
425
+ Lint/AmbiguousOperator:
426
+ Enabled: false
427
+
428
+ Lint/AmbiguousRegexpLiteral:
429
+ Enabled: false
430
+
431
+ Lint/AssignmentInCondition:
432
+ Enabled: false
433
+
434
+ Lint/BlockAlignment:
435
+ Enabled: false
436
+
437
+ Lint/ConditionPosition:
438
+ Enabled: false
439
+
440
+ Lint/Debugger:
441
+ Enabled: true
442
+
443
+ Lint/DefEndAlignment:
444
+ Enabled: true
445
+
446
+ Lint/DeprecatedClassMethods:
447
+ Enabled: true
448
+
449
+ Lint/ElseLayout:
450
+ Enabled: false
451
+
452
+ Lint/EmptyEnsure:
453
+ Enabled: true
454
+
455
+ Lint/EmptyInterpolation:
456
+ Enabled: true
457
+
458
+ Lint/EndAlignment:
459
+ Enabled: true
460
+ AlignWith: variable
461
+
462
+ Lint/EndInMethod:
463
+ Enabled: false
464
+
465
+ Lint/EnsureReturn:
466
+ Enabled: false
467
+
468
+ Lint/Eval:
469
+ Enabled: true
470
+
471
+ Lint/HandleExceptions:
472
+ Enabled: false
473
+
474
+ Lint/InvalidCharacterLiteral:
475
+ Enabled: false
476
+
477
+ Lint/LiteralInCondition:
478
+ Enabled: false
479
+
480
+ Lint/LiteralInInterpolation:
481
+ Enabled: false
482
+
483
+ Lint/Loop:
484
+ Enabled: false
485
+
486
+ Lint/ParenthesesAsGroupedExpression:
487
+ Enabled: false
488
+
489
+ Lint/RequireParentheses:
490
+ Enabled: false
491
+
492
+ Lint/RescueException:
493
+ Enabled: false
494
+
495
+ Lint/ShadowingOuterLocalVariable:
496
+ Enabled: false
497
+
498
+ Lint/SpaceBeforeFirstArg:
499
+ Enabled: true
500
+
501
+ Lint/StringConversionInInterpolation:
502
+ Enabled: true
503
+
504
+ Lint/UnderscorePrefixedVariableName:
505
+ Enabled: true
506
+
507
+ Lint/UnusedBlockArgument:
508
+ Enabled: true
509
+
510
+ Lint/UnusedMethodArgument:
511
+ Enabled: false
512
+
513
+ Lint/UnreachableCode:
514
+ Enabled: true
515
+
516
+ Lint/UselessAccessModifier:
517
+ Enabled: true
518
+
519
+ Lint/UselessAssignment:
520
+ Enabled: false
521
+
522
+ Lint/UselessComparison:
523
+ Enabled: true
524
+
525
+ Lint/UselessElseWithoutRescue:
526
+ Enabled: true
527
+
528
+ Lint/UselessSetterCall:
529
+ Enabled: true
530
+
531
+ Lint/Void:
532
+ Enabled: true
533
+
534
+ ##################### Rails ##################################
535
+
536
+ Rails/ActionFilter:
537
+ Enabled: true
538
+
539
+ Rails/DefaultScope:
540
+ Enabled: false
541
+
542
+ Rails/Delegate:
543
+ Enabled: true
544
+
545
+ Rails/HasAndBelongsToMany:
546
+ Enabled: false
547
+
548
+ Rails/Output:
549
+ Enabled: false
550
+
551
+ Rails/ReadWriteAttribute:
552
+ Enabled: false
553
+
554
+ Rails/ScopeArgs:
555
+ Enabled: false
556
+
557
+ Rails/Validation:
558
+ Enabled: true
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## Master
4
+
5
+ ## 0.2.0
6
+
7
+ [Full changelog](https://github.com/choc/hotchoc-ruby/compare/v0.1.0...v0.2.0)
8
+
9
+ Major changes:
10
+
11
+ * Wrap responses in presenter objects instead of returning raw JSON
12
+ * Fields 'hidden' and 'excerpt' were dropped from albums, pages and posts
13
+ * Single resource APIs were removed
14
+
15
+ Enhancements:
16
+
17
+ * Added RuboCop
18
+ * Various code improvements
19
+
3
20
  ## 0.1.0
4
21
 
5
22
  [Full changelog](https://github.com/choc/hotchoc-ruby/compare/v0.0.1...v0.1.0)
data/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Official Ruby wrapper for the Hotchoc API (in private beta).
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/hotchoc.svg)](http://badge.fury.io/rb/hotchoc)
6
+ [![Code Climate](https://codeclimate.com/github/choc/hotchoc-ruby.png)](https://codeclimate.com/github/choc/hotchoc-ruby)
7
+
5
8
  ## Installation
6
9
 
7
10
  Add this line to your application's Gemfile:
@@ -26,26 +29,19 @@ Or install it manually as:
26
29
  ## Examples
27
30
 
28
31
  # Get single album by ID
29
- client.get_album('53d0dcdc6c6f725407000000')
30
- => {"id"=>"53d0dcdc6c6f725407000000", "title"=>"New album", "subtitle"=>"A subtitle", ...
32
+ client.get_albums(id: '77774dc8-4edf-4b3a-8571-a6b64c8adace')
33
+ => [#<Hotchoc::Presenters::Album: title="Test album 1">]
31
34
 
32
35
  # Get all albums
33
36
  client.get_albums
34
- => [{"id"=>"53d0dcdc6c6f725407000000", "title"=>"New album", "subtitle"=>"A subtitle", ...
37
+ => [#<Hotchoc::Presenters::Album: title="Test album 2">, #<Hotchoc::Presenters::Album: title="Test album 1">]
35
38
 
36
39
  # Get only first 10 albums
37
40
  client.get_albums(limit: 10)
38
- => [{"id"=>"53d0dcdc6c6f725407000000", "title"=>"New album", "subtitle"=>"A subtitle", ...
41
+ => [#<Hotchoc::Presenters::Album: title="Test album 2">, #<Hotchoc::Presenters::Album: title="Test album 1">]
39
42
 
40
43
  ## API
41
44
 
42
- ### Get single resource
43
-
44
- client.get_album(id)
45
- client.get_page(id)
46
- client.get_post(id)
47
- client.get_topic(id)
48
-
49
45
  ### Get collection
50
46
 
51
47
  client.get_albums
data/Rakefile CHANGED
@@ -1 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rubocop/rake_task"
3
+
4
+ desc 'Run RuboCop checks'
5
+ RuboCop::RakeTask.new(:rubocop) do |task|
6
+ task.patterns = ['{lib,spec}/**/*.rb']
7
+ task.formatters = ['progress']
8
+ task.fail_on_error = true
9
+ end
data/hotchoc.gemspec CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |spec|
7
7
  spec.version = Hotchoc::VERSION
8
8
  spec.authors = ["Matthias Siegel"]
9
9
  spec.email = ["matthias.siegel@gmail.com"]
10
- spec.summary = %q{Official Ruby wrapper for the Hotchoc API.}
11
- spec.description = %q{Official Ruby wrapper for the Hotchoc API.}
10
+ spec.summary = %q{Ruby wrapper for the Hotchoc API.}
11
+ spec.description = %q{Ruby wrapper for the Hotchoc API.}
12
12
  spec.homepage = "https://github.com/choc/hotchoc-ruby"
13
13
  spec.license = "MIT"
14
14
 
@@ -16,10 +16,11 @@ Gem::Specification.new do |spec|
16
16
  spec.test_files = spec.files.grep(%r{^(spec)/})
17
17
  spec.require_paths = ["lib"]
18
18
 
19
- spec.add_dependency "typhoeus", "~> 0.6.9"
19
+ spec.add_dependency "typhoeus", "~> 0.7.0"
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.5"
22
- spec.add_development_dependency "rake", "~> 10.3"
23
- spec.add_development_dependency "rspec", "~> 3.0"
24
- spec.add_development_dependency "webmock", "~> 1.18"
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.4"
23
+ spec.add_development_dependency "rspec", "~> 3.2"
24
+ spec.add_development_dependency "rubocop", "~> 0.24.1"
25
+ spec.add_development_dependency "webmock", "~> 1.20"
25
26
  end