esp_sdk 1.0.6 → 1.1.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: 98f1673b2ccddd24965c7438a02c5157da052cf9
4
- data.tar.gz: 930b0f439c6787db8d7248403ac36d2cc86893e4
3
+ metadata.gz: 9ae3ded6473c7dd46addd90c607bc9f9a33e6c56
4
+ data.tar.gz: 4528c438187d057bb6a6062e6f9999968a3a0c92
5
5
  SHA512:
6
- metadata.gz: 14eaf354719f10d22112403d794377fe0c3c74b2f4aeb0a0a8f57ab853f40d752e2ea7510aae085187589a68a118f172fd79aa597e4e892f38c77ee3084dfc77
7
- data.tar.gz: 7629b30508e34ebf820cb71af0a78e8c530b9fb48776c3a84c3ca038dada5c7d0c581434657999896f2659ffcdf1b482de1f95522222974216fd786160a9fd26
6
+ metadata.gz: 5af81ffd9e432e288418a7e7fcb766b853f15e85e3f1079ee2526526d0eb520c5006f929ea36e6c3b96c410a33366371becfcc36329fd1851662b22cb1636a53
7
+ data.tar.gz: d88b77ff17a2d27ce65b3f58ef6cd1affc06deb2e757db1f186355a8059b3e9c48c2fbd4ddf38d9001e3af639e80321786b8e339446c964c3f323be6920602fc
data/.hound.yml ADDED
@@ -0,0 +1,2 @@
1
+ ruby:
2
+ config_file: .rubocop.yml
data/.rubocop.yml ADDED
@@ -0,0 +1,905 @@
1
+ AllCops:
2
+ Include:
3
+ - '**/*.gemspec'
4
+ - '**/Rakefile'
5
+ Exclude:
6
+ - 'db/**/*'
7
+ - 'config/**/*'
8
+ - 'script/**/*'
9
+ - 'test/dummy/**/*'
10
+ - 'vendor/**/*'
11
+ - '**/Vagrantfile'
12
+ - 'bin/**/*'
13
+ - 'test/test_reporter.rb'
14
+ - 'test/shared_connection.rb'
15
+
16
+ DisplayCopNames: true
17
+ RunRailsCops: true
18
+
19
+ ################################################################
20
+ ###################### Style ###################################
21
+ ################################################################
22
+
23
+ Style/AccessModifierIndentation:
24
+ EnforcedStyle: indent
25
+ SupportedStyles:
26
+ - outdent
27
+ - indent
28
+ Enabled: true
29
+
30
+ Style/AccessorMethodName:
31
+ Enabled: true
32
+
33
+ Style/Alias:
34
+ Enabled: true
35
+
36
+ Style/AlignHash:
37
+ EnforcedHashRocketStyle: key
38
+ EnforcedColonStyle: key
39
+ EnforcedLastArgumentHashStyle: always_inspect
40
+ SupportedLastArgumentHashStyles:
41
+ - always_inspect
42
+ - always_ignore
43
+ - ignore_implicit
44
+ - ignore_explicit
45
+ Enabled: true
46
+
47
+ Style/AlignArray:
48
+ Enabled: true
49
+
50
+ Style/AlignParameters:
51
+ EnforcedStyle: with_first_parameter
52
+ SupportedStyles:
53
+ - with_first_parameter
54
+ - with_fixed_indentation
55
+ Enabled: true
56
+
57
+ Style/AndOr:
58
+ EnforcedStyle: always
59
+ SupportedStyles:
60
+ - always
61
+ - conditionals
62
+ Enabled: true
63
+
64
+ Style/ArrayJoin:
65
+ Enabled: true
66
+
67
+ Style/AsciiComments:
68
+ Enabled: true
69
+
70
+ Style/AsciiIdentifiers:
71
+ Enabled: true
72
+
73
+ Style/Attr:
74
+ Enabled: true
75
+
76
+ Style/BarePercentLiterals:
77
+ EnforcedStyle: bare_percent
78
+ SupportedStyles:
79
+ - percent_q
80
+ - bare_percent
81
+ Enabled: true
82
+
83
+ Style/BeginBlock:
84
+ Enabled: true
85
+
86
+ Style/BlockComments:
87
+ Enabled: true
88
+
89
+ Style/BlockEndNewline:
90
+ Enabled: true
91
+
92
+ Style/Blocks:
93
+ Enabled: true
94
+
95
+
96
+ Style/BracesAroundHashParameters:
97
+ Enabled: true
98
+ EnforcedStyle: no_braces
99
+ SupportedStyles:
100
+ - braces
101
+ - no_braces
102
+
103
+ Style/CaseEquality:
104
+ Enabled: true
105
+
106
+ Style/CaseIndentation:
107
+ Enabled: true
108
+ IndentWhenRelativeTo: case
109
+ SupportedStyles:
110
+ - case
111
+ - end
112
+ IndentOneStep: false
113
+
114
+ Style/CharacterLiteral:
115
+ Enabled: true
116
+
117
+ Style/ClassAndModuleCamelCase:
118
+ Enabled: true
119
+
120
+ Style/ClassAndModuleChildren:
121
+ Enabled: false
122
+ Exclude:
123
+ - 'test/**/*'
124
+ EnforcedStyle: nested
125
+ SupportedStyles:
126
+ - nested
127
+ - compact
128
+
129
+ Style/ClassCheck:
130
+ Enabled: true
131
+ EnforcedStyle: is_a?
132
+ SupportedStyles:
133
+ - is_a?
134
+ - kind_of?
135
+
136
+ Style/ClassMethods:
137
+ Enabled: true
138
+
139
+ Style/ClassVars:
140
+ Enabled: true
141
+
142
+ Style/ColonMethodCall:
143
+ Enabled: true
144
+
145
+ Style/CollectionMethods:
146
+ Enabled: true
147
+ PreferredMethods:
148
+ collect: 'map'
149
+ collect!: 'map!'
150
+ inject: 'reduce'
151
+ find: detect
152
+ find_all: 'select'
153
+
154
+ Style/CommentAnnotation:
155
+ Enabled: true
156
+ Keywords:
157
+ - TODO
158
+ - FIXME
159
+ - OPTIMIZE
160
+ - HACK
161
+ - REVIEW
162
+
163
+ Style/CommentIndentation:
164
+ Enabled: true
165
+
166
+ Style/ConstantName:
167
+ Enabled: true
168
+
169
+ Style/DefWithParentheses:
170
+ Enabled: true
171
+
172
+ Style/DeprecatedHashMethods:
173
+ Enabled: true
174
+
175
+ Style/Documentation:
176
+ Enabled: false
177
+
178
+ Style/DotPosition:
179
+ Enabled: true
180
+ EnforcedStyle: leading
181
+ SupportedStyles:
182
+ - leading
183
+ - trailing
184
+
185
+ Style/DoubleNegation:
186
+ Enabled: true
187
+
188
+ Style/EachWithObject:
189
+ Enabled: true
190
+
191
+ Style/EmptyElse:
192
+ Enabled: true
193
+
194
+ Style/ElseAlignment:
195
+ Enabled: true
196
+
197
+ Style/EmptyLineBetweenDefs:
198
+ Enabled: true
199
+ AllowAdjacentOneLineDefs: false
200
+
201
+ Style/EmptyLines:
202
+ Enabled: true
203
+
204
+ Style/EmptyLinesAroundAccessModifier:
205
+ Enabled: true
206
+
207
+ Style/EmptyLinesAroundBlockBody:
208
+ Enabled: true
209
+
210
+ Style/EmptyLinesAroundClassBody:
211
+ Enabled: true
212
+
213
+ Style/EmptyLinesAroundMethodBody:
214
+ Enabled: true
215
+
216
+ Style/EmptyLinesAroundModuleBody:
217
+ Enabled: true
218
+
219
+ Style/EmptyLiteral:
220
+ Enabled: true
221
+
222
+ Style/Encoding:
223
+ Enabled: false
224
+ EnforcedStyle: always
225
+ SupportedStyles:
226
+ - when_needed
227
+ - always
228
+
229
+ Style/EndBlock:
230
+ Enabled: true
231
+
232
+ Style/EndOfLine:
233
+ Enabled: true
234
+
235
+ Style/EvenOdd:
236
+ Enabled: true
237
+
238
+ Style/ExtraSpacing:
239
+ Enabled: false
240
+
241
+ Style/FileName:
242
+ Enabled: false
243
+ Exclude:
244
+ - '**/Rakefile'
245
+ - '**/Gemfile'
246
+ - '**/Capfile'
247
+ - '**/Vagrantfile'
248
+
249
+ Style/FirstParameterIndentation:
250
+ Enabled: true
251
+
252
+ Style/FlipFlop:
253
+ Enabled: true
254
+
255
+ Style/For:
256
+ Enabled: true
257
+ EnforcedStyle: each
258
+ SupportedStyles:
259
+ - for
260
+ - each
261
+
262
+ Style/FormatString:
263
+ Enabled: true
264
+ EnforcedStyle: format
265
+ SupportedStyles:
266
+ - format
267
+ - sprintf
268
+ - percent
269
+
270
+ Style/GlobalVars:
271
+ Enabled: true
272
+ AllowedVariables: []
273
+
274
+ Style/GuardClause:
275
+ Enabled: true
276
+ MinBodyLength: 1
277
+
278
+ Style/HashSyntax:
279
+ Enabled: true
280
+ EnforcedStyle: ruby19
281
+ SupportedStyles:
282
+ - ruby19
283
+ - hash_rockets
284
+
285
+ Style/IfUnlessModifier:
286
+ Enabled: true
287
+ MaxLineLength: 80
288
+
289
+ Style/IfWithSemicolon:
290
+ Enabled: true
291
+
292
+ Style/IndentationConsistency:
293
+ Enabled: true
294
+
295
+ Style/IndentationWidth:
296
+ Enabled: true
297
+
298
+ Style/IndentArray:
299
+ Enabled: true
300
+
301
+ Style/IndentHash:
302
+ Enabled: true
303
+ EnforcedStyle: special_inside_parentheses
304
+ SupportedStyles:
305
+ - special_inside_parentheses
306
+ - consistent
307
+
308
+ Style/InfiniteLoop:
309
+ Enabled: true
310
+
311
+ Style/Lambda:
312
+ Enabled: true
313
+
314
+ Style/LambdaCall:
315
+ Enabled: true
316
+ EnforcedStyle: call
317
+ SupportedStyles:
318
+ - call
319
+ - braces
320
+
321
+ Style/LeadingCommentSpace:
322
+ Enabled: true
323
+
324
+ Style/LineEndConcatenation:
325
+ Enabled: true
326
+
327
+ Style/MethodCallParentheses:
328
+ Enabled: true
329
+
330
+ Style/MethodDefParentheses:
331
+ Enabled: true
332
+ EnforcedStyle: require_parentheses
333
+ SupportedStyles:
334
+ - require_parentheses
335
+ - require_no_parentheses
336
+
337
+ Style/MethodName:
338
+ Enabled: true
339
+ EnforcedStyle: snake_case
340
+ SupportedStyles:
341
+ - snake_case
342
+ - camelCase
343
+
344
+ Style/ModuleFunction:
345
+ Enabled: true
346
+
347
+ Style/MultilineBlockChain:
348
+ Enabled: true
349
+
350
+ Style/MultilineBlockLayout:
351
+ Enabled: true
352
+
353
+ Style/MultilineIfThen:
354
+ Enabled: true
355
+
356
+ Style/MultilineTernaryOperator:
357
+ Enabled: true
358
+
359
+ Style/MultilineOperationIndentation:
360
+ Enabled: false
361
+
362
+ Style/NegatedIf:
363
+ Enabled: true
364
+
365
+ Style/NegatedWhile:
366
+ Enabled: true
367
+
368
+ Style/NestedTernaryOperator:
369
+ Enabled: true
370
+
371
+ Style/Next:
372
+ Enabled: true
373
+ EnforcedStyle: skip_modifier_ifs
374
+ MinBodyLength: 1
375
+ SupportedStyles:
376
+ - skip_modifier_ifs
377
+ - always
378
+
379
+ Style/NegatedIf:
380
+ Enabled: true
381
+
382
+ Style/NegatedWhile:
383
+ Enabled: true
384
+
385
+ Style/NestedTernaryOperator:
386
+ Enabled: true
387
+
388
+ Style/Next:
389
+ Enabled: true
390
+
391
+ Style/NilComparison:
392
+ Enabled: true
393
+
394
+ Style/NonNilCheck:
395
+ Enabled: true
396
+ IncludeSemanticChanges: false
397
+
398
+ Style/Not:
399
+ Enabled: true
400
+
401
+ Style/NumericLiterals:
402
+ Enabled: true
403
+ MinDigits: 5
404
+
405
+ Style/OneLineConditional:
406
+ Enabled: true
407
+
408
+ Style/OpMethod:
409
+ Enabled: true
410
+
411
+ Style/ParenthesesAroundCondition:
412
+ Enabled: true
413
+ AllowSafeAssignment: true
414
+
415
+ Style/PercentLiteralDelimiters:
416
+ Enabled: true
417
+ PreferredDelimiters:
418
+ '%': ()
419
+ '%i': ()
420
+ '%q': ()
421
+ '%Q': ()
422
+ '%r': '{}'
423
+ '%s': ()
424
+ '%w': ()
425
+ '%W': ()
426
+ '%x': ()
427
+
428
+ Style/PercentQLiterals:
429
+ Enabled: true
430
+ EnforcedStyle: lower_case_q
431
+ SupportedStyles:
432
+ - lower_case_q # Use %q when possible, %Q when necessary
433
+ - upper_case_q # Always use %Q
434
+
435
+ Style/PerlBackrefs:
436
+ Enabled: true
437
+
438
+ Style/PredicateName:
439
+ Enabled: true
440
+ NamePrefixBlacklist:
441
+ - is_
442
+ - has_
443
+ - have_
444
+
445
+ Style/Proc:
446
+ Enabled: true
447
+
448
+ Style/RaiseArgs:
449
+ Enabled: true
450
+ EnforcedStyle: exploded
451
+ SupportedStyles:
452
+ - compact # raise Exception.new(msg)
453
+ - exploded # raise Exception, msg
454
+
455
+ Style/RedundantBegin:
456
+ Enabled: true
457
+
458
+ Style/RedundantException:
459
+ Enabled: true
460
+
461
+ Style/RedundantReturn:
462
+ Enabled: true
463
+ AllowMultipleReturnValues: false
464
+
465
+ Style/RedundantSelf:
466
+ Enabled: true
467
+
468
+ Style/RegexpLiteral:
469
+ Enabled: true
470
+ MaxSlashes: 1
471
+
472
+ Style/RescueModifier:
473
+ Enabled: true
474
+
475
+ Style/SelfAssignment:
476
+ Enabled: true
477
+
478
+ Style/Semicolon:
479
+ Enabled: true
480
+ AllowAsExpressionSeparator: false
481
+
482
+ Style/SignalException:
483
+ Enabled: true
484
+ EnforcedStyle: semantic
485
+ SupportedStyles:
486
+ - only_raise
487
+ - only_fail
488
+ - semantic
489
+
490
+ Style/SingleLineBlockParams:
491
+ Enabled: true
492
+ Methods:
493
+ - reduce:
494
+ - a
495
+ - e
496
+ - inject:
497
+ - a
498
+ - e
499
+
500
+ Style/SingleLineMethods:
501
+ Enabled: true
502
+ AllowIfMethodIsEmpty: true
503
+
504
+ Style/SpaceAroundBlockParameters:
505
+ Enabled: true
506
+
507
+ Style/SpaceAroundEqualsInParameterDefault:
508
+ EnforcedStyle: space
509
+ SupportedStyles:
510
+ - space
511
+ - no_space
512
+
513
+ Style/SingleSpaceBeforeFirstArg:
514
+ Enabled: true
515
+
516
+ Style/SpaceAfterColon:
517
+ Enabled: true
518
+
519
+ Style/SpaceAfterComma:
520
+ Enabled: true
521
+
522
+ Style/SpaceAfterControlKeyword:
523
+ Enabled: true
524
+
525
+ Style/SpaceAfterMethodName:
526
+ Enabled: true
527
+
528
+ Style/SpaceAfterNot:
529
+ Enabled: true
530
+
531
+ Style/SpaceAfterSemicolon:
532
+ Enabled: true
533
+
534
+ Style/SpaceBeforeBlockBraces:
535
+ Enabled: true
536
+ EnforcedStyle: space
537
+ SupportedStyles:
538
+ - space
539
+ - no_space
540
+
541
+ Style/SpaceBeforeComma:
542
+ Enabled: true
543
+
544
+ Style/SpaceBeforeComment:
545
+ Enabled: true
546
+
547
+ Style/SpaceBeforeSemicolon:
548
+ Enabled: true
549
+
550
+ Style/SpaceInsideBlockBraces:
551
+ Enabled: true
552
+ EnforcedStyle: space
553
+ SupportedStyles:
554
+ - space
555
+ - no_space
556
+ EnforcedStyleForEmptyBraces: no_space
557
+ SpaceBeforeBlockParameters: true
558
+
559
+ Style/SpaceAroundEqualsInParameterDefault:
560
+ Enabled: true
561
+
562
+ Style/SpaceAroundOperators:
563
+ Enabled: true
564
+
565
+ Style/SpaceBeforeModifierKeyword:
566
+ Enabled: true
567
+
568
+ Style/SpaceInsideBrackets:
569
+ Enabled: true
570
+
571
+ Style/SpaceInsideHashLiteralBraces:
572
+ Enabled: true
573
+ EnforcedStyle: space
574
+ EnforcedStyleForEmptyBraces: no_space
575
+ SupportedStyles:
576
+ - space
577
+ - no_space
578
+
579
+ Style/SpaceInsideParens:
580
+ Enabled: true
581
+
582
+ Style/SpaceInsideRangeLiteral:
583
+ Enabled: true
584
+
585
+ Style/SpecialGlobalVars:
586
+ Enabled: true
587
+
588
+ Style/StringLiterals:
589
+ Enabled: true
590
+ EnforcedStyle: single_quotes
591
+ SupportedStyles:
592
+ - single_quotes
593
+ - double_quotes
594
+
595
+ Style/StringLiteralsInInterpolation:
596
+ Enabled: true
597
+
598
+ Style/StructInheritance:
599
+ Enabled: true
600
+
601
+ Style/SymbolProc:
602
+ Enabled: true
603
+
604
+ Style/Tab:
605
+ Enabled: true
606
+
607
+ Style/TrailingBlankLines:
608
+ Enabled: true
609
+ EnforcedStyle: final_newline
610
+ SupportedStyles:
611
+ - final_newline
612
+ - final_blank_line
613
+
614
+ Style/TrailingComma:
615
+ Enabled: true
616
+ EnforcedStyleForMultiline: no_comma
617
+ SupportedStyles:
618
+ - comma
619
+ - no_comma
620
+
621
+ Style/TrailingWhitespace:
622
+ Enabled: true
623
+
624
+ Style/TrivialAccessors:
625
+ Enabled: true
626
+ ExactNameMatch: false
627
+ AllowPredicates: false
628
+ AllowDSLWriters: false
629
+ Whitelist:
630
+ - to_ary
631
+ - to_a
632
+ - to_c
633
+ - to_enum
634
+ - to_h
635
+ - to_hash
636
+ - to_i
637
+ - to_int
638
+ - to_io
639
+ - to_open
640
+ - to_path
641
+ - to_proc
642
+ - to_r
643
+ - to_regexp
644
+ - to_str
645
+ - to_s
646
+ - to_sym
647
+
648
+ Style/UnlessElse:
649
+ Enabled: true
650
+
651
+ Style/UnneededCapitalW:
652
+ Enabled: true
653
+
654
+ Style/UnneededPercentQ:
655
+ Enabled: true
656
+
657
+ Style/UnneededPercentX:
658
+ Enabled: true
659
+
660
+ Style/VariableInterpolation:
661
+ Enabled: true
662
+
663
+ Style/VariableName:
664
+ Enabled: true
665
+ EnforcedStyle: snake_case
666
+ SupportedStyles:
667
+ - snake_case
668
+ - camelCase
669
+
670
+ Style/WhenThen:
671
+ Enabled: true
672
+
673
+ Style/WhileUntilDo:
674
+ Enabled: true
675
+
676
+ Style/WhileUntilModifier:
677
+ Enabled: true
678
+ MaxLineLength: 80
679
+
680
+ Style/WordArray:
681
+ Enabled: true
682
+ MinSize: 0
683
+
684
+ Style/InlineComment:
685
+ Enabled: false
686
+
687
+ Style/MethodCalledOnDoEndBlock:
688
+ Enabled: false
689
+
690
+ Style/SymbolArray:
691
+ Enabled: false
692
+
693
+ ################################################################
694
+ ##################### Metrics ##################################
695
+ ################################################################
696
+
697
+ Metrics/AbcSize:
698
+ Enabled: false
699
+
700
+ Metrics/BlockNesting:
701
+ Enabled: true
702
+ Max: 3
703
+
704
+ Metrics/ClassLength:
705
+ Exclude:
706
+ - 'test/**/*'
707
+ CountComments: false # count full line comments?
708
+ Max: 100
709
+
710
+ # Avoid complex methods.
711
+ Metrics/CyclomaticComplexity:
712
+ Enabled: true
713
+ Max: 6
714
+
715
+ Metrics/LineLength:
716
+ Max: 80
717
+ AllowURI: true
718
+ Enabled: false
719
+
720
+ Metrics/MethodLength:
721
+ Enabled: true
722
+ CountComments: false # count full line comments?
723
+ Max: 10
724
+
725
+ Metrics/ParameterLists:
726
+ Enabled: true
727
+ Max: 5
728
+ CountKeywordArgs: true
729
+
730
+ Metrics/PerceivedComplexity:
731
+ Enabled: true
732
+ Max: 7
733
+
734
+ #############################################################
735
+ ##################### Lint ##################################
736
+ #############################################################
737
+
738
+ Lint/AmbiguousOperator:
739
+ Enabled: true
740
+
741
+ Lint/AmbiguousRegexpLiteral:
742
+ Enabled: true
743
+
744
+ Lint/AssignmentInCondition:
745
+ AllowSafeAssignment: true
746
+ Enabled: true
747
+
748
+ Lint/BlockAlignment:
749
+ Enabled: true
750
+
751
+ Lint/ConditionPosition:
752
+ Enabled: true
753
+
754
+ Lint/Debugger:
755
+ Enabled: true
756
+
757
+ Lint/DefEndAlignment:
758
+ AlignWith: start_of_line
759
+ SupportedStyles:
760
+ - start_of_line
761
+ - def
762
+ Enabled: true
763
+
764
+ Lint/DeprecatedClassMethods:
765
+ Enabled: true
766
+
767
+ Lint/DuplicateMethods:
768
+ Enabled: true
769
+
770
+ Lint/ElseLayout:
771
+ Enabled: true
772
+
773
+ Lint/EmptyEnsure:
774
+ Enabled: true
775
+
776
+ Lint/EmptyInterpolation:
777
+ Enabled: true
778
+
779
+ Lint/EndAlignment:
780
+ AlignWith: keyword
781
+ SupportedStyles:
782
+ - keyword
783
+ - variable
784
+ Enabled: true
785
+
786
+ Lint/EndInMethod:
787
+ Enabled: true
788
+
789
+ Lint/EnsureReturn:
790
+ Enabled: true
791
+
792
+ Lint/Eval:
793
+ Enabled: true
794
+
795
+ Lint/HandleExceptions:
796
+ Enabled: true
797
+
798
+ Lint/InvalidCharacterLiteral:
799
+ Enabled: true
800
+
801
+ Lint/LiteralInCondition:
802
+ Enabled: true
803
+
804
+ Lint/LiteralInInterpolation:
805
+ Enabled: true
806
+
807
+ Lint/Loop:
808
+ Enabled: true
809
+
810
+ Lint/ParenthesesAsGroupedExpression:
811
+ Enabled: true
812
+
813
+ Lint/RequireParentheses:
814
+ Enabled: true
815
+
816
+ Lint/RescueException:
817
+ Enabled: true
818
+
819
+ Lint/ShadowingOuterLocalVariable:
820
+ Enabled: true
821
+
822
+ Lint/SpaceBeforeFirstArg:
823
+ Enabled: true
824
+
825
+ Lint/StringConversionInInterpolation:
826
+ Enabled: true
827
+
828
+ Lint/UnderscorePrefixedVariableName:
829
+ Enabled: true
830
+
831
+ Lint/UnusedBlockArgument:
832
+ Enabled: true
833
+
834
+ Lint/UnusedMethodArgument:
835
+ Enabled: true
836
+
837
+ Lint/UnreachableCode:
838
+ Enabled: true
839
+
840
+ Lint/UselessAccessModifier:
841
+ Enabled: true
842
+
843
+ Lint/UselessAssignment:
844
+ Enabled: true
845
+
846
+ Lint/UselessComparison:
847
+ Enabled: true
848
+
849
+ Lint/UselessElseWithoutRescue:
850
+ Enabled: true
851
+
852
+ Lint/UselessSetterCall:
853
+ Enabled: true
854
+
855
+ Lint/Void:
856
+ Enabled: true
857
+
858
+ ##############################################################
859
+ ##################### Rails ##################################
860
+ ##############################################################
861
+
862
+ Rails/ActionFilter:
863
+ Enabled: true
864
+ EnforcedStyle: action
865
+ SupportedStyles:
866
+ - action
867
+ - filter
868
+ Include:
869
+ - app/controllers/**/*.rb
870
+
871
+ Rails/DefaultScope:
872
+ Enabled: true
873
+ Include:
874
+ - app/models/**/*.rb
875
+
876
+ Rails/Delegate:
877
+ Enabled: true
878
+
879
+ Rails/HasAndBelongsToMany:
880
+ Enabled: true
881
+ Include:
882
+ - app/models/**/*.rb
883
+
884
+ Rails/Output:
885
+ Enabled: true
886
+ Include:
887
+ - app/**/*.rb
888
+ - config/**/*.rb
889
+ - db/**/*.rb
890
+ - lib/**/*.rb
891
+
892
+ Rails/ReadWriteAttribute:
893
+ Enabled: true
894
+ Include:
895
+ - app/models/**/*.rb
896
+
897
+ Rails/ScopeArgs:
898
+ Enabled: true
899
+ Include:
900
+ - app/models/**/*.rb
901
+
902
+ Rails/Validation:
903
+ Enabled: true
904
+ Include:
905
+ - app/models/**/*.rb
data/esp_sdk.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'mocha', '~> 1.1.0'
28
28
  spec.add_development_dependency 'fakeweb', '~> 1.3'
29
29
 
30
- spec.add_runtime_dependency 'activesupport', '~> 4.1.6'
30
+ spec.add_runtime_dependency 'activesupport', '>= 3.0.0'
31
31
  spec.add_runtime_dependency 'rest_client', '~> 1.7.3'
32
32
  spec.add_runtime_dependency 'pry', '~> 0.10.1'
33
33
  spec.add_runtime_dependency 'awesome_print', '~> 1.2.0'
@@ -1,32 +1,36 @@
1
1
  module EspSdk
2
2
  class Configure
3
- attr_accessor :token, :email, :version, :token_expires_at
3
+ attr_accessor :token, :email, :version, :token_expires_at, :end_point, :domain
4
4
 
5
5
  def initialize(options)
6
- @email = options[:email]
7
- @version = options[:version] || 'v1'
8
- token_setup(options)
6
+ self.email = options[:email]
7
+ self.version = options[:version] || 'v1'
8
+ self.domain = options[:domain]
9
+ self.token = options[:password] || options[:token]
10
+ self.end_point = options[:password].present? ? 'new' : 'valid'
11
+ token_setup
9
12
  end
10
13
 
11
- def uri
12
- return @uri if @uri.present?
14
+ def url(endpoint)
15
+ "#{domain}/api/#{version}/#{endpoint}"
16
+ end
13
17
 
18
+ def domain
19
+ return @domain if @domain.present?
14
20
  if EspSdk.production?
15
- @uri = 'https://api.evident.io/api'
21
+ self.domain = 'https://api.evident.io'
16
22
  elsif EspSdk.release?
17
- @uri = 'https://api-rel.evident.io/api'
23
+ self.domain = 'https://api-rel.evident.io'
18
24
  else
19
- @uri = 'http://0.0.0.0:3000/api'
25
+ self.domain = 'http://0.0.0.0:3000'
20
26
  end
21
27
  end
22
28
 
23
29
  private
24
30
 
25
- def token_setup(options)
26
- self.token = options[:password] || options[:token]
27
- end_point = options[:password].present? ? 'new' : 'valid'
31
+ def token_setup
28
32
  client = Client.new(self)
29
- response = client.connect("#{uri}/#{version}/token/#{end_point}")
33
+ response = client.connect(url("token/#{end_point}"))
30
34
  user = JSON.load(response.body)
31
35
  self.token = user['authentication_token']
32
36
  self.token_expires_at = user['token_expires_at'].to_s.to_datetime.utc ||
@@ -70,7 +70,7 @@ module EspSdk
70
70
  end
71
71
 
72
72
  def base_url
73
- "#{config.uri}/#{config.version}/#{self.class.to_s.demodulize.underscore}"
73
+ config.url(self.class.to_s.demodulize.underscore)
74
74
  end
75
75
 
76
76
  def submit(url, type, options = {})
@@ -1,3 +1,3 @@
1
1
  module EspSdk
2
- VERSION = '1.0.6'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -5,17 +5,17 @@ class ApiTest < ActiveSupport::TestCase
5
5
  context '#initalize' do
6
6
  should 'raise a MissingAttribute error for a missing email' do
7
7
  e = assert_raises EspSdk::MissingAttribute do
8
- EspSdk::Api.new({ })
8
+ EspSdk::Api.new()
9
9
  end
10
- assert_equal 'Missing required email', e.message
11
10
 
11
+ assert_equal 'Missing required email', e.message
12
12
  end
13
13
  should 'raise a MissingAttribute error for a missing token and password' do
14
14
  e = assert_raises EspSdk::MissingAttribute do
15
15
  EspSdk::Api.new(email: 'test@evident.io')
16
16
  end
17
- assert_equal 'Missing required password', e.message
18
17
 
18
+ assert_equal 'Missing required password', e.message
19
19
  end
20
20
 
21
21
  should 'define our endpoint methods and add them to the end_points array' do
@@ -5,44 +5,60 @@ class ConfigureTest < ActiveSupport::TestCase
5
5
  setup do
6
6
  # Stub the setup token method
7
7
  EspSdk::Configure.any_instance.expects(:token_setup).returns(nil).at_least_once
8
- @config = EspSdk::Configure.new({email: 'test@test.com', token: 'token'})
8
+ @config = EspSdk::Configure.new(email: 'test@test.com', token: 'token')
9
9
  end
10
10
 
11
11
  context '#initialize' do
12
12
  should 'set a default version of v1' do
13
13
  assert_equal 'v1', @config.version
14
14
  end
15
+
16
+ should 'should setup the token and token and expires at' do
17
+ EspSdk::Configure.any_instance.unstub(:token_setup)
18
+ FakeWeb.register_uri(:get, %r{api/v1/token/new},
19
+ body: { authentication_token: 'token',
20
+ token_expires_at: 1.hour.from_now }.to_json)
21
+
22
+ config = EspSdk::Configure.new(email: 'test@test.com', password: 'password1234')
23
+
24
+ assert_not_nil config.token
25
+ assert_not_nil config.token_expires_at
26
+ end
27
+ end
28
+
29
+ context 'url' do
30
+ should 'return domain with api/version/end_point' do
31
+ @config = EspSdk::Configure.new(email: 'test@test.com', token: 'token', domain: 'https://test.domain.com', version: 'v4')
32
+
33
+ assert_equal 'https://test.domain.com/api/v4/users', @config.url('users')
34
+ end
15
35
  end
16
36
 
17
- context '#uri' do
37
+ context '#domain' do
38
+ should 'return custom URI when the URI is passed in' do
39
+ @config = EspSdk::Configure.new(email: 'test@test.com', token: 'token', domain: 'https://test.domain.com')
40
+
41
+ assert_equal 'https://test.domain.com', @config.domain
42
+ end
43
+
18
44
  should 'return the production URI when the environment is production' do
19
45
  EspSdk.expects(:production?).returns(true)
20
- assert_equal 'https://api.evident.io/api', @config.uri
46
+
47
+ assert_equal 'https://api.evident.io', @config.domain
21
48
  end
22
49
 
23
50
  should 'return the release URI when the environment is release' do
24
51
  EspSdk.expects(:production?).returns(false)
25
52
  EspSdk.expects(:release?).returns(true)
26
- assert_equal 'https://api-rel.evident.io/api', @config.uri
53
+
54
+ assert_equal 'https://api-rel.evident.io', @config.domain
27
55
  end
28
56
 
29
57
  should 'return the development URI when the environment is not release or production' do
30
58
  EspSdk.expects(:production?).returns(false)
31
59
  EspSdk.expects(:release?).returns(false)
32
- assert_equal 'http://0.0.0.0:3000/api', @config.uri
33
- end
34
- end
35
-
36
- context '#token_setup' do
37
- setup { EspSdk::Configure.any_instance.unstub(:token_setup) }
38
60
 
39
- should 'should set the token and token and expires at' do
40
- FakeWeb.register_uri(:get, /api\/v1\/token\/new/,
41
- :body => { authentication_token: 'token',
42
- token_expires_at: 1.hour.from_now }.to_json)
43
- @config.send(:token_setup, { password: 'password1234' })
44
- assert_not_nil @config.token
45
- assert_not_nil @config.token_expires_at
61
+ assert_equal 'http://0.0.0.0:3000', @config.domain
46
62
  end
47
63
  end
48
64
  end
data/test/test_helper.rb CHANGED
@@ -5,8 +5,8 @@ CodeClimate::TestReporter.start
5
5
  require 'esp_sdk'
6
6
  require 'minitest/autorun'
7
7
  require 'minitest/reporters'
8
+ require 'mocha/mini_test'
8
9
  require 'shoulda'
9
- require 'mocha'
10
10
  require 'fakeweb'
11
11
  require 'awesome_print'
12
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esp_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evident.io
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-29 00:00:00.000000000 Z
11
+ date: 2015-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -140,16 +140,16 @@ dependencies:
140
140
  name: activesupport
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: 4.1.6
145
+ version: 3.0.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: 4.1.6
152
+ version: 3.0.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rest_client
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -215,6 +215,8 @@ extensions: []
215
215
  extra_rdoc_files: []
216
216
  files:
217
217
  - ".gitignore"
218
+ - ".hound.yml"
219
+ - ".rubocop.yml"
218
220
  - ".ruby-gemset"
219
221
  - ".ruby-version"
220
222
  - ".travis.yml"
@@ -276,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
278
  version: '0'
277
279
  requirements: []
278
280
  rubyforge_project:
279
- rubygems_version: 2.4.5
281
+ rubygems_version: 2.2.2
280
282
  signing_key:
281
283
  specification_version: 4
282
284
  summary: SDK for interacting with the ESP API.