psenv 0.7.0 → 0.8.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
  SHA256:
3
- metadata.gz: 2e6f6e324f5fb5e43f03fb3a10601febdb86b6fa28e587d53020183cd11f7c30
4
- data.tar.gz: 0c959dfda622169f797f3839bd116c38c753a5aa9cc9b4285cd76f99130e2907
3
+ metadata.gz: 95068b4608673d5fbdf66f5a71969f7caf4ed2c1a9c96055afe728e9e4873a49
4
+ data.tar.gz: 61ff9ffd8ebde74cf8bcaf7a03f1dbc71981d93fb1702b0e44ec2f0f9f91df13
5
5
  SHA512:
6
- metadata.gz: df5a00bb92ff974c9a8d37794a01934ecba3b5a33f5df25d9cd536513a014b023325e2ae3348435d8fcbee6f3d2b8c713420d8ccd6b35faa51fc26fb5d56d5d5
7
- data.tar.gz: c460933a6b7573aa251be6f78b7568a181676b3aae183421106f5e495c7592b4bed9d17d5cd6f85effa4a0ffefafb3a0aef5d416d929c55fadf90ad95947aeea
6
+ metadata.gz: 2fab2133154b2cae69583ca13ff7c888cd3ff2d4c52730ab39ce2561dfcd76f3a74683d16902244b01c122aebf55683358184cd58b50feade49388309c56201a
7
+ data.tar.gz: f04c8b12451ce63a948eb3db9c9b07a67b662bd4a8ae18a4fbdef2c5642c5e440a18e06d9dff2d936e459706a2c35c4ccf69cb4b53b316c4ea93e74ed1781510
@@ -7,26 +7,26 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
9
  - uses: actions/checkout@v1
10
- - name: Set up Ruby 2.6
11
- uses: actions/setup-ruby@v1
10
+ - name: Set up Ruby 2.7
11
+ uses: ruby/setup-ruby@v1
12
12
  with:
13
- ruby-version: 2.6.x
13
+ ruby-version: 2.7
14
14
  - name: Build and test with Rake
15
15
  run: |
16
16
  gem install bundler
17
17
  bundle install --jobs 4 --retry 3
18
- bundle exec rubocop
18
+ bundle exec standardrb
19
19
 
20
20
  test:
21
21
  runs-on: ubuntu-latest
22
22
  strategy:
23
23
  matrix:
24
- ruby_version: [2.4.x, 2.5.x, 2.6.x, 2.7.x]
24
+ ruby_version: [2.4, 2.5, 2.6, 2.7, 3.0]
25
25
 
26
26
  steps:
27
27
  - uses: actions/checkout@v1
28
28
  - name: Set up Ruby ${{ matrix.ruby_version }}
29
- uses: actions/setup-ruby@v1
29
+ uses: ruby/setup-ruby@v1
30
30
  with:
31
31
  ruby-version: ${{ matrix.ruby_version }}
32
32
  - name: Build and test with Rake
@@ -37,12 +37,15 @@ jobs:
37
37
 
38
38
  rails:
39
39
  runs-on: ubuntu-latest
40
+ strategy:
41
+ matrix:
42
+ ruby_version: [2.5, 2.6, 2.7, 3.0]
40
43
  steps:
41
44
  - uses: actions/checkout@v1
42
- - name: Set up Ruby 2.6
43
- uses: actions/setup-ruby@v1
45
+ - name: Set up Ruby ${{ matrix.ruby_version }}
46
+ uses: ruby/setup-ruby@v1
44
47
  with:
45
- ruby-version: 2.6.x
48
+ ruby-version: ${{ matrix.ruby_version }}
46
49
  - name: Test gem in Rails application
47
50
  run: |
48
51
  cd spec/rails
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # Psenv
2
2
 
3
- **Work in progress**
4
-
5
3
  Shim to load environment variables from [AWS Systems Manager Parameter Store](https://aws.amazon.com/systems-manager/features/#Parameter_Store) into ENV.
6
4
 
7
5
  Psenv currently heavily borrows from [Dotenv](https://github.com/bkeepers/dotenv), mainly because I use it in roughly every project so it made sense for the APIs to match.
data/Rakefile CHANGED
@@ -2,17 +2,19 @@ require "bundler/gem_helper"
2
2
  require "rspec/core/rake_task"
3
3
  require "rubocop/rake_task"
4
4
 
5
+ class ParameterStoreEnvRailsGemHelper < Bundler::GemHelper
6
+ def guard_already_tagged
7
+ end
8
+
9
+ def tag_version
10
+ end
11
+ end
12
+
5
13
  namespace "psenv" do
6
14
  Bundler::GemHelper.install_tasks name: "psenv"
7
15
  end
8
16
 
9
17
  namespace "psenv-rails" do
10
- class ParameterStoreEnvRailsGemHelper < Bundler::GemHelper
11
- def guard_already_tagged; end
12
-
13
- def tag_version; end
14
- end
15
-
16
18
  ParameterStoreEnvRailsGemHelper.install_tasks name: "psenv-rails"
17
19
  end
18
20
 
@@ -6,7 +6,7 @@ module Psenv
6
6
 
7
7
  def apply
8
8
  @variables.each do |k, v|
9
- ENV.store(k.to_s, v) unless ENV.has_key?(k.to_s)
9
+ ENV.store(k.to_s, v) unless ENV.key?(k.to_s)
10
10
  end
11
11
  end
12
12
 
@@ -20,11 +20,10 @@ module Psenv
20
20
  end
21
21
 
22
22
  def call
23
- Hash[
24
- parameters.
25
- map { |parameter| Parameter.new(parameter) }.
26
- map { |parameter| [parameter.name, parameter.value] }
27
- ]
23
+ parameters
24
+ .map { |parameter| Parameter.new(parameter) }
25
+ .map { |parameter| [parameter.name, parameter.value] }
26
+ .to_h
28
27
  end
29
28
 
30
29
  def self.call(path)
@@ -48,7 +47,7 @@ module Psenv
48
47
  end
49
48
 
50
49
  parameters.flatten
51
- rescue StandardError => error
50
+ rescue => error
52
51
  raise RetrieveError, error
53
52
  end
54
53
  end
data/lib/psenv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Psenv
2
- VERSION = "0.7.0".freeze
2
+ VERSION = "0.8.0".freeze
3
3
  end
data/psenv-rails.gemspec CHANGED
@@ -1,27 +1,26 @@
1
-
2
1
  lib = File.expand_path("lib", __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require "psenv/version"
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = "psenv-rails"
8
- spec.version = Psenv::VERSION
9
- spec.authors = ["Andrew Tomaka"]
10
- spec.email = ["atomaka@gmail.com"]
6
+ spec.name = "psenv-rails"
7
+ spec.version = Psenv::VERSION
8
+ spec.authors = ["Andrew Tomaka"]
9
+ spec.email = ["atomaka@gmail.com"]
11
10
 
12
- spec.summary = "Load AWS SSM Parameter Store values into your Rails environment."
13
- spec.homepage = "https://github.com/atomaka/psenv"
14
- spec.license = "MIT"
11
+ spec.summary = "Load AWS SSM Parameter Store values into your Rails environment."
12
+ spec.homepage = "https://github.com/atomaka/psenv"
13
+ spec.license = "MIT"
15
14
 
16
- spec.files = `git ls-files lib | grep rails`.
17
- split($OUTPUT_RECORD_SEPARATOR).
18
- reject do |f|
15
+ spec.files = `git ls-files lib | grep rails`
16
+ .split($OUTPUT_RECORD_SEPARATOR)
17
+ .reject do |f|
19
18
  f.match(%r{^(test|spec|features)/})
20
19
  end + ["README.md", "LICENSE.txt"]
21
- spec.bindir = "exe"
22
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
22
  spec.require_paths = ["lib"]
24
23
 
25
24
  spec.add_dependency "psenv", Psenv::VERSION
26
- spec.add_dependency "railties", ">= 3.2", "<= 6.1"
25
+ spec.add_dependency "railties", ">= 3.2", "< 6.2"
27
26
  end
data/psenv.gemspec CHANGED
@@ -1,29 +1,28 @@
1
-
2
1
  lib = File.expand_path("lib", __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require "psenv/version"
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = "psenv"
8
- spec.version = Psenv::VERSION
9
- spec.authors = ["Andrew Tomaka"]
10
- spec.email = ["atomaka@gmail.com"]
6
+ spec.name = "psenv"
7
+ spec.version = Psenv::VERSION
8
+ spec.authors = ["Andrew Tomaka"]
9
+ spec.email = ["atomaka@gmail.com"]
11
10
 
12
- spec.summary = "Load AWS SSM Parameter Store values into your environment."
13
- spec.homepage = "https://github.com/atomaka/psenv"
14
- spec.license = "MIT"
11
+ spec.summary = "Load AWS SSM Parameter Store values into your environment."
12
+ spec.homepage = "https://github.com/atomaka/psenv"
13
+ spec.license = "MIT"
15
14
 
16
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
15
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
16
  f.match(%r{^(test|spec|features)/})
18
17
  end
19
- spec.bindir = "exe"
20
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
20
  spec.require_paths = ["lib"]
22
21
 
23
22
  spec.add_development_dependency "pry"
24
- spec.add_development_dependency "rake", "~> 10.0"
25
- spec.add_development_dependency "rspec", "~> 3.0"
26
- spec.add_development_dependency "rubocop", "0.54"
23
+ spec.add_development_dependency "rake", ">= 12.3.3"
24
+ spec.add_development_dependency "rspec", "~> 3"
25
+ spec.add_development_dependency "standard"
27
26
  spec.add_development_dependency "webmock", "~> 3.3"
28
27
 
29
28
  spec.add_dependency "aws-sdk-ssm", "~> 1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Tomaka
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-07 00:00:00.000000000 Z
11
+ date: 2021-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -28,44 +28,44 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '3'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rubocop
56
+ name: standard
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0.54'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0.54'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: webmock
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1'
97
- description:
97
+ description:
98
98
  email:
99
99
  - atomaka@gmail.com
100
100
  executables: []
@@ -104,7 +104,6 @@ files:
104
104
  - ".github/workflows/ruby.yml"
105
105
  - ".gitignore"
106
106
  - ".rspec"
107
- - ".rubocop.yml"
108
107
  - Gemfile
109
108
  - LICENSE.txt
110
109
  - README.md
@@ -122,7 +121,7 @@ homepage: https://github.com/atomaka/psenv
122
121
  licenses:
123
122
  - MIT
124
123
  metadata: {}
125
- post_install_message:
124
+ post_install_message:
126
125
  rdoc_options: []
127
126
  require_paths:
128
127
  - lib
@@ -137,8 +136,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
136
  - !ruby/object:Gem::Version
138
137
  version: '0'
139
138
  requirements: []
140
- rubygems_version: 3.0.3
141
- signing_key:
139
+ rubygems_version: 3.2.22
140
+ signing_key:
142
141
  specification_version: 4
143
142
  summary: Load AWS SSM Parameter Store values into your environment.
144
143
  test_files: []
data/.rubocop.yml DELETED
@@ -1,655 +0,0 @@
1
- AllCops:
2
- Exclude:
3
- - db/schema.rb
4
- - vendor/**/*
5
- - spec/rails/**/*
6
-
7
- Metrics/LineLength:
8
- Description: 'Limit lines to 80 characters.'
9
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
10
- Max: 80
11
- Exclude:
12
- - ./*.gemspec
13
-
14
-
15
- Naming/AccessorMethodName:
16
- Description: Check the naming of accessor methods for get_/set_.
17
- Enabled: false
18
-
19
- Style/Alias:
20
- Description: 'Use alias_method instead of alias.'
21
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
22
- Enabled: false
23
-
24
- Style/ArrayJoin:
25
- Description: 'Use Array#join instead of Array#*.'
26
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
27
- Enabled: false
28
-
29
- Style/AsciiComments:
30
- Description: 'Use only ascii symbols in comments.'
31
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
32
- Enabled: false
33
-
34
- Naming/AsciiIdentifiers:
35
- Description: 'Use only ascii symbols in identifiers.'
36
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
37
- Enabled: false
38
-
39
- Style/Attr:
40
- Description: 'Checks for uses of Module#attr.'
41
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
42
- Enabled: false
43
-
44
- Metrics/BlockNesting:
45
- Description: 'Avoid excessive block nesting'
46
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
47
- Enabled: false
48
-
49
- Style/CaseEquality:
50
- Description: 'Avoid explicit use of the case equality operator(===).'
51
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
52
- Enabled: false
53
-
54
- Style/CharacterLiteral:
55
- Description: 'Checks for uses of character literals.'
56
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
57
- Enabled: false
58
-
59
- Style/ClassAndModuleChildren:
60
- Description: 'Checks style of children classes and modules.'
61
- Enabled: true
62
- EnforcedStyle: nested
63
-
64
- Metrics/ClassLength:
65
- Description: 'Avoid classes longer than 100 lines of code.'
66
- Enabled: false
67
-
68
- Metrics/ModuleLength:
69
- Description: 'Avoid modules longer than 100 lines of code.'
70
- Enabled: false
71
-
72
- Style/ClassVars:
73
- Description: 'Avoid the use of class variables.'
74
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
75
- Enabled: false
76
-
77
- Style/CollectionMethods:
78
- Enabled: true
79
- PreferredMethods:
80
- find: detect
81
- inject: reduce
82
- collect: map
83
- find_all: select
84
-
85
- Style/ColonMethodCall:
86
- Description: 'Do not use :: for method call.'
87
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
88
- Enabled: false
89
-
90
- Style/CommentAnnotation:
91
- Description: >-
92
- Checks formatting of special comments
93
- (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
94
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
95
- Enabled: false
96
-
97
- Metrics/AbcSize:
98
- Description: >-
99
- A calculated magnitude based on number of assignments,
100
- branches, and conditions.
101
- Enabled: false
102
-
103
- Metrics/BlockLength:
104
- CountComments: true # count full line comments?
105
- Max: 25
106
- ExcludedMethods: []
107
- Exclude:
108
- - "spec/**/*"
109
-
110
- Metrics/CyclomaticComplexity:
111
- Description: >-
112
- A complexity metric that is strongly correlated to the number
113
- of test cases needed to validate a method.
114
- Enabled: false
115
-
116
- Rails/Delegate:
117
- Description: 'Prefer delegate method for delegations.'
118
- Enabled: false
119
-
120
- Style/PreferredHashMethods:
121
- Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
122
- StyleGuide: '#hash-key'
123
- Enabled: false
124
-
125
- Style/Documentation:
126
- Description: 'Document classes and non-namespace modules.'
127
- Enabled: false
128
-
129
- Style/DoubleNegation:
130
- Description: 'Checks for uses of double negation (!!).'
131
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
132
- Enabled: false
133
-
134
- Style/EachWithObject:
135
- Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
136
- Enabled: false
137
-
138
- Style/EmptyLiteral:
139
- Description: 'Prefer literals to Array.new/Hash.new/String.new.'
140
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
141
- Enabled: false
142
-
143
- # Checks whether the source file has a utf-8 encoding comment or not
144
- # AutoCorrectEncodingComment must match the regex
145
- # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
146
- Style/Encoding:
147
- Enabled: false
148
-
149
- Style/EvenOdd:
150
- Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
151
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
152
- Enabled: false
153
-
154
- Naming/FileName:
155
- Description: 'Use snake_case for source file names.'
156
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
157
- Enabled: false
158
-
159
- Style/FrozenStringLiteralComment:
160
- Description: >-
161
- Add the frozen_string_literal comment to the top of files
162
- to help transition from Ruby 2.3.0 to Ruby 3.0.
163
- Enabled: false
164
-
165
- Style/FlipFlop:
166
- Description: 'Checks for flip flops'
167
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
168
- Enabled: false
169
-
170
- Style/FormatString:
171
- Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
172
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
173
- Enabled: false
174
-
175
- Style/GlobalVars:
176
- Description: 'Do not introduce global variables.'
177
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
178
- Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
179
- Enabled: false
180
-
181
- Style/GuardClause:
182
- Description: 'Check for conditionals that can be replaced with guard clauses'
183
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
184
- Enabled: false
185
-
186
- Style/IfUnlessModifier:
187
- Description: >-
188
- Favor modifier if/unless usage when you have a
189
- single-line body.
190
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
191
- Enabled: false
192
-
193
- Style/IfWithSemicolon:
194
- Description: 'Do not use if x; .... Use the ternary operator instead.'
195
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
196
- Enabled: false
197
-
198
- Style/InlineComment:
199
- Description: 'Avoid inline comments.'
200
- Enabled: false
201
-
202
- Style/Lambda:
203
- Description: 'Use the new lambda literal syntax for single-line blocks.'
204
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
205
- Enabled: false
206
-
207
- Style/LambdaCall:
208
- Description: 'Use lambda.call(...) instead of lambda.(...).'
209
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
210
- Enabled: false
211
-
212
- Style/LineEndConcatenation:
213
- Description: >-
214
- Use \ instead of + or << to concatenate two string literals at
215
- line end.
216
- Enabled: false
217
-
218
- Metrics/MethodLength:
219
- Description: 'Avoid methods longer than 10 lines of code.'
220
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
221
- Enabled: false
222
-
223
- Style/ModuleFunction:
224
- Description: 'Checks for usage of `extend self` in modules.'
225
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
226
- Enabled: false
227
-
228
- Style/MultilineBlockChain:
229
- Description: 'Avoid multi-line chains of blocks.'
230
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
231
- Enabled: false
232
-
233
- Style/NegatedIf:
234
- Description: >-
235
- Favor unless over if for negative conditions
236
- (or control flow or).
237
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
238
- Enabled: false
239
-
240
- Style/NegatedWhile:
241
- Description: 'Favor until over while for negative conditions.'
242
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
243
- Enabled: false
244
-
245
- Style/Next:
246
- Description: 'Use `next` to skip iteration instead of a condition at the end.'
247
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
248
- Enabled: false
249
-
250
- Style/NilComparison:
251
- Description: 'Prefer x.nil? to x == nil.'
252
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
253
- Enabled: false
254
-
255
- Style/Not:
256
- Description: 'Use ! instead of not.'
257
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
258
- Enabled: false
259
-
260
- Style/NumericLiterals:
261
- Description: >-
262
- Add underscores to large numeric literals to improve their
263
- readability.
264
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
265
- Enabled: false
266
-
267
- Style/OneLineConditional:
268
- Description: >-
269
- Favor the ternary operator(?:) over
270
- if/then/else/end constructs.
271
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
272
- Enabled: false
273
-
274
- Naming/BinaryOperatorParameterName:
275
- Description: 'When defining binary operators, name the argument other.'
276
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
277
- Enabled: false
278
-
279
- Metrics/ParameterLists:
280
- Description: 'Avoid parameter lists longer than three or four parameters.'
281
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
282
- Enabled: false
283
-
284
- Style/PercentLiteralDelimiters:
285
- Description: 'Use `%`-literal delimiters consistently'
286
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
287
- Enabled: false
288
-
289
- Style/PerlBackrefs:
290
- Description: 'Avoid Perl-style regex back references.'
291
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
292
- Enabled: false
293
-
294
- Naming/PredicateName:
295
- Description: 'Check the names of predicate methods.'
296
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
297
- NamePrefixBlacklist:
298
- - is_
299
- Exclude:
300
- - spec/**/*
301
-
302
- Style/Proc:
303
- Description: 'Use proc instead of Proc.new.'
304
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
305
- Enabled: false
306
-
307
- Style/RaiseArgs:
308
- Description: 'Checks the arguments passed to raise/fail.'
309
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
310
- Enabled: false
311
-
312
- Style/RegexpLiteral:
313
- Description: 'Use / or %r around regular expressions.'
314
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
315
- Enabled: false
316
-
317
- Style/SelfAssignment:
318
- Description: >-
319
- Checks for places where self-assignment shorthand should have
320
- been used.
321
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
322
- Enabled: false
323
-
324
- Style/SingleLineBlockParams:
325
- Description: 'Enforces the names of some block params.'
326
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
327
- Enabled: false
328
-
329
- Style/SingleLineMethods:
330
- Description: 'Avoid single-line methods.'
331
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
332
- Enabled: false
333
-
334
- Style/SignalException:
335
- Description: 'Checks for proper usage of fail and raise.'
336
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
337
- Enabled: false
338
-
339
- Style/SpecialGlobalVars:
340
- Description: 'Avoid Perl-style global variables.'
341
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
342
- Enabled: false
343
-
344
- Style/StringLiterals:
345
- Description: 'Checks if uses of quotes match the configured preference.'
346
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
347
- EnforcedStyle: double_quotes
348
- Enabled: true
349
-
350
- Style/TrailingCommaInArguments:
351
- Description: 'Checks for trailing comma in argument lists.'
352
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
353
- EnforcedStyleForMultiline: comma
354
- SupportedStylesForMultiline:
355
- - comma
356
- - consistent_comma
357
- - no_comma
358
- Enabled: true
359
-
360
- Style/TrailingCommaInArrayLiteral:
361
- Description: 'Checks for trailing comma in array literals.'
362
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
363
- EnforcedStyleForMultiline: comma
364
- SupportedStylesForMultiline:
365
- - comma
366
- - consistent_comma
367
- - no_comma
368
- Enabled: true
369
-
370
- Style/TrailingCommaInHashLiteral:
371
- Description: 'Checks for trailing comma in hash literals.'
372
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
373
- EnforcedStyleForMultiline: comma
374
- SupportedStylesForMultiline:
375
- - comma
376
- - consistent_comma
377
- - no_comma
378
- Enabled: true
379
-
380
- Style/TrivialAccessors:
381
- Description: 'Prefer attr_* methods to trivial readers/writers.'
382
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
383
- Enabled: false
384
-
385
- Style/VariableInterpolation:
386
- Description: >-
387
- Don't interpolate global, instance and class variables
388
- directly in strings.
389
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
390
- Enabled: false
391
-
392
- Style/WhenThen:
393
- Description: 'Use when x then ... for one-line cases.'
394
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
395
- Enabled: false
396
-
397
- Style/WhileUntilModifier:
398
- Description: >-
399
- Favor modifier while/until usage when you have a
400
- single-line body.
401
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
402
- Enabled: false
403
-
404
- Style/WordArray:
405
- Description: 'Use %w or %W for arrays of words.'
406
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
407
- Enabled: false
408
-
409
- # Layout
410
-
411
- Layout/AlignParameters:
412
- Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
413
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
414
- Enabled: false
415
-
416
- Layout/ConditionPosition:
417
- Description: >-
418
- Checks for condition placed in a confusing position relative to
419
- the keyword.
420
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
421
- Enabled: false
422
-
423
- Layout/DotPosition:
424
- Description: 'Checks the position of the dot in multi-line method calls.'
425
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
426
- EnforcedStyle: trailing
427
-
428
- Layout/ExtraSpacing:
429
- Description: 'Do not use unnecessary spacing.'
430
- Enabled: true
431
-
432
- Layout/MultilineOperationIndentation:
433
- Description: >-
434
- Checks indentation of binary operations that span more than
435
- one line.
436
- Enabled: true
437
- EnforcedStyle: indented
438
-
439
- Layout/MultilineMethodCallIndentation:
440
- Description: >-
441
- Checks indentation of method calls with the dot operator
442
- that span more than one line.
443
- Enabled: true
444
- EnforcedStyle: indented
445
-
446
- Layout/InitialIndentation:
447
- Description: >-
448
- Checks the indentation of the first non-blank non-comment line in a file.
449
- Enabled: false
450
-
451
- # Lint
452
-
453
- Lint/AmbiguousOperator:
454
- Description: >-
455
- Checks for ambiguous operators in the first argument of a
456
- method invocation without parentheses.
457
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
458
- Enabled: false
459
-
460
- Lint/AmbiguousRegexpLiteral:
461
- Description: >-
462
- Checks for ambiguous regexp literals in the first argument of
463
- a method invocation without parenthesis.
464
- Enabled: false
465
-
466
- Lint/AssignmentInCondition:
467
- Description: "Don't use assignment in conditions."
468
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
469
- Enabled: false
470
-
471
- Lint/CircularArgumentReference:
472
- Description: "Don't refer to the keyword argument in the default value."
473
- Enabled: false
474
-
475
- Lint/DeprecatedClassMethods:
476
- Description: 'Check for deprecated class method calls.'
477
- Enabled: false
478
-
479
- Lint/DuplicatedKey:
480
- Description: 'Check for duplicate keys in hash literals.'
481
- Enabled: false
482
-
483
- Lint/EachWithObjectArgument:
484
- Description: 'Check for immutable argument given to each_with_object.'
485
- Enabled: false
486
-
487
- Lint/ElseLayout:
488
- Description: 'Check for odd code arrangement in an else block.'
489
- Enabled: false
490
-
491
- Lint/FormatParameterMismatch:
492
- Description: 'The number of parameters to format/sprint must match the fields.'
493
- Enabled: false
494
-
495
- Lint/HandleExceptions:
496
- Description: "Don't suppress exception."
497
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
498
- Enabled: false
499
-
500
- Lint/LiteralAsCondition:
501
- Description: 'Checks of literals used in conditions.'
502
- Enabled: false
503
-
504
- Lint/LiteralInInterpolation:
505
- Description: 'Checks for literals used in interpolation.'
506
- Enabled: false
507
-
508
- Lint/Loop:
509
- Description: >-
510
- Use Kernel#loop with break rather than begin/end/until or
511
- begin/end/while for post-loop tests.
512
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
513
- Enabled: false
514
-
515
- Lint/NestedMethodDefinition:
516
- Description: 'Do not use nested method definitions.'
517
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
518
- Enabled: false
519
-
520
- Lint/NonLocalExitFromIterator:
521
- Description: 'Do not use return in iterator to cause non-local exit.'
522
- Enabled: false
523
-
524
- Lint/ParenthesesAsGroupedExpression:
525
- Description: >-
526
- Checks for method calls with a space before the opening
527
- parenthesis.
528
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
529
- Enabled: false
530
-
531
- Lint/RequireParentheses:
532
- Description: >-
533
- Use parentheses in the method call to avoid confusion
534
- about precedence.
535
- Enabled: false
536
-
537
- Lint/UnderscorePrefixedVariableName:
538
- Description: 'Do not use prefix `_` for a variable that is used.'
539
- Enabled: false
540
-
541
- Lint/UnneededCopDisableDirective:
542
- Description: >-
543
- Checks for rubocop:disable comments that can be removed.
544
- Note: this cop is not disabled when disabling all cops.
545
- It must be explicitly disabled.
546
- Enabled: false
547
-
548
- Lint/Void:
549
- Description: 'Possible use of operator/literal/variable in void context.'
550
- Enabled: false
551
-
552
- # Performance
553
-
554
- Performance/CaseWhenSplat:
555
- Description: >-
556
- Place `when` conditions that use splat at the end
557
- of the list of `when` branches.
558
- Enabled: false
559
-
560
- Performance/Count:
561
- Description: >-
562
- Use `count` instead of `select...size`, `reject...size`,
563
- `select...count`, `reject...count`, `select...length`,
564
- and `reject...length`.
565
- Enabled: false
566
-
567
- Performance/Detect:
568
- Description: >-
569
- Use `detect` instead of `select.first`, `find_all.first`,
570
- `select.last`, and `find_all.last`.
571
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
572
- Enabled: false
573
-
574
- Performance/FlatMap:
575
- Description: >-
576
- Use `Enumerable#flat_map`
577
- instead of `Enumerable#map...Array#flatten(1)`
578
- or `Enumberable#collect..Array#flatten(1)`
579
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
580
- Enabled: false
581
-
582
- Performance/ReverseEach:
583
- Description: 'Use `reverse_each` instead of `reverse.each`.'
584
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
585
- Enabled: false
586
-
587
- Performance/Sample:
588
- Description: >-
589
- Use `sample` instead of `shuffle.first`,
590
- `shuffle.last`, and `shuffle[Fixnum]`.
591
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
592
- Enabled: false
593
-
594
- Performance/Size:
595
- Description: >-
596
- Use `size` instead of `count` for counting
597
- the number of elements in `Array` and `Hash`.
598
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
599
- Enabled: false
600
-
601
- Performance/StringReplacement:
602
- Description: >-
603
- Use `tr` instead of `gsub` when you are replacing the same
604
- number of characters. Use `delete` instead of `gsub` when
605
- you are deleting characters.
606
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
607
- Enabled: false
608
-
609
- # Rails
610
-
611
- Rails/ActionFilter:
612
- Description: 'Enforces consistent use of action filter methods.'
613
- Enabled: false
614
-
615
- Rails/Date:
616
- Description: >-
617
- Checks the correct usage of date aware methods,
618
- such as Date.today, Date.current etc.
619
- Enabled: false
620
-
621
- Rails/FindBy:
622
- Description: 'Prefer find_by over where.first.'
623
- Enabled: false
624
-
625
- Rails/FindEach:
626
- Description: 'Prefer all.find_each over all.find.'
627
- Enabled: false
628
-
629
- Rails/HasAndBelongsToMany:
630
- Description: 'Prefer has_many :through to has_and_belongs_to_many.'
631
- Enabled: false
632
-
633
- Rails/Output:
634
- Description: 'Checks for calls to puts, print, etc.'
635
- Enabled: false
636
-
637
- Rails/ReadWriteAttribute:
638
- Description: >-
639
- Checks for read_attribute(:attr) and
640
- write_attribute(:attr, val).
641
- Enabled: false
642
-
643
- Rails/ScopeArgs:
644
- Description: 'Checks the arguments of ActiveRecord scopes.'
645
- Enabled: false
646
-
647
- Rails/TimeZone:
648
- Description: 'Checks the correct usage of time zone aware methods.'
649
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
650
- Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
651
- Enabled: false
652
-
653
- Rails/Validation:
654
- Description: 'Use validates :attribute, hash of validations.'
655
- Enabled: false