lifx-faraday 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: da6087bdfb50b85e2a022615943b1c5b37370e7b
4
+ data.tar.gz: f5dd45f34212a17a7587faf3a86a68734e70e962
5
+ SHA512:
6
+ metadata.gz: 5ad3246440ddb0c680c385376362fa2bdb1243f46b5bcc6923556ae70c827f9569833516f69b1a047f3b2d5f672d4dcb47d4d6967ca05d91e2dc2029f9197175
7
+ data.tar.gz: a8ab8998bbc7593602088992eda69f2614fed40286ad0e52d2e5eaeff0b322ec0bfee60e44d402ee3445ea27391f38128b27c015d1fde7d33e0621a8ea85a6d7
data/.gitignore ADDED
@@ -0,0 +1,53 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ Gemfile.lock
46
+ .ruby-version
47
+ .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
51
+
52
+ # RubyMine
53
+ .idea/**/*
data/.rubocop.yml ADDED
@@ -0,0 +1,20 @@
1
+ inherit_from: .thoughtbot_rubocop.yml
2
+
3
+ AllCops:
4
+ Exclude:
5
+ - 'vendor/**/*'
6
+
7
+ Metrics/LineLength:
8
+ Max: 120
9
+
10
+ Documentation:
11
+ Enabled: false
12
+
13
+ Style/StringLiterals:
14
+ Description: Checks if uses of quotes match the configured preference.
15
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
16
+ Enabled: true
17
+ EnforcedStyle: single_quotes
18
+ SupportedStyles:
19
+ - single_quotes
20
+ - double_quotes
@@ -0,0 +1,629 @@
1
+ AllCops:
2
+ Exclude:
3
+ - db/schema.rb
4
+
5
+ Style/AccessorMethodName:
6
+ Description: Check the naming of accessor methods for get_/set_.
7
+ Enabled: false
8
+
9
+ Style/Alias:
10
+ Description: 'Use alias_method instead of alias.'
11
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
12
+ Enabled: false
13
+
14
+ Style/AlignParameters:
15
+ Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
16
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
17
+ Enabled: false
18
+
19
+ Style/ArrayJoin:
20
+ Description: 'Use Array#join instead of Array#*.'
21
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
22
+ Enabled: false
23
+
24
+ Style/AsciiComments:
25
+ Description: 'Use only ascii symbols in comments.'
26
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
27
+ Enabled: false
28
+
29
+ Style/AsciiIdentifiers:
30
+ Description: 'Use only ascii symbols in identifiers.'
31
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
32
+ Enabled: false
33
+
34
+ Style/Attr:
35
+ Description: 'Checks for uses of Module#attr.'
36
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
37
+ Enabled: false
38
+
39
+ Metrics/BlockNesting:
40
+ Description: 'Avoid excessive block nesting'
41
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
42
+ Enabled: false
43
+
44
+ Style/CaseEquality:
45
+ Description: 'Avoid explicit use of the case equality operator(===).'
46
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
47
+ Enabled: false
48
+
49
+ Style/CharacterLiteral:
50
+ Description: 'Checks for uses of character literals.'
51
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
52
+ Enabled: false
53
+
54
+ Style/ClassAndModuleChildren:
55
+ Description: 'Checks style of children classes and modules.'
56
+ Enabled: true
57
+ EnforcedStyle: nested
58
+
59
+ Metrics/ClassLength:
60
+ Description: 'Avoid classes longer than 100 lines of code.'
61
+ Enabled: false
62
+
63
+ Metrics/ModuleLength:
64
+ Description: 'Avoid modules longer than 100 lines of code.'
65
+ Enabled: false
66
+
67
+ Style/ClassVars:
68
+ Description: 'Avoid the use of class variables.'
69
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
70
+ Enabled: false
71
+
72
+ Style/CollectionMethods:
73
+ Enabled: true
74
+ PreferredMethods:
75
+ find: detect
76
+ inject: reduce
77
+ collect: map
78
+ find_all: select
79
+
80
+ Style/ColonMethodCall:
81
+ Description: 'Do not use :: for method call.'
82
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
83
+ Enabled: false
84
+
85
+ Style/CommentAnnotation:
86
+ Description: >-
87
+ Checks formatting of special comments
88
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
89
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
90
+ Enabled: false
91
+
92
+ Metrics/AbcSize:
93
+ Description: >-
94
+ A calculated magnitude based on number of assignments,
95
+ branches, and conditions.
96
+ Enabled: false
97
+
98
+ Metrics/CyclomaticComplexity:
99
+ Description: >-
100
+ A complexity metric that is strongly correlated to the number
101
+ of test cases needed to validate a method.
102
+ Enabled: false
103
+
104
+ Rails/Delegate:
105
+ Description: 'Prefer delegate method for delegations.'
106
+ Enabled: false
107
+
108
+ Style/PreferredHashMethods:
109
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
110
+ StyleGuide: '#hash-key'
111
+ Enabled: false
112
+
113
+ Style/Documentation:
114
+ Description: 'Document classes and non-namespace modules.'
115
+ Enabled: false
116
+
117
+ Style/DotPosition:
118
+ Description: 'Checks the position of the dot in multi-line method calls.'
119
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
120
+ EnforcedStyle: trailing
121
+
122
+ Style/DoubleNegation:
123
+ Description: 'Checks for uses of double negation (!!).'
124
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
125
+ Enabled: false
126
+
127
+ Style/EachWithObject:
128
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
129
+ Enabled: false
130
+
131
+ Style/EmptyLiteral:
132
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
133
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
134
+ Enabled: false
135
+
136
+ # Checks whether the source file has a utf-8 encoding comment or not
137
+ # AutoCorrectEncodingComment must match the regex
138
+ # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
139
+ Style/Encoding:
140
+ Enabled: false
141
+
142
+ Style/EvenOdd:
143
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
144
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
145
+ Enabled: false
146
+
147
+ Style/ExtraSpacing:
148
+ Description: 'Do not use unnecessary spacing.'
149
+ Enabled: true
150
+
151
+ Style/FileName:
152
+ Description: 'Use snake_case for source file names.'
153
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
154
+ Enabled: false
155
+
156
+ Style/FrozenStringLiteralComment:
157
+ Description: >-
158
+ Add the frozen_string_literal comment to the top of files
159
+ to help transition from Ruby 2.3.0 to Ruby 3.0.
160
+ Enabled: false
161
+
162
+ Style/FlipFlop:
163
+ Description: 'Checks for flip flops'
164
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
165
+ Enabled: false
166
+
167
+ Style/FormatString:
168
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
169
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
170
+ Enabled: false
171
+
172
+ Style/GlobalVars:
173
+ Description: 'Do not introduce global variables.'
174
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
175
+ Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
176
+ Enabled: false
177
+
178
+ Style/GuardClause:
179
+ Description: 'Check for conditionals that can be replaced with guard clauses'
180
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
181
+ Enabled: false
182
+
183
+ Style/IfUnlessModifier:
184
+ Description: >-
185
+ Favor modifier if/unless usage when you have a
186
+ single-line body.
187
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
188
+ Enabled: false
189
+
190
+ Style/IfWithSemicolon:
191
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
192
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
193
+ Enabled: false
194
+
195
+ Style/InlineComment:
196
+ Description: 'Avoid inline comments.'
197
+ Enabled: false
198
+
199
+ Style/Lambda:
200
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
201
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
202
+ Enabled: false
203
+
204
+ Style/LambdaCall:
205
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
206
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
207
+ Enabled: false
208
+
209
+ Style/LineEndConcatenation:
210
+ Description: >-
211
+ Use \ instead of + or << to concatenate two string literals at
212
+ line end.
213
+ Enabled: false
214
+
215
+ Metrics/LineLength:
216
+ Description: 'Limit lines to 80 characters.'
217
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
218
+ Max: 80
219
+
220
+ Metrics/MethodLength:
221
+ Description: 'Avoid methods longer than 10 lines of code.'
222
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
223
+ Enabled: false
224
+
225
+ Style/ModuleFunction:
226
+ Description: 'Checks for usage of `extend self` in modules.'
227
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
228
+ Enabled: false
229
+
230
+ Style/MultilineOperationIndentation:
231
+ Description: >-
232
+ Checks indentation of binary operations that span more than
233
+ one line.
234
+ Enabled: true
235
+ EnforcedStyle: indented
236
+
237
+ Style/MultilineBlockChain:
238
+ Description: 'Avoid multi-line chains of blocks.'
239
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
240
+ Enabled: false
241
+
242
+ Style/MultilineMethodCallIndentation:
243
+ Description: >-
244
+ Checks indentation of method calls with the dot operator
245
+ that span more than one line.
246
+ Enabled: true
247
+ EnforcedStyle: indented
248
+
249
+ Style/NegatedIf:
250
+ Description: >-
251
+ Favor unless over if for negative conditions
252
+ (or control flow or).
253
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
254
+ Enabled: false
255
+
256
+ Style/NegatedWhile:
257
+ Description: 'Favor until over while for negative conditions.'
258
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
259
+ Enabled: false
260
+
261
+ Style/Next:
262
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
263
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
264
+ Enabled: false
265
+
266
+ Style/NilComparison:
267
+ Description: 'Prefer x.nil? to x == nil.'
268
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
269
+ Enabled: false
270
+
271
+ Style/Not:
272
+ Description: 'Use ! instead of not.'
273
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
274
+ Enabled: false
275
+
276
+ Style/NumericLiterals:
277
+ Description: >-
278
+ Add underscores to large numeric literals to improve their
279
+ readability.
280
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
281
+ Enabled: false
282
+
283
+ Style/OneLineConditional:
284
+ Description: >-
285
+ Favor the ternary operator(?:) over
286
+ if/then/else/end constructs.
287
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
288
+ Enabled: false
289
+
290
+ Style/OpMethod:
291
+ Description: 'When defining binary operators, name the argument other.'
292
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
293
+ Enabled: false
294
+
295
+ Metrics/ParameterLists:
296
+ Description: 'Avoid parameter lists longer than three or four parameters.'
297
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
298
+ Enabled: false
299
+
300
+ Style/PercentLiteralDelimiters:
301
+ Description: 'Use `%`-literal delimiters consistently'
302
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
303
+ Enabled: false
304
+
305
+ Style/PerlBackrefs:
306
+ Description: 'Avoid Perl-style regex back references.'
307
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
308
+ Enabled: false
309
+
310
+ Style/PredicateName:
311
+ Description: 'Check the names of predicate methods.'
312
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
313
+ NamePrefixBlacklist:
314
+ - is_
315
+ Exclude:
316
+ - spec/**/*
317
+
318
+ Style/Proc:
319
+ Description: 'Use proc instead of Proc.new.'
320
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
321
+ Enabled: false
322
+
323
+ Style/RaiseArgs:
324
+ Description: 'Checks the arguments passed to raise/fail.'
325
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
326
+ Enabled: false
327
+
328
+ Style/RegexpLiteral:
329
+ Description: 'Use / or %r around regular expressions.'
330
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
331
+ Enabled: false
332
+
333
+ Style/SelfAssignment:
334
+ Description: >-
335
+ Checks for places where self-assignment shorthand should have
336
+ been used.
337
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
338
+ Enabled: false
339
+
340
+ Style/SingleLineBlockParams:
341
+ Description: 'Enforces the names of some block params.'
342
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
343
+ Enabled: false
344
+
345
+ Style/SingleLineMethods:
346
+ Description: 'Avoid single-line methods.'
347
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
348
+ Enabled: false
349
+
350
+ Style/SignalException:
351
+ Description: 'Checks for proper usage of fail and raise.'
352
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
353
+ Enabled: false
354
+
355
+ Style/SpecialGlobalVars:
356
+ Description: 'Avoid Perl-style global variables.'
357
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
358
+ Enabled: false
359
+
360
+ Style/StringLiterals:
361
+ Description: 'Checks if uses of quotes match the configured preference.'
362
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
363
+ EnforcedStyle: double_quotes
364
+ Enabled: true
365
+
366
+ Style/TrailingCommaInArguments:
367
+ Description: 'Checks for trailing comma in argument lists.'
368
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
369
+ EnforcedStyleForMultiline: comma
370
+ Enabled: true
371
+
372
+ Style/TrailingCommaInLiteral:
373
+ Description: 'Checks for trailing comma in array and hash literals.'
374
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
375
+ EnforcedStyleForMultiline: comma
376
+ Enabled: true
377
+
378
+ Style/TrivialAccessors:
379
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
380
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
381
+ Enabled: false
382
+
383
+ Style/VariableInterpolation:
384
+ Description: >-
385
+ Don't interpolate global, instance and class variables
386
+ directly in strings.
387
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
388
+ Enabled: false
389
+
390
+ Style/WhenThen:
391
+ Description: 'Use when x then ... for one-line cases.'
392
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
393
+ Enabled: false
394
+
395
+ Style/WhileUntilModifier:
396
+ Description: >-
397
+ Favor modifier while/until usage when you have a
398
+ single-line body.
399
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
400
+ Enabled: false
401
+
402
+ Style/WordArray:
403
+ Description: 'Use %w or %W for arrays of words.'
404
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
405
+ Enabled: false
406
+
407
+ # Lint
408
+
409
+ Lint/AmbiguousOperator:
410
+ Description: >-
411
+ Checks for ambiguous operators in the first argument of a
412
+ method invocation without parentheses.
413
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
414
+ Enabled: false
415
+
416
+ Lint/AmbiguousRegexpLiteral:
417
+ Description: >-
418
+ Checks for ambiguous regexp literals in the first argument of
419
+ a method invocation without parenthesis.
420
+ Enabled: false
421
+
422
+ Lint/AssignmentInCondition:
423
+ Description: "Don't use assignment in conditions."
424
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
425
+ Enabled: false
426
+
427
+ Lint/CircularArgumentReference:
428
+ Description: "Don't refer to the keyword argument in the default value."
429
+ Enabled: false
430
+
431
+ Lint/ConditionPosition:
432
+ Description: >-
433
+ Checks for condition placed in a confusing position relative to
434
+ the keyword.
435
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
436
+ Enabled: false
437
+
438
+ Lint/DeprecatedClassMethods:
439
+ Description: 'Check for deprecated class method calls.'
440
+ Enabled: false
441
+
442
+ Lint/DuplicatedKey:
443
+ Description: 'Check for duplicate keys in hash literals.'
444
+ Enabled: false
445
+
446
+ Lint/EachWithObjectArgument:
447
+ Description: 'Check for immutable argument given to each_with_object.'
448
+ Enabled: false
449
+
450
+ Lint/ElseLayout:
451
+ Description: 'Check for odd code arrangement in an else block.'
452
+ Enabled: false
453
+
454
+ Lint/FormatParameterMismatch:
455
+ Description: 'The number of parameters to format/sprint must match the fields.'
456
+ Enabled: false
457
+
458
+ Lint/HandleExceptions:
459
+ Description: "Don't suppress exception."
460
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
461
+ Enabled: false
462
+
463
+ Lint/InvalidCharacterLiteral:
464
+ Description: >-
465
+ Checks for invalid character literals with a non-escaped
466
+ whitespace character.
467
+ Enabled: false
468
+
469
+ Style/InitialIndentation:
470
+ Description: >-
471
+ Checks the indentation of the first non-blank non-comment line in a file.
472
+ Enabled: false
473
+
474
+ Lint/LiteralInCondition:
475
+ Description: 'Checks of literals used in conditions.'
476
+ Enabled: false
477
+
478
+ Lint/LiteralInInterpolation:
479
+ Description: 'Checks for literals used in interpolation.'
480
+ Enabled: false
481
+
482
+ Lint/Loop:
483
+ Description: >-
484
+ Use Kernel#loop with break rather than begin/end/until or
485
+ begin/end/while for post-loop tests.
486
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
487
+ Enabled: false
488
+
489
+ Lint/NestedMethodDefinition:
490
+ Description: 'Do not use nested method definitions.'
491
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
492
+ Enabled: false
493
+
494
+ Lint/NonLocalExitFromIterator:
495
+ Description: 'Do not use return in iterator to cause non-local exit.'
496
+ Enabled: false
497
+
498
+ Lint/ParenthesesAsGroupedExpression:
499
+ Description: >-
500
+ Checks for method calls with a space before the opening
501
+ parenthesis.
502
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
503
+ Enabled: false
504
+
505
+ Lint/RequireParentheses:
506
+ Description: >-
507
+ Use parentheses in the method call to avoid confusion
508
+ about precedence.
509
+ Enabled: false
510
+
511
+ Lint/UnderscorePrefixedVariableName:
512
+ Description: 'Do not use prefix `_` for a variable that is used.'
513
+ Enabled: false
514
+
515
+ Lint/UnneededDisable:
516
+ Description: >-
517
+ Checks for rubocop:disable comments that can be removed.
518
+ Note: this cop is not disabled when disabling all cops.
519
+ It must be explicitly disabled.
520
+ Enabled: false
521
+
522
+ Lint/Void:
523
+ Description: 'Possible use of operator/literal/variable in void context.'
524
+ Enabled: false
525
+
526
+ # Performance
527
+
528
+ Performance/CaseWhenSplat:
529
+ Description: >-
530
+ Place `when` conditions that use splat at the end
531
+ of the list of `when` branches.
532
+ Enabled: false
533
+
534
+ Performance/Count:
535
+ Description: >-
536
+ Use `count` instead of `select...size`, `reject...size`,
537
+ `select...count`, `reject...count`, `select...length`,
538
+ and `reject...length`.
539
+ Enabled: false
540
+
541
+ Performance/Detect:
542
+ Description: >-
543
+ Use `detect` instead of `select.first`, `find_all.first`,
544
+ `select.last`, and `find_all.last`.
545
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
546
+ Enabled: false
547
+
548
+ Performance/FlatMap:
549
+ Description: >-
550
+ Use `Enumerable#flat_map`
551
+ instead of `Enumerable#map...Array#flatten(1)`
552
+ or `Enumberable#collect..Array#flatten(1)`
553
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
554
+ Enabled: false
555
+
556
+ Performance/ReverseEach:
557
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
558
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
559
+ Enabled: false
560
+
561
+ Performance/Sample:
562
+ Description: >-
563
+ Use `sample` instead of `shuffle.first`,
564
+ `shuffle.last`, and `shuffle[Fixnum]`.
565
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
566
+ Enabled: false
567
+
568
+ Performance/Size:
569
+ Description: >-
570
+ Use `size` instead of `count` for counting
571
+ the number of elements in `Array` and `Hash`.
572
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
573
+ Enabled: false
574
+
575
+ Performance/StringReplacement:
576
+ Description: >-
577
+ Use `tr` instead of `gsub` when you are replacing the same
578
+ number of characters. Use `delete` instead of `gsub` when
579
+ you are deleting characters.
580
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
581
+ Enabled: false
582
+
583
+ # Rails
584
+
585
+ Rails/ActionFilter:
586
+ Description: 'Enforces consistent use of action filter methods.'
587
+ Enabled: false
588
+
589
+ Rails/Date:
590
+ Description: >-
591
+ Checks the correct usage of date aware methods,
592
+ such as Date.today, Date.current etc.
593
+ Enabled: false
594
+
595
+ Rails/FindBy:
596
+ Description: 'Prefer find_by over where.first.'
597
+ Enabled: false
598
+
599
+ Rails/FindEach:
600
+ Description: 'Prefer all.find_each over all.find.'
601
+ Enabled: false
602
+
603
+ Rails/HasAndBelongsToMany:
604
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
605
+ Enabled: false
606
+
607
+ Rails/Output:
608
+ Description: 'Checks for calls to puts, print, etc.'
609
+ Enabled: false
610
+
611
+ Rails/ReadWriteAttribute:
612
+ Description: >-
613
+ Checks for read_attribute(:attr) and
614
+ write_attribute(:attr, val).
615
+ Enabled: false
616
+
617
+ Rails/ScopeArgs:
618
+ Description: 'Checks the arguments of ActiveRecord scopes.'
619
+ Enabled: false
620
+
621
+ Rails/TimeZone:
622
+ Description: 'Checks the correct usage of time zone aware methods.'
623
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
624
+ Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
625
+ Enabled: false
626
+
627
+ Rails/Validation:
628
+ Description: 'Use validates :attribute, hash of validations.'
629
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Change Log
2
+
3
+
4
+
5
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://www.rubygems.org'
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Corey Alexander
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # lifx-faraday
2
+ LiFX API implemented using Faraday
@@ -0,0 +1,9 @@
1
+ module Api
2
+ class Connection < Module
3
+ def initialize(connection)
4
+ define_method 'connection' do
5
+ connection
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ module LifxFaraday
2
+ API = Faraday.new 'https://api.lifx.com/v1' do |c|
3
+ # Request
4
+ c.basic_auth(ENV.fetch('LIFX_TOKEN'), '')
5
+ c.use Faraday::Request::UrlEncoded
6
+
7
+ # Adapter
8
+ c.use Faraday::Adapter::NetHttp
9
+ end
10
+ end
@@ -0,0 +1,18 @@
1
+ module LifxFaraday
2
+ class Light
3
+ include Api::Connection.new LifxFaraday::API
4
+
5
+ def initialize(selector: 'all')
6
+ @selector = selector
7
+ end
8
+
9
+ def set_state(state_options)
10
+ raise 'needs a selector' unless selector && selector.to_s != ''
11
+ connection.put "lights/#{selector}/state", state_options
12
+ end
13
+
14
+ private
15
+
16
+ attr_reader :selector
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ module LifxFaraday
2
+ VERSION = '0.0.0'.freeze
3
+ end
@@ -0,0 +1,9 @@
1
+ ROOT = File.expand_path '..', __FILE__
2
+
3
+ require 'faraday'
4
+
5
+ require "#{ROOT}/api/connection"
6
+
7
+ require "#{ROOT}/lifx-faraday/version"
8
+ require "#{ROOT}/lifx-faraday/api"
9
+ require "#{ROOT}/lifx-faraday/light"
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ $:.push File.expand_path('../lib', __FILE__)
4
+ require 'lifx-faraday/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'lifx-faraday'
8
+ s.summary = 'LiFX API implemented using Faraday'
9
+ s.version = LifxFaraday::VERSION
10
+ s.author = 'Corey Alexander'
11
+ s.email = 'coreyja@gmail.com'
12
+ s.files = `git ls-files`.split("\n")
13
+ s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
14
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
15
+ s.require_paths = ['lib']
16
+ s.license = 'MIT'
17
+ s.homepage = 'https://github.com/coreyja/lifx-faraday'
18
+
19
+ s.required_ruby_version = '>= 2.1.0'
20
+
21
+ s.add_runtime_dependency 'faraday', '~> 0.12'
22
+
23
+ s.add_development_dependency 'rubocop', '~> 0.49'
24
+ s.add_development_dependency 'github_changelog_generator'
25
+ s.add_development_dependency 'gem-release', '2.0.0.dev.5'
26
+ end
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lifx-faraday
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Corey Alexander
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-05-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.12'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.49'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.49'
41
+ - !ruby/object:Gem::Dependency
42
+ name: github_changelog_generator
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: gem-release
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.0.0.dev.5
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 2.0.0.dev.5
69
+ description:
70
+ email: coreyja@gmail.com
71
+ executables: []
72
+ extensions: []
73
+ extra_rdoc_files: []
74
+ files:
75
+ - ".gitignore"
76
+ - ".rubocop.yml"
77
+ - ".thoughtbot_rubocop.yml"
78
+ - CHANGELOG.md
79
+ - Gemfile
80
+ - LICENSE
81
+ - README.md
82
+ - lib/api/connection.rb
83
+ - lib/lifx-faraday.rb
84
+ - lib/lifx-faraday/api.rb
85
+ - lib/lifx-faraday/light.rb
86
+ - lib/lifx-faraday/version.rb
87
+ - lifx-faraday.gemspec
88
+ homepage: https://github.com/coreyja/lifx-faraday
89
+ licenses:
90
+ - MIT
91
+ metadata: {}
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 2.1.0
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ requirements: []
107
+ rubyforge_project:
108
+ rubygems_version: 2.6.8
109
+ signing_key:
110
+ specification_version: 4
111
+ summary: LiFX API implemented using Faraday
112
+ test_files: []