dekorator 1.0.0.pre.1 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +4 -0
- data/.github/workflows/test.yml +40 -0
- data/CHANGELOG.md +44 -4
- data/CODE_OF_CONDUCT.md +1 -1
- data/README.md +107 -40
- data/benchmarks/README.md +7 -0
- data/benchmarks/benchmark.rb +135 -0
- data/dekorator.gemspec +29 -15
- data/lib/dekorator/rails/controller.rb +17 -0
- data/lib/dekorator/rails/tasks/dekorator.rake +11 -0
- data/lib/dekorator/railtie.rb +9 -5
- data/lib/dekorator/version.rb +1 -1
- data/lib/dekorator.rb +79 -53
- data/lib/generators/decorator_generator.rb +7 -0
- data/lib/generators/{decorator → dekorator/decorator}/USAGE +1 -1
- data/lib/generators/dekorator/decorator/decorator_generator.rb +17 -0
- data/lib/generators/{decorator → dekorator/decorator}/templates/decorator.rb +0 -0
- data/lib/generators/dekorator/{install_generator.rb → install/install_generator.rb} +8 -6
- data/lib/generators/rspec/decorator_generator.rb +2 -0
- data/lib/generators/test_unit/decorator_generator.rb +2 -0
- metadata +60 -52
- data/.editorconfig +0 -14
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.rubocop.yml +0 -114
- data/.simplecov +0 -5
- data/.travis.yml +0 -37
- data/Appraisals +0 -17
- data/Gemfile +0 -22
- data/Gemfile.lock +0 -157
- data/bin/console +0 -16
- data/bin/setup +0 -8
- data/gemfiles/.bundle/config +0 -2
- data/gemfiles/rails_5.0.x.gemfile +0 -21
- data/gemfiles/rails_5.0.x.gemfile.lock +0 -207
- data/gemfiles/rails_5.1.x.gemfile +0 -21
- data/gemfiles/rails_5.1.x.gemfile.lock +0 -207
- data/gemfiles/rails_5.2.x.gemfile +0 -21
- data/gemfiles/rails_5.2.x.gemfile.lock +0 -207
- data/gemfiles/rails_6.0.x.gemfile +0 -21
- data/gemfiles/rails_6.0.x.gemfile.lock +0 -220
- data/lib/dekorator/decorators_helper.rb +0 -5
- data/lib/dekorator/rspec.rb +0 -0
- data/lib/generators/decorator/decorator_generator.rb +0 -11
- data/lib/generators/decorator/templates/decorator_test.rb +0 -1
data/lib/dekorator.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "dekorator/version"
|
4
|
-
require "
|
5
|
-
require "active_support/core_ext/module/delegation"
|
4
|
+
require "delegate"
|
6
5
|
|
6
|
+
# :nodoc
|
7
7
|
module Dekorator
|
8
|
+
# @api private
|
9
|
+
module Generators; end
|
10
|
+
|
11
|
+
# :nodoc:
|
8
12
|
class DecoratorNotFound < ArgumentError; end
|
9
13
|
|
10
14
|
# Base decorator.
|
@@ -12,110 +16,132 @@ module Dekorator
|
|
12
16
|
class << self
|
13
17
|
# Decorate an object with a decorator.
|
14
18
|
#
|
15
|
-
# @param
|
16
|
-
# @
|
19
|
+
# @param object_or_enumerable [Object, Enumerable] the object or Enumerable to decorate.
|
20
|
+
# @param with [Class] the decorator class to use. If empty a decorator will be guessed.
|
17
21
|
#
|
18
|
-
# @return [Dekorator::Base
|
22
|
+
# @return [Dekorator::Base] if object given.
|
23
|
+
# @return [Enumerable] if Enumerable given.
|
19
24
|
#
|
20
25
|
# @raise [DecoratorNotFound] if decorator is not found.
|
21
|
-
def decorate(
|
22
|
-
return
|
23
|
-
|
24
|
-
with = _guess_decorator(object_or_collection) if with.nil? && object_or_collection.present?
|
26
|
+
def decorate(object_or_enumerable, with: nil)
|
27
|
+
return object_or_enumerable unless decorable?(object_or_enumerable)
|
25
28
|
|
26
|
-
|
29
|
+
with ||= _decorator_class
|
27
30
|
|
28
|
-
|
31
|
+
object_or_enumerable = _decorate(object_or_enumerable, with: with)
|
29
32
|
|
30
33
|
if block_given?
|
31
|
-
yield
|
34
|
+
yield object_or_enumerable
|
32
35
|
else
|
33
|
-
|
36
|
+
object_or_enumerable
|
34
37
|
end
|
35
38
|
end
|
36
39
|
|
37
40
|
# Define that an association must be decorated.
|
38
41
|
#
|
39
42
|
# @param relation_name [String, Symbol] the association name to decorate.
|
40
|
-
# @
|
43
|
+
# @param with [Class] the decorator class to use. If empty a decorator will be guessed.
|
41
44
|
#
|
42
45
|
# @example Define an association to decorate
|
43
|
-
# class UserDecorator <
|
46
|
+
# class UserDecorator < Dekorator::Base
|
44
47
|
# decorates_association :posts
|
45
48
|
# end
|
46
49
|
#
|
47
50
|
# # A decorator could be precise
|
48
|
-
# class UserDecorator <
|
51
|
+
# class UserDecorator < Dekorator::Base
|
49
52
|
# decorates_association :posts, PostDecorator
|
50
53
|
# end
|
51
|
-
def decorates_association(relation_name, with:
|
54
|
+
def decorates_association(relation_name, with: :__guess__)
|
52
55
|
relation_name = relation_name.to_sym
|
53
56
|
|
54
57
|
define_method(relation_name) do
|
55
|
-
|
56
|
-
|
57
|
-
@decorated_associations[relation_name] ||= decorate(association, with: with)
|
58
|
+
@_decorated_associations[relation_name] ||= decorate(__getobj__.public_send(relation_name), with: with)
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
62
|
+
# Guess and returns the decorated object class.
|
63
|
+
#
|
64
|
+
# @return [Class] the decorated object class.
|
61
65
|
def base_class
|
62
|
-
name.
|
66
|
+
_safe_constantize(name.sub("Decorator", ""))
|
63
67
|
end
|
64
68
|
|
65
69
|
private
|
66
70
|
|
71
|
+
# @api private
|
67
72
|
def _decorate(object_or_enumerable, with: nil)
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
object_or_enumerable.map { |object|
|
73
|
+
with = _guess_decorator(object_or_enumerable) if with.nil? || with == :__guess__
|
74
|
+
|
75
|
+
if object_or_enumerable.is_a? Enumerable
|
76
|
+
object_or_enumerable.map { |object| _decorate(object, with: with) }
|
72
77
|
else
|
73
78
|
with.new(object_or_enumerable)
|
74
79
|
end
|
75
80
|
end
|
76
81
|
|
82
|
+
# @api private
|
77
83
|
def _guess_decorator(object_or_enumerable)
|
78
84
|
object_or_enumerable = object_or_enumerable.first if object_or_enumerable.is_a? Enumerable
|
79
85
|
|
80
|
-
"#{object_or_enumerable.class}Decorator"
|
86
|
+
_safe_constantize("#{object_or_enumerable.class}Decorator") \
|
87
|
+
|| raise(DecoratorNotFound, "Can't guess decorator for #{object_or_enumerable.class} object")
|
81
88
|
end
|
82
|
-
end
|
83
89
|
|
84
|
-
|
90
|
+
# @api private
|
91
|
+
def decorable?(object_or_enumerable)
|
92
|
+
return false if defined?(ActiveRecord::Relation) \
|
93
|
+
&& object_or_enumerable.is_a?(ActiveRecord::Relation) \
|
94
|
+
&& object_or_enumerable.blank?
|
85
95
|
|
86
|
-
|
87
|
-
|
96
|
+
return false if object_or_enumerable.respond_to?(:empty?) && object_or_enumerable.empty?
|
97
|
+
return false if !object_or_enumerable
|
98
|
+
return false if object_or_enumerable.is_a?(Dekorator::Base)
|
88
99
|
|
89
|
-
|
90
|
-
|
100
|
+
true
|
101
|
+
end
|
91
102
|
|
92
|
-
|
93
|
-
|
94
|
-
|
103
|
+
# @api private
|
104
|
+
def _safe_constantize(class_name)
|
105
|
+
Object.const_get(class_name)
|
106
|
+
rescue NameError => _
|
107
|
+
nil
|
108
|
+
end
|
95
109
|
|
96
|
-
|
97
|
-
|
98
|
-
|
110
|
+
# @api private
|
111
|
+
def _decorator_class
|
112
|
+
return nil if self == Dekorator::Base
|
99
113
|
|
100
|
-
|
101
|
-
|
102
|
-
|
114
|
+
self
|
115
|
+
end
|
116
|
+
end
|
103
117
|
|
104
|
-
|
105
|
-
|
118
|
+
# Decorate an object
|
119
|
+
#
|
120
|
+
# @param object [Object] object to decorate.
|
121
|
+
def initialize(object)
|
122
|
+
@_decorated_associations = {}
|
106
123
|
|
107
|
-
|
108
|
-
|
124
|
+
super(object)
|
125
|
+
end
|
109
126
|
|
110
|
-
|
111
|
-
|
112
|
-
|
127
|
+
# Decorate an object with a decorator.
|
128
|
+
#
|
129
|
+
# @param object_or_enumerable [Object, Enumerable] the object or Enumerable to decorate.
|
130
|
+
# @param with [Class] the decorator class to use. If empty a decorator will be guessed.
|
131
|
+
#
|
132
|
+
# @return [Dekorator::Base] if object given.
|
133
|
+
# @return [Enumerable] if Enumerable given.
|
134
|
+
#
|
135
|
+
# @raise [DecoratorNotFound] if decorator is not found.c
|
136
|
+
def decorate(object_or_enumerable, with: :__guess__)
|
137
|
+
self.class.decorate(object_or_enumerable, with: with)
|
138
|
+
end
|
113
139
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
140
|
+
# Returns the decorated object.
|
141
|
+
#
|
142
|
+
# @return [Object] the decorated object.
|
143
|
+
def object
|
144
|
+
__getobj__
|
119
145
|
end
|
120
146
|
end
|
121
147
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators"
|
4
|
+
|
5
|
+
module Dekorator
|
6
|
+
module Generators
|
7
|
+
class DecoratorGenerator < ::Rails::Generators::NamedBase
|
8
|
+
source_root File.expand_path("templates", __dir__)
|
9
|
+
|
10
|
+
def create_decorator
|
11
|
+
template "decorator.rb", File.join("app/decorators", class_path, "#{file_name}_decorator.rb")
|
12
|
+
end
|
13
|
+
|
14
|
+
hook_for :test_framework
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
File without changes
|
@@ -1,18 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "rails/generators"
|
4
|
+
|
3
5
|
module Dekorator
|
4
6
|
module Generators
|
5
|
-
class InstallGenerator < Rails::Generators::Base
|
7
|
+
class InstallGenerator < ::Rails::Generators::Base
|
6
8
|
|
7
9
|
def create_root_directory
|
8
|
-
return if File.directory?(dekorator_root_directory)
|
9
|
-
|
10
10
|
empty_directory(dekorator_root_directory)
|
11
|
+
|
12
|
+
concerns_directory = dekorator_root_directory.join("concerns")
|
13
|
+
empty_directory(concerns_directory)
|
14
|
+
create_file("#{concerns_directory}/.keep")
|
11
15
|
end
|
12
16
|
|
13
17
|
def create_application_decorator
|
14
|
-
return if File.exist?(application_decorator_path)
|
15
|
-
|
16
18
|
create_file application_decorator_path, <<-RUBY
|
17
19
|
# frozen_string_literal: true
|
18
20
|
|
@@ -24,7 +26,7 @@ end
|
|
24
26
|
protected
|
25
27
|
|
26
28
|
def dekorator_root_directory
|
27
|
-
Rails.root.join("app
|
29
|
+
Rails.root.join("app/decorators")
|
28
30
|
end
|
29
31
|
|
30
32
|
def application_decorator_path
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dekorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Pantographe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -16,60 +16,80 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '5.
|
19
|
+
version: '5.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '5.
|
29
|
+
version: '5.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7.1'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: activerecord
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '5.2'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '7.1'
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '5.2'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '7.1'
|
33
53
|
- !ruby/object:Gem::Dependency
|
34
54
|
name: activesupport
|
35
55
|
requirement: !ruby/object:Gem::Requirement
|
36
56
|
requirements:
|
37
57
|
- - ">="
|
38
58
|
- !ruby/object:Gem::Version
|
39
|
-
version: '5.
|
59
|
+
version: '5.2'
|
40
60
|
- - "<"
|
41
61
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
62
|
+
version: '7.1'
|
43
63
|
type: :runtime
|
44
64
|
prerelease: false
|
45
65
|
version_requirements: !ruby/object:Gem::Requirement
|
46
66
|
requirements:
|
47
67
|
- - ">="
|
48
68
|
- !ruby/object:Gem::Version
|
49
|
-
version: '5.
|
69
|
+
version: '5.2'
|
50
70
|
- - "<"
|
51
71
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
72
|
+
version: '7.1'
|
53
73
|
- !ruby/object:Gem::Dependency
|
54
74
|
name: railties
|
55
75
|
requirement: !ruby/object:Gem::Requirement
|
56
76
|
requirements:
|
57
77
|
- - ">="
|
58
78
|
- !ruby/object:Gem::Version
|
59
|
-
version: '5.
|
79
|
+
version: '5.2'
|
60
80
|
- - "<"
|
61
81
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
82
|
+
version: '7.1'
|
63
83
|
type: :runtime
|
64
84
|
prerelease: false
|
65
85
|
version_requirements: !ruby/object:Gem::Requirement
|
66
86
|
requirements:
|
67
87
|
- - ">="
|
68
88
|
- !ruby/object:Gem::Version
|
69
|
-
version: '5.
|
89
|
+
version: '5.2'
|
70
90
|
- - "<"
|
71
91
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
92
|
+
version: '7.1'
|
73
93
|
- !ruby/object:Gem::Dependency
|
74
94
|
name: bundler
|
75
95
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,16 +108,16 @@ dependencies:
|
|
88
108
|
name: rake
|
89
109
|
requirement: !ruby/object:Gem::Requirement
|
90
110
|
requirements:
|
91
|
-
- - "
|
111
|
+
- - ">="
|
92
112
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
113
|
+
version: 12.3.3
|
94
114
|
type: :development
|
95
115
|
prerelease: false
|
96
116
|
version_requirements: !ruby/object:Gem::Requirement
|
97
117
|
requirements:
|
98
|
-
- - "
|
118
|
+
- - ">="
|
99
119
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
120
|
+
version: 12.3.3
|
101
121
|
- !ruby/object:Gem::Dependency
|
102
122
|
name: rspec
|
103
123
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,55 +135,43 @@ dependencies:
|
|
115
135
|
description: An opinionated way of organizing model-view code in Ruby on Rails, based
|
116
136
|
on decorators
|
117
137
|
email:
|
118
|
-
-
|
138
|
+
- oss@pantographe.studio
|
119
139
|
executables: []
|
120
140
|
extensions: []
|
121
141
|
extra_rdoc_files: []
|
122
142
|
files:
|
123
|
-
- ".
|
124
|
-
- ".
|
125
|
-
- ".rspec"
|
126
|
-
- ".rubocop.yml"
|
127
|
-
- ".simplecov"
|
128
|
-
- ".travis.yml"
|
129
|
-
- Appraisals
|
143
|
+
- ".codeclimate.yml"
|
144
|
+
- ".github/workflows/test.yml"
|
130
145
|
- CHANGELOG.md
|
131
146
|
- CODE_OF_CONDUCT.md
|
132
|
-
- Gemfile
|
133
|
-
- Gemfile.lock
|
134
147
|
- LICENSE.txt
|
135
148
|
- README.md
|
136
149
|
- Rakefile
|
137
|
-
-
|
138
|
-
-
|
150
|
+
- benchmarks/README.md
|
151
|
+
- benchmarks/benchmark.rb
|
139
152
|
- dekorator.gemspec
|
140
|
-
- gemfiles/.bundle/config
|
141
|
-
- gemfiles/rails_5.0.x.gemfile
|
142
|
-
- gemfiles/rails_5.0.x.gemfile.lock
|
143
|
-
- gemfiles/rails_5.1.x.gemfile
|
144
|
-
- gemfiles/rails_5.1.x.gemfile.lock
|
145
|
-
- gemfiles/rails_5.2.x.gemfile
|
146
|
-
- gemfiles/rails_5.2.x.gemfile.lock
|
147
|
-
- gemfiles/rails_6.0.x.gemfile
|
148
|
-
- gemfiles/rails_6.0.x.gemfile.lock
|
149
153
|
- lib/dekorator.rb
|
150
|
-
- lib/dekorator/
|
154
|
+
- lib/dekorator/rails/controller.rb
|
155
|
+
- lib/dekorator/rails/tasks/dekorator.rake
|
151
156
|
- lib/dekorator/railtie.rb
|
152
|
-
- lib/dekorator/rspec.rb
|
153
157
|
- lib/dekorator/version.rb
|
154
|
-
- lib/generators/
|
155
|
-
- lib/generators/decorator/
|
156
|
-
- lib/generators/decorator/
|
157
|
-
- lib/generators/decorator/templates/
|
158
|
-
- lib/generators/dekorator/install_generator.rb
|
158
|
+
- lib/generators/decorator_generator.rb
|
159
|
+
- lib/generators/dekorator/decorator/USAGE
|
160
|
+
- lib/generators/dekorator/decorator/decorator_generator.rb
|
161
|
+
- lib/generators/dekorator/decorator/templates/decorator.rb
|
162
|
+
- lib/generators/dekorator/install/install_generator.rb
|
159
163
|
- lib/generators/rspec/decorator_generator.rb
|
160
164
|
- lib/generators/rspec/templates/decorator_spec.rb
|
161
165
|
- lib/generators/test_unit/decorator_generator.rb
|
162
166
|
- lib/generators/test_unit/templates/decorator_test.rb
|
163
|
-
homepage:
|
167
|
+
homepage: http://komponent.io
|
164
168
|
licenses:
|
165
169
|
- MIT
|
166
|
-
metadata:
|
170
|
+
metadata:
|
171
|
+
homepage_uri: https://github.com/komposable/dekorator
|
172
|
+
changelog_uri: https://github.com/komposable/dekorator/blob/master/CHANGELOG.md
|
173
|
+
source_code_uri: https://github.com/komposable/dekorator
|
174
|
+
bug_tracker_uri: https://github.com/komposable/dekorator/issues
|
167
175
|
post_install_message:
|
168
176
|
rdoc_options: []
|
169
177
|
require_paths:
|
@@ -175,11 +183,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
175
183
|
version: '2.3'
|
176
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
185
|
requirements:
|
178
|
-
- - "
|
186
|
+
- - ">="
|
179
187
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
188
|
+
version: '0'
|
181
189
|
requirements: []
|
182
|
-
rubygems_version: 3.
|
190
|
+
rubygems_version: 3.2.9
|
183
191
|
signing_key:
|
184
192
|
specification_version: 4
|
185
193
|
summary: An opinionated way of organizing model-view code in Ruby on Rails, based
|
data/.editorconfig
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
; top-most EditorConfig file
|
2
|
-
root = true
|
3
|
-
|
4
|
-
; Unix-style newlines
|
5
|
-
[*]
|
6
|
-
end_of_line = LF
|
7
|
-
indent_style = space
|
8
|
-
indent_size = 2
|
9
|
-
charset = utf-8
|
10
|
-
trim_trailing_whitespace = true
|
11
|
-
insert_final_newline = true
|
12
|
-
|
13
|
-
[*.md]
|
14
|
-
trim_trailing_whitespace = false
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,114 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
TargetRubyVersion: 2.2
|
3
|
-
DisabledByDefault: true
|
4
|
-
Exclude:
|
5
|
-
- lib/generators/**/templates/**/*
|
6
|
-
|
7
|
-
Gemspec/OrderedDependencies:
|
8
|
-
Enabled: true
|
9
|
-
|
10
|
-
Style/BlockDelimiters:
|
11
|
-
Enabled: true
|
12
|
-
|
13
|
-
Style/BracesAroundHashParameters:
|
14
|
-
Enabled: true
|
15
|
-
EnforcedStyle: no_braces
|
16
|
-
|
17
|
-
Style/Dir:
|
18
|
-
Enabled: true
|
19
|
-
|
20
|
-
Style/Encoding:
|
21
|
-
Enabled: true
|
22
|
-
|
23
|
-
Style/For:
|
24
|
-
Enabled: true
|
25
|
-
EnforcedStyle: each
|
26
|
-
|
27
|
-
Style/MethodCallWithoutArgsParentheses:
|
28
|
-
Enabled: true
|
29
|
-
|
30
|
-
Style/MethodDefParentheses:
|
31
|
-
Enabled: true
|
32
|
-
|
33
|
-
Style/FrozenStringLiteralComment:
|
34
|
-
Enabled: true
|
35
|
-
EnforcedStyle: always
|
36
|
-
|
37
|
-
Naming/ConstantName:
|
38
|
-
Enabled: true
|
39
|
-
|
40
|
-
Naming/FileName:
|
41
|
-
Enabled: true
|
42
|
-
|
43
|
-
Naming/MethodName:
|
44
|
-
Enabled: true
|
45
|
-
|
46
|
-
Naming/PredicateName:
|
47
|
-
Enabled: true
|
48
|
-
|
49
|
-
Naming/VariableName:
|
50
|
-
Enabled: true
|
51
|
-
|
52
|
-
Lint/DeprecatedClassMethods:
|
53
|
-
Enabled: true
|
54
|
-
|
55
|
-
Layout/AlignParameters:
|
56
|
-
Enabled: true
|
57
|
-
|
58
|
-
Layout/BlockAlignment:
|
59
|
-
Enabled: true
|
60
|
-
EnforcedStyleAlignWith: start_of_block
|
61
|
-
|
62
|
-
Layout/BlockEndNewline:
|
63
|
-
Enabled: true
|
64
|
-
|
65
|
-
Layout/CaseIndentation:
|
66
|
-
Enabled: true
|
67
|
-
|
68
|
-
Layout/ClosingParenthesisIndentation:
|
69
|
-
Enabled: true
|
70
|
-
|
71
|
-
Layout/ConditionPosition:
|
72
|
-
Enabled: true
|
73
|
-
|
74
|
-
Layout/DefEndAlignment:
|
75
|
-
Enabled: true
|
76
|
-
|
77
|
-
Layout/DotPosition:
|
78
|
-
Enabled: true
|
79
|
-
|
80
|
-
Layout/ElseAlignment:
|
81
|
-
Enabled: true
|
82
|
-
|
83
|
-
Layout/EmptyLines:
|
84
|
-
Enabled: true
|
85
|
-
|
86
|
-
Layout/EmptyLinesAroundAccessModifier:
|
87
|
-
Enabled: true
|
88
|
-
|
89
|
-
Layout/SpaceAroundBlockParameters:
|
90
|
-
Enabled: true
|
91
|
-
|
92
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
93
|
-
Enabled: true
|
94
|
-
|
95
|
-
Layout/SpaceAroundOperators:
|
96
|
-
Enabled: true
|
97
|
-
|
98
|
-
Layout/SpaceBeforeBlockBraces:
|
99
|
-
Enabled: true
|
100
|
-
|
101
|
-
Layout/SpaceBeforeComma:
|
102
|
-
Enabled: true
|
103
|
-
|
104
|
-
Layout/SpaceInsideArrayLiteralBrackets:
|
105
|
-
Enabled: true
|
106
|
-
|
107
|
-
Layout/SpaceInsideHashLiteralBraces:
|
108
|
-
Enabled: true
|
109
|
-
|
110
|
-
Layout/SpaceInsideParens:
|
111
|
-
Enabled: true
|
112
|
-
|
113
|
-
Layout/TrailingWhitespace:
|
114
|
-
Enabled: true
|