hydramata-works 0.0.1.prerelease

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.hound.yml +818 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +20 -0
  6. data/CONTRIBUTING.md +220 -0
  7. data/Gemfile +36 -0
  8. data/Guardfile +36 -0
  9. data/LICENSE +15 -0
  10. data/README.md +36 -0
  11. data/Rakefile +47 -0
  12. data/TODO.md +74 -0
  13. data/VISION.md +19 -0
  14. data/app/forms/hydramata/works/entity_form.rb +92 -0
  15. data/app/forms/hydramata/works/validation_service.rb +78 -0
  16. data/app/models/hydramata/works/data_definition.rb +57 -0
  17. data/app/models/hydramata/works/entities.rb +11 -0
  18. data/app/models/hydramata/works/entity.rb +75 -0
  19. data/app/models/hydramata/works/predicate.rb +35 -0
  20. data/app/models/hydramata/works/predicate_presentation_sequences/storage.rb +29 -0
  21. data/app/models/hydramata/works/predicate_set.rb +44 -0
  22. data/app/models/hydramata/works/predicate_sets/storage.rb +45 -0
  23. data/app/models/hydramata/works/predicates.rb +14 -0
  24. data/app/models/hydramata/works/predicates/storage.rb +33 -0
  25. data/app/models/hydramata/works/presentation_structure.rb +29 -0
  26. data/app/models/hydramata/works/property.rb +72 -0
  27. data/app/models/hydramata/works/property_set.rb +89 -0
  28. data/app/models/hydramata/works/validations.rb +6 -0
  29. data/app/models/hydramata/works/value.rb +34 -0
  30. data/app/models/hydramata/works/work_type.rb +49 -0
  31. data/app/models/hydramata/works/work_types.rb +14 -0
  32. data/app/models/hydramata/works/work_types/storage.rb +42 -0
  33. data/app/parsers/hydramata/works/datastream_parser.rb +36 -0
  34. data/app/parsers/hydramata/works/datastream_parsers/rdf_ntriples_parser.rb +60 -0
  35. data/app/parsers/hydramata/works/datastream_parsers/simple_xml_parser.rb +27 -0
  36. data/app/parsers/hydramata/works/predicate_parser.rb +31 -0
  37. data/app/parsers/hydramata/works/predicate_parsers/simple_parser.rb +13 -0
  38. data/app/parsers/hydramata/works/validations_parser.rb +22 -0
  39. data/app/parsers/hydramata/works/value_parser.rb +26 -0
  40. data/app/parsers/hydramata/works/value_parsers.rb +27 -0
  41. data/app/parsers/hydramata/works/value_parsers/date_parser.rb +13 -0
  42. data/app/parsers/hydramata/works/value_parsers/interrogation_parser.rb +18 -0
  43. data/app/parsers/hydramata/works/value_parsers/simple_parser.rb +14 -0
  44. data/app/presenters/hydramata/works/base_presenter.rb +146 -0
  45. data/app/presenters/hydramata/works/dom_attributes_builder.rb +24 -0
  46. data/app/presenters/hydramata/works/entity_presenter.rb +67 -0
  47. data/app/presenters/hydramata/works/fieldset_presenter.rb +54 -0
  48. data/app/presenters/hydramata/works/property_presenter.rb +51 -0
  49. data/app/presenters/hydramata/works/value_presenter.rb +60 -0
  50. data/app/renderers/hydramata/works/entity_renderer.rb +45 -0
  51. data/app/views/hydramata/works/fieldsets/_edit.html.erb +4 -0
  52. data/app/views/hydramata/works/fieldsets/_show.html.erb +8 -0
  53. data/app/views/hydramata/works/fieldsets/_show.json.jbuilder +8 -0
  54. data/app/views/hydramata/works/properties/_edit.html.erb +12 -0
  55. data/app/views/hydramata/works/properties/_show.html.erb +3 -0
  56. data/app/views/hydramata/works/properties/_show.json.jbuilder +1 -0
  57. data/app/views/hydramata/works/works/_edit.html.erb +8 -0
  58. data/app/views/hydramata/works/works/_new.html.erb +8 -0
  59. data/app/views/hydramata/works/works/_show.html.erb +3 -0
  60. data/app/views/hydramata/works/works/_show.json.jbuilder +13 -0
  61. data/app/wranglers/hydramata/works/fedora_wrangler.rb +66 -0
  62. data/bin/rails +12 -0
  63. data/db/migrate/20140606132349_create_hydramata_work_predicates.rb +13 -0
  64. data/db/migrate/20140606132350_create_hydramata_work_types.rb +9 -0
  65. data/db/migrate/20140606132351_create_hydramata_work_predicate_sets.rb +13 -0
  66. data/db/migrate/20140606132352_create_hydramata_work_predicate_presentation_sequences.rb +12 -0
  67. data/db/migrate/20140623200635_add_validations_to_predicates.rb +5 -0
  68. data/db/migrate/20140627134133_adding_item_type_schema_dot_org_to_work_type.rb +5 -0
  69. data/db/migrate/20140627140840_adding_item_prop_schema_dot_org_to_predicate.rb +5 -0
  70. data/db/seeds.rb +36 -0
  71. data/documents/administrative-set-strawperson.md +45 -0
  72. data/documents/diagrams/hydramata-refactor-tasks.dot +88 -0
  73. data/documents/diagrams/hydramata-sip-dip-aip.dot +88 -0
  74. data/documents/diagrams/hydramata-work-architecture.dot +129 -0
  75. data/documents/diagrams/hydramata-work-subcomponents.dot +36 -0
  76. data/documents/diagrams/map-from-database-to-work-object.dot +44 -0
  77. data/documents/diagrams/map-from-fedora-to-work-object.dot +51 -0
  78. data/documents/diagrams/map-from-input-to-work-object.dot +37 -0
  79. data/documents/diagrams/map-from-work-object-to-database.dot +31 -0
  80. data/documents/diagrams/work-rendering.dot +53 -0
  81. data/documents/diagrams/work-structure.dot +32 -0
  82. data/documents/handling-work.md +224 -0
  83. data/documents/high-level-stories.md +105 -0
  84. data/documents/hydramata-components.md +82 -0
  85. data/documents/interface-between-work-and-permissions.md +131 -0
  86. data/documents/interface-between-work-and-workflow.md +6 -0
  87. data/documents/timeline.md +75 -0
  88. data/fs +3 -0
  89. data/gemfiles/rails4.1.gemfile +12 -0
  90. data/gemfiles/rails4.gemfile +13 -0
  91. data/hydramata-works.gemspec +43 -0
  92. data/lib/hydramata-works.rb +23 -0
  93. data/lib/hydramata/works/conversions.rb +21 -0
  94. data/lib/hydramata/works/conversions/exceptions.rb +18 -0
  95. data/lib/hydramata/works/conversions/predicate.rb +22 -0
  96. data/lib/hydramata/works/conversions/predicate_set.rb +28 -0
  97. data/lib/hydramata/works/conversions/presented_fieldsets.rb +28 -0
  98. data/lib/hydramata/works/conversions/presenter.rb +13 -0
  99. data/lib/hydramata/works/conversions/property.rb +31 -0
  100. data/lib/hydramata/works/conversions/property_set.rb +23 -0
  101. data/lib/hydramata/works/conversions/translation_key_fragment.rb +20 -0
  102. data/lib/hydramata/works/conversions/value.rb +20 -0
  103. data/lib/hydramata/works/conversions/work_type.rb +26 -0
  104. data/lib/hydramata/works/engine.rb +31 -0
  105. data/lib/hydramata/works/linters.rb +99 -0
  106. data/lib/hydramata/works/linters/implement_data_definition_interface_matcher.rb +17 -0
  107. data/lib/hydramata/works/linters/implement_entity_interface_matcher.rb +16 -0
  108. data/lib/hydramata/works/linters/implement_predicate_interface_matcher.rb +17 -0
  109. data/lib/hydramata/works/linters/implement_predicate_set_interface_matcher.rb +8 -0
  110. data/lib/hydramata/works/linters/implement_property_set_interface_matcher.rb +8 -0
  111. data/lib/hydramata/works/linters/implement_value_interface_matcher.rb +8 -0
  112. data/lib/hydramata/works/linters/implement_work_type_interface_matcher.rb +13 -0
  113. data/lib/hydramata/works/linters/interface_matcher_builder.rb +36 -0
  114. data/lib/hydramata/works/translator.rb +67 -0
  115. data/lib/hydramata/works/version.rb +5 -0
  116. data/lib/hydramata_works.rb +2 -0
  117. data/lib/tasks/hydramata_work_tasks.rake +4 -0
  118. data/run_each_spec_in_isolation +16 -0
  119. data/run_each_spec_in_isolation.txt +110 -0
  120. data/script/analyzer.rb +124 -0
  121. data/script/fast_specs +22 -0
  122. data/spec/features/fedora_to_in_memory_spec.rb +60 -0
  123. data/spec/features/format_and_view_path_overrides_spec.rb +72 -0
  124. data/spec/features/in_memory_to_output_buffer_spec.rb +109 -0
  125. data/spec/features/instantiate_entity_from_persisted_work_type_spec.rb +26 -0
  126. data/spec/features/new_user_input_to_in_memory_spec.rb +75 -0
  127. data/spec/features/translation_services_spec.rb +107 -0
  128. data/spec/features/validate_entity_based_on_work_type_structure_spec.rb +19 -0
  129. data/spec/fixtures/cassettes/fedora-object.yml +299 -0
  130. data/spec/fixtures/translations.yml +20 -0
  131. data/spec/forms/hydramata/works/entity_form_spec.rb +83 -0
  132. data/spec/forms/hydramata/works/validation_service_spec.rb +32 -0
  133. data/spec/lib/hydramata-work_spec.rb +14 -0
  134. data/spec/lib/hydramata/works/conversions/predicate_set_spec.rb +50 -0
  135. data/spec/lib/hydramata/works/conversions/predicate_spec.rb +43 -0
  136. data/spec/lib/hydramata/works/conversions/presented_fieldsets_spec.rb +52 -0
  137. data/spec/lib/hydramata/works/conversions/presenter_spec.rb +22 -0
  138. data/spec/lib/hydramata/works/conversions/property_set_spec.rb +42 -0
  139. data/spec/lib/hydramata/works/conversions/property_spec.rb +68 -0
  140. data/spec/lib/hydramata/works/conversions/translation_key_fragment_spec.rb +45 -0
  141. data/spec/lib/hydramata/works/conversions/value_spec.rb +36 -0
  142. data/spec/lib/hydramata/works/conversions/work_type_spec.rb +55 -0
  143. data/spec/lib/hydramata/works/translator_spec.rb +81 -0
  144. data/spec/models/hydramata/works/data_definition_spec.rb +53 -0
  145. data/spec/models/hydramata/works/entity_spec.rb +50 -0
  146. data/spec/models/hydramata/works/predicate_presentation_sequences/storage_spec.rb +15 -0
  147. data/spec/models/hydramata/works/predicate_set_spec.rb +63 -0
  148. data/spec/models/hydramata/works/predicate_sets/storage_spec.rb +37 -0
  149. data/spec/models/hydramata/works/predicate_spec.rb +16 -0
  150. data/spec/models/hydramata/works/predicates/storage_spec.rb +78 -0
  151. data/spec/models/hydramata/works/predicates_spec.rb +18 -0
  152. data/spec/models/hydramata/works/presentation_structure_spec.rb +27 -0
  153. data/spec/models/hydramata/works/property_set_spec.rb +135 -0
  154. data/spec/models/hydramata/works/property_spec.rb +74 -0
  155. data/spec/models/hydramata/works/value_spec.rb +61 -0
  156. data/spec/models/hydramata/works/work_type_spec.rb +45 -0
  157. data/spec/models/hydramata/works/work_types/storage_spec.rb +74 -0
  158. data/spec/models/hydramata/works/work_types_spec.rb +16 -0
  159. data/spec/parsers/hydramata/works/datastream_parser_spec.rb +29 -0
  160. data/spec/parsers/hydramata/works/datastream_parsers/rdf_ntriples_parser_spec.rb +65 -0
  161. data/spec/parsers/hydramata/works/datastream_parsers/simple_xml_parser_spec.rb +37 -0
  162. data/spec/parsers/hydramata/works/predicate_parser_spec.rb +30 -0
  163. data/spec/parsers/hydramata/works/predicate_parsers/simple_parser_spec.rb +20 -0
  164. data/spec/parsers/hydramata/works/validations_parser_spec.rb +31 -0
  165. data/spec/parsers/hydramata/works/value_parser_spec.rb +22 -0
  166. data/spec/parsers/hydramata/works/value_parsers/simple_parser_spec.rb +20 -0
  167. data/spec/parsers/hydramata/works/value_parsers_spec.rb +36 -0
  168. data/spec/presenters/hydramata/works/base_presenter_spec.rb +111 -0
  169. data/spec/presenters/hydramata/works/dom_attributes_builder_spec.rb +26 -0
  170. data/spec/presenters/hydramata/works/entity_presenter_spec.rb +51 -0
  171. data/spec/presenters/hydramata/works/fieldset_presenter_spec.rb +58 -0
  172. data/spec/presenters/hydramata/works/property_presenter_spec.rb +42 -0
  173. data/spec/presenters/hydramata/works/value_presenter_spec.rb +49 -0
  174. data/spec/renderers/hydramata/works/entity_renderer_spec.rb +25 -0
  175. data/spec/spec_active_record_helper.rb +30 -0
  176. data/spec/spec_fast_helper.rb +12 -0
  177. data/spec/spec_slow_helper.rb +56 -0
  178. data/spec/spec_view_helper.rb +14 -0
  179. data/spec/test_app_templates/lib/generators/test_app_generator.rb +21 -0
  180. data/spec/views/hydramata/works/fieldsets/_edit.html.erb_spec.rb +29 -0
  181. data/spec/views/hydramata/works/fieldsets/_show.html.erb_spec.rb +25 -0
  182. data/spec/views/hydramata/works/properties/_edit.html.erb_spec.rb +22 -0
  183. data/spec/views/hydramata/works/properties/_show.html.erb_spec.rb +22 -0
  184. data/spec/views/hydramata/works/works/_edit.html.erb_spec.rb +23 -0
  185. data/spec/views/hydramata/works/works/_new.html.erb_spec.rb +23 -0
  186. data/spec/views/hydramata/works/works/_show.html.erb_spec.rb +24 -0
  187. data/spec/wranglers/hydramata/works/fedora_wrangler_spec.rb +26 -0
  188. metadata +466 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ad535741793b7529dc26225a0148ecb470e0afe2
4
+ data.tar.gz: 0f7ab2211396d288c05514de67c453ce6053b310
5
+ SHA512:
6
+ metadata.gz: 96f9b1f4bbe320de0663e7756c24e983baa79d7e5268350bca9c9ac61fc54deab8261ba55c837c40d7a014ae7d5cfc61a0fbad506e26acd6e301d116b0b3b797
7
+ data.tar.gz: 8ba755e3f21ed66036f3139cad377ea0f2ed8561c11f73caa689e83b26a068cb52add6c0ce56446ca356d6f6dc116f6d4928d099e9f1fd5d810bf7157c103d32
@@ -0,0 +1,15 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+
5
+ Gemfile.lock
6
+ spec/internal
7
+ ./spec/internal
8
+ coverage
9
+ *.sqlite3
10
+ tmp/
11
+ documents/**/*.png
12
+ documents/**/*.pdf
13
+ .yardoc
14
+ doc/
15
+ .ruby-version
@@ -0,0 +1,818 @@
1
+ ################################################################################
2
+ ## Releasing the hounds in your local environment.
3
+ ##
4
+ ## Setup:
5
+ ## $ gem install rubocop
6
+ ##
7
+ ## Run:
8
+ ## $ rubocop ./path/to/file ./or/path/to/directory -c ./.hound.yml
9
+ ##
10
+ ################################################################################
11
+
12
+ ################################################################################
13
+ ##
14
+ ## Custom options for Hydramata::Works
15
+ ## These options were plucked from below and modified accordingly.
16
+ ##
17
+ ################################################################################
18
+ AllCops:
19
+ Include:
20
+ - Rakefile
21
+ - config.ru
22
+ Exclude:
23
+ - db/**/*
24
+ - config/**/*
25
+ - lib/**/version.rb
26
+ - spec/internal/**/*
27
+ - spec/*_helper.rb
28
+
29
+ MethodLength:
30
+ Max: 10
31
+ Description: 'Avoid methods longer than 10 lines of code.'
32
+ CountComments: false
33
+ Enabled: true
34
+
35
+ LineLength:
36
+ Description: 'Limit lines to 140 characters.'
37
+ Max: 140
38
+ Enabled: true
39
+
40
+ ClassLength:
41
+ Max: 100
42
+ Description: 'Avoid classes longer than 100 lines of code.'
43
+ CountComments: false
44
+ Enabled: true
45
+
46
+ ################################################################################
47
+ ##
48
+ ## Below this banner, the configuration options were copied from the following
49
+ ## URL:
50
+ ## https://raw.githubusercontent.com/bbatsov/rubocop/master/config/enabled.yml
51
+ ##
52
+ ################################################################################
53
+
54
+ # These are all the cops that are enabled in the default configuration.
55
+
56
+ AccessModifierIndentation:
57
+ Description: Check indentation of private/protected visibility modifiers.
58
+ Enabled: true
59
+
60
+ AccessorMethodName:
61
+ Description: Check the naming of accessor methods for get_/set_.
62
+ Enabled: true
63
+
64
+ Alias:
65
+ Description: 'Use alias_method instead of alias.'
66
+ Enabled: true
67
+
68
+ AlignArray:
69
+ Description: >-
70
+ Align the elements of an array literal if they span more than
71
+ one line.
72
+ Enabled: true
73
+
74
+ AlignHash:
75
+ Description: >-
76
+ Align the elements of a hash literal if they span more than
77
+ one line.
78
+ Enabled: true
79
+
80
+ AlignParameters:
81
+ Description: >-
82
+ Align the parameters of a method call if they span more
83
+ than one line.
84
+ Enabled: true
85
+
86
+ AndOr:
87
+ Description: 'Use &&/|| instead of and/or.'
88
+ Enabled: true
89
+
90
+ ArrayJoin:
91
+ Description: 'Use Array#join instead of Array#*.'
92
+ Enabled: true
93
+
94
+ AsciiComments:
95
+ Description: 'Use only ascii symbols in comments.'
96
+ Enabled: true
97
+
98
+ AsciiIdentifiers:
99
+ Description: 'Use only ascii symbols in identifiers.'
100
+ Enabled: true
101
+
102
+ Attr:
103
+ Description: 'Checks for uses of Module#attr.'
104
+ Enabled: true
105
+
106
+ BeginBlock:
107
+ Description: 'Avoid the use of BEGIN blocks.'
108
+ Enabled: true
109
+
110
+ BlockComments:
111
+ Description: 'Do not use block comments.'
112
+ Enabled: true
113
+
114
+ BlockNesting:
115
+ Description: 'Avoid excessive block nesting'
116
+ Enabled: true
117
+
118
+ Blocks:
119
+ Description: >-
120
+ Avoid using {...} for multi-line blocks (multiline chaining is
121
+ always ugly).
122
+ Prefer {...} over do...end for single-line blocks.
123
+ Enabled: true
124
+
125
+ BracesAroundHashParameters:
126
+ Description: 'Enforce braces style inside hash parameters.'
127
+ Enabled: true
128
+
129
+ CaseEquality:
130
+ Description: 'Avoid explicit use of the case equality operator(===).'
131
+ Enabled: true
132
+
133
+ CaseIndentation:
134
+ Description: 'Indentation of when in a case/when/[else/]end.'
135
+ Enabled: true
136
+
137
+ CharacterLiteral:
138
+ Description: 'Checks for uses of character literals.'
139
+ Enabled: true
140
+
141
+ ClassAndModuleCamelCase:
142
+ Description: 'Use CamelCase for classes and modules.'
143
+ Enabled: true
144
+
145
+ ClassAndModuleChildren:
146
+ Description: 'Checks style of children classes and modules.'
147
+ Enabled: true
148
+
149
+ ClassMethods:
150
+ Description: 'Use self when defining module/class methods.'
151
+ Enabled: true
152
+
153
+ ClassVars:
154
+ Description: 'Avoid the use of class variables.'
155
+ Enabled: true
156
+
157
+ CollectionMethods:
158
+ Description: 'Preferred collection methods.'
159
+ Enabled: true
160
+
161
+ ColonMethodCall:
162
+ Description: 'Do not use :: for method call.'
163
+ Enabled: true
164
+
165
+ CommentAnnotation:
166
+ Description: >-
167
+ Checks formatting of special comments
168
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
169
+ Enabled: true
170
+
171
+ CommentIndentation:
172
+ Description: 'Indentation of comments.'
173
+ Enabled: true
174
+
175
+ ConstantName:
176
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
177
+ Enabled: true
178
+
179
+ CyclomaticComplexity:
180
+ Description: 'Avoid complex methods.'
181
+ Enabled: true
182
+
183
+ DefWithParentheses:
184
+ Description: 'Use def with parentheses when there are arguments.'
185
+ Enabled: true
186
+
187
+ Delegate:
188
+ Description: 'Prefer delegate method for delegations.'
189
+ Enabled: true
190
+
191
+ DeprecatedHashMethods:
192
+ Description: 'Checks for use of deprecated Hash methods.'
193
+ Enabled: true
194
+
195
+ Documentation:
196
+ Description: 'Document classes and non-namespace modules.'
197
+ Enabled: true
198
+ Exclude:
199
+ - spec/**/*
200
+ - lib/**/version.rb
201
+
202
+ DotPosition:
203
+ Description: 'Checks the position of the dot in multi-line method calls.'
204
+ EnforcedStyle: trailing
205
+ Enabled: true
206
+
207
+ DoubleNegation:
208
+ Description: 'Checks for uses of double negation (!!).'
209
+ Enabled: true
210
+
211
+ EachWithObject:
212
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
213
+ Enabled: true
214
+
215
+ EmptyLineBetweenDefs:
216
+ Description: 'Use empty lines between defs.'
217
+ Enabled: true
218
+
219
+ EmptyLines:
220
+ Description: "Don't use several empty lines in a row."
221
+ Enabled: true
222
+
223
+ EmptyLinesAroundAccessModifier:
224
+ Description: "Keep blank lines around access modifiers."
225
+ Enabled: true
226
+
227
+ EmptyLinesAroundBody:
228
+ Description: "Keeps track of empty lines around expression bodies."
229
+ Enabled: true
230
+
231
+ EmptyLiteral:
232
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
233
+ Enabled: true
234
+
235
+ Encoding:
236
+ Description: 'Use UTF-8 as the source file encoding.'
237
+ Enabled: true
238
+
239
+ EndBlock:
240
+ Description: 'Avoid the use of END blocks.'
241
+ Enabled: true
242
+
243
+ EndOfLine:
244
+ Description: 'Use Unix-style line endings.'
245
+ Enabled: true
246
+
247
+ EvenOdd:
248
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
249
+ Enabled: true
250
+
251
+ FileName:
252
+ Description: 'Use snake_case for source file names.'
253
+ Enabled: false
254
+
255
+ FlipFlop:
256
+ Description: 'Checks for flip flops'
257
+ Enabled: true
258
+
259
+ For:
260
+ Description: 'Checks use of for or each in multiline loops.'
261
+ Enabled: true
262
+
263
+ FormatString:
264
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
265
+ Enabled: true
266
+
267
+ GlobalVars:
268
+ Description: 'Do not introduce global variables.'
269
+ Enabled: true
270
+
271
+ HashSyntax:
272
+ Description: >-
273
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
274
+ { :a => 1, :b => 2 }.
275
+ Enabled: true
276
+
277
+ IfUnlessModifier:
278
+ Description: >-
279
+ Favor modifier if/unless usage when you have a
280
+ single-line body.
281
+ Enabled: true
282
+
283
+ IfWithSemicolon:
284
+ Description: 'Never use if x; .... Use the ternary operator instead.'
285
+ Enabled: true
286
+
287
+ IndentationConsistency:
288
+ Description: 'Keep indentation straight.'
289
+ Enabled: true
290
+
291
+ IndentationWidth:
292
+ Description: 'Use 2 spaces for indentation.'
293
+ Enabled: true
294
+
295
+ IndentArray:
296
+ Description: >-
297
+ Checks the indentation of the first element in an array
298
+ literal.
299
+ Enabled: true
300
+
301
+ IndentHash:
302
+ Description: 'Checks the indentation of the first key in a hash literal.'
303
+ Enabled: true
304
+
305
+ Lambda:
306
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
307
+ Enabled: true
308
+
309
+ LambdaCall:
310
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
311
+ Enabled: true
312
+
313
+ LeadingCommentSpace:
314
+ Description: 'Comments should start with a space.'
315
+ Enabled: true
316
+
317
+ LineEndConcatenation:
318
+ Description: >-
319
+ Use \ instead of + or << to concatenate two string literals at
320
+ line end.
321
+ Enabled: true
322
+
323
+ MethodCallParentheses:
324
+ Description: 'Do not use parentheses for method calls with no arguments.'
325
+ Enabled: true
326
+
327
+ MethodDefParentheses:
328
+ Description: >-
329
+ Checks if the method definitions have or don't have
330
+ parentheses.
331
+ Enabled: true
332
+
333
+ MethodName:
334
+ Description: 'Use the configured style when naming methods.'
335
+ Enabled: true
336
+
337
+ ModuleFunction:
338
+ Description: 'Checks for usage of `extend self` in modules.'
339
+ Enabled: true
340
+
341
+ MultilineBlockChain:
342
+ Description: 'Avoid multi-line chains of blocks.'
343
+ Enabled: true
344
+
345
+ MultilineIfThen:
346
+ Description: 'Never use then for multi-line if/unless.'
347
+ Enabled: true
348
+
349
+ MultilineTernaryOperator:
350
+ Description: >-
351
+ Avoid multi-line ?: (the ternary operator);
352
+ use if/unless instead.
353
+ Enabled: true
354
+
355
+ NegatedIf:
356
+ Description: >-
357
+ Favor unless over if for negative conditions
358
+ (or control flow or).
359
+ Enabled: true
360
+
361
+ NegatedWhile:
362
+ Description: 'Favor until over while for negative conditions.'
363
+ Enabled: true
364
+
365
+ NestedTernaryOperator:
366
+ Description: 'Use one expression per branch in a ternary operator.'
367
+ Enabled: true
368
+
369
+ Next:
370
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
371
+ Enabled: true
372
+
373
+ NilComparison:
374
+ Description: 'Prefer x.nil? to x == nil.'
375
+ Enabled: true
376
+
377
+ NonNilCheck:
378
+ Description: 'Checks for redundant nil checks.'
379
+ Enabled: true
380
+
381
+ Not:
382
+ Description: 'Use ! instead of not.'
383
+ Enabled: true
384
+
385
+ NumericLiterals:
386
+ Description: >-
387
+ Add underscores to large numeric literals to improve their
388
+ readability.
389
+ Enabled: true
390
+
391
+ OneLineConditional:
392
+ Description: >-
393
+ Favor the ternary operator(?:) over
394
+ if/then/else/end constructs.
395
+ Enabled: true
396
+
397
+ OpMethod:
398
+ Description: 'When defining binary operators, name the argument other.'
399
+ Enabled: true
400
+
401
+ ParameterLists:
402
+ Description: 'Avoid parameter lists longer than three or four parameters.'
403
+ Enabled: true
404
+
405
+ ParenthesesAroundCondition:
406
+ Description: >-
407
+ Don't use parentheses around the condition of an
408
+ if/unless/while.
409
+ Enabled: true
410
+
411
+ PercentLiteralDelimiters:
412
+ Description: 'Use `%`-literal delimiters consistently'
413
+ PreferredDelimiters:
414
+ '%': ()
415
+ '%i': ()
416
+ '%q': ()
417
+ '%Q': ()
418
+ '%r': '{}'
419
+ '%s': ()
420
+ '%w': ()
421
+ '%W': ()
422
+ '%x': ()
423
+ Enabled: true
424
+
425
+ PerlBackrefs:
426
+ Description: 'Avoid Perl-style regex back references.'
427
+ Enabled: true
428
+
429
+ PredicateName:
430
+ Description: 'Check the names of predicate methods.'
431
+ Enabled: true
432
+
433
+ Proc:
434
+ Description: 'Use proc instead of Proc.new.'
435
+ Enabled: true
436
+
437
+ RaiseArgs:
438
+ Description: 'Checks the arguments passed to raise/fail.'
439
+ Enabled: true
440
+
441
+ RedundantBegin:
442
+ Description: "Don't use begin blocks when they are not needed."
443
+ Enabled: true
444
+
445
+ RedundantException:
446
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
447
+ Enabled: true
448
+
449
+ RedundantReturn:
450
+ Description: "Don't use return where it's not required."
451
+ Enabled: true
452
+
453
+ RedundantSelf:
454
+ Description: "Don't use self where it's not needed."
455
+ Enabled: true
456
+
457
+ RegexpLiteral:
458
+ Description: >-
459
+ Use %r for regular expressions matching more than
460
+ `MaxSlashes` '/' characters.
461
+ Use %r only for regular expressions matching more than
462
+ `MaxSlashes` '/' character.
463
+ Enabled: true
464
+
465
+ RescueModifier:
466
+ Description: 'Avoid using rescue in its modifier form.'
467
+ Enabled: true
468
+
469
+ SelfAssignment:
470
+ Description: 'Checks for places where self-assignment shorthand should have been used.'
471
+ Enabled: true
472
+
473
+ Semicolon:
474
+ Description: "Don't use semicolons to terminate expressions."
475
+ Enabled: true
476
+
477
+ SignalException:
478
+ Description: 'Checks for proper usage of fail and raise.'
479
+ Enabled: true
480
+
481
+ SingleLineBlockParams:
482
+ Description: 'Enforces the names of some block params.'
483
+ Enabled: true
484
+
485
+ SingleLineMethods:
486
+ Description: 'Avoid single-line methods.'
487
+ Enabled: true
488
+
489
+ SingleSpaceBeforeFirstArg:
490
+ Description: >-
491
+ Checks that exactly one space is used between a method name
492
+ and the first argument for method calls without parentheses.
493
+ Enabled: true
494
+
495
+ SpaceAfterColon:
496
+ Description: 'Use spaces after colons.'
497
+ Enabled: true
498
+
499
+ SpaceAfterComma:
500
+ Description: 'Use spaces after commas.'
501
+ Enabled: true
502
+
503
+ SpaceAfterControlKeyword:
504
+ Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
505
+ Enabled: true
506
+
507
+ SpaceAfterMethodName:
508
+ Description: >-
509
+ Never put a space between a method name and the opening
510
+ parenthesis in a method definition.
511
+ Enabled: true
512
+
513
+ SpaceAfterNot:
514
+ Description: Tracks redundant space after the ! operator.
515
+ Enabled: true
516
+
517
+ SpaceAfterSemicolon:
518
+ Description: 'Use spaces after semicolons.'
519
+ Enabled: true
520
+
521
+ SpaceBeforeBlockBraces:
522
+ Description: >-
523
+ Checks that the left block brace has or doesn't have space
524
+ before it.
525
+ Enabled: true
526
+
527
+ SpaceInsideBlockBraces:
528
+ Description: >-
529
+ Checks that block braces have or don't have surrounding space.
530
+ For blocks taking parameters, checks that the left brace has
531
+ or doesn't have trailing space.
532
+ Enabled: true
533
+
534
+ SpaceAroundEqualsInParameterDefault:
535
+ Description: >-
536
+ Checks that the equals signs in parameter default assignments
537
+ have or don't have surrounding space depending on
538
+ configuration.
539
+ Enabled: true
540
+
541
+ SpaceAroundOperators:
542
+ Description: 'Use spaces around operators.'
543
+ Enabled: true
544
+
545
+ SpaceBeforeModifierKeyword:
546
+ Description: 'Put a space before the modifier keyword.'
547
+ Enabled: true
548
+
549
+ SpaceInsideBrackets:
550
+ Description: 'No spaces after [ or before ].'
551
+ Enabled: true
552
+
553
+ SpaceInsideHashLiteralBraces:
554
+ Description: "Use spaces inside hash literal braces - or don't."
555
+ Enabled: true
556
+
557
+ SpaceInsideParens:
558
+ Description: 'No spaces after ( or before ).'
559
+ Enabled: true
560
+
561
+ SpecialGlobalVars:
562
+ Description: 'Avoid Perl-style global variables.'
563
+ Enabled: true
564
+
565
+ StringLiterals:
566
+ Description: 'Checks if uses of quotes match the configured preference.'
567
+ Enabled: true
568
+
569
+ Tab:
570
+ Description: 'No hard tabs.'
571
+ Enabled: true
572
+
573
+ TrailingBlankLines:
574
+ Description: 'Checks trailing blank lines and final newline.'
575
+ Enabled: true
576
+
577
+ TrailingComma:
578
+ Description: 'Checks for trailing comma in parameter lists and literals.'
579
+ Enabled: true
580
+
581
+ TrailingWhitespace:
582
+ Description: 'Avoid trailing whitespace.'
583
+ Enabled: true
584
+
585
+ TrivialAccessors:
586
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
587
+ Enabled: true
588
+
589
+ UnlessElse:
590
+ Description: >-
591
+ Never use unless with else. Rewrite these with the positive
592
+ case first.
593
+ Enabled: true
594
+
595
+ UnneededCapitalW:
596
+ Description: 'Checks for %W when interpolation is not needed.'
597
+ Enabled: true
598
+
599
+ VariableInterpolation:
600
+ Description: >-
601
+ Don't interpolate global, instance and class variables
602
+ directly in strings.
603
+ Enabled: true
604
+
605
+ VariableName:
606
+ Description: 'Use the configured style when naming variables.'
607
+ Enabled: true
608
+
609
+ WhenThen:
610
+ Description: 'Use when x then ... for one-line cases.'
611
+ Enabled: true
612
+
613
+ WhileUntilDo:
614
+ Description: 'Checks for redundant do after while or until.'
615
+ Enabled: true
616
+
617
+ WhileUntilModifier:
618
+ Description: >-
619
+ Favor modifier while/until usage when you have a
620
+ single-line body.
621
+ Enabled: true
622
+
623
+ WordArray:
624
+ Description: 'Use %w or %W for arrays of words.'
625
+ Enabled: true
626
+
627
+ #################### Lint ################################
628
+ ### Warnings
629
+
630
+ AmbiguousOperator:
631
+ Description: >-
632
+ Checks for ambiguous operators in the first argument of a
633
+ method invocation without parentheses.
634
+ Enabled: true
635
+
636
+ AmbiguousRegexpLiteral:
637
+ Description: >-
638
+ Checks for ambiguous regexp literals in the first argument of
639
+ a method invocation without parenthesis.
640
+ Enabled: true
641
+
642
+ AssignmentInCondition:
643
+ Description: "Don't use assignment in conditions."
644
+ Enabled: true
645
+
646
+ BlockAlignment:
647
+ Description: 'Align block ends correctly.'
648
+ Enabled: true
649
+
650
+ ConditionPosition:
651
+ Description: 'Checks for condition placed in a confusing position relative to the keyword.'
652
+ Enabled: true
653
+
654
+ Debugger:
655
+ Description: 'Check for debugger calls.'
656
+ Enabled: true
657
+
658
+ DeprecatedClassMethods:
659
+ Description: 'Check for deprecated class method calls.'
660
+ Enabled: true
661
+
662
+ ElseLayout:
663
+ Description: 'Check for odd code arrangement in an else block.'
664
+ Enabled: true
665
+
666
+ EmptyEnsure:
667
+ Description: 'Checks for empty ensure block.'
668
+ Enabled: true
669
+
670
+ EmptyInterpolation:
671
+ Description: 'Checks for empty string interpolation.'
672
+ Enabled: true
673
+
674
+ EndAlignment:
675
+ Description: 'Align ends correctly.'
676
+ Enabled: true
677
+
678
+ EndInMethod:
679
+ Description: 'END blocks should not be placed inside method definitions.'
680
+ Enabled: true
681
+
682
+ EnsureReturn:
683
+ Description: 'Never use return in an ensure block.'
684
+ Enabled: true
685
+
686
+ Eval:
687
+ Description: 'The use of eval represents a serious security risk.'
688
+ Enabled: true
689
+
690
+ GuardClause:
691
+ Description: 'Check for conditionals that can be replaced with guard clauses'
692
+ Enabled: true
693
+
694
+ HandleExceptions:
695
+ Description: "Don't suppress exception."
696
+ Enabled: true
697
+
698
+ InvalidCharacterLiteral:
699
+ Description: >-
700
+ Checks for invalid character literals with a non-escaped
701
+ whitespace character.
702
+ Enabled: true
703
+
704
+ LiteralInCondition:
705
+ Description: 'Checks of literals used in conditions.'
706
+ Enabled: true
707
+
708
+ LiteralInInterpolation:
709
+ Description: 'Checks for literals used in interpolation.'
710
+ Enabled: true
711
+
712
+ Loop:
713
+ Description: >-
714
+ Use Kernel#loop with break rather than begin/end/until or
715
+ begin/end/while for post-loop tests.
716
+ Enabled: true
717
+
718
+ ParenthesesAsGroupedExpression:
719
+ Description: >-
720
+ Checks for method calls with a space before the opening
721
+ parenthesis.
722
+ Enabled: true
723
+
724
+ RequireParentheses:
725
+ Description: >-
726
+ Use parentheses in the method call to avoid confusion
727
+ about precedence.
728
+ Enabled: true
729
+
730
+ RescueException:
731
+ Description: 'Avoid rescuing the Exception class.'
732
+ Enabled: true
733
+
734
+ ShadowingOuterLocalVariable:
735
+ Description: >-
736
+ Do not use the same name as outer local variable
737
+ for block arguments or block local variables.
738
+ Enabled: true
739
+
740
+ SpaceBeforeFirstArg:
741
+ Description: >-
742
+ Put a space between a method name and the first argument
743
+ in a method call without parentheses.
744
+ Enabled: true
745
+
746
+ StringConversionInInterpolation:
747
+ Description: 'Checks for Object#to_s usage in string interpolation.'
748
+ Enabled: true
749
+
750
+ UnderscorePrefixedVariableName:
751
+ Description: 'Do not use prefix `_` for a variable that is used.'
752
+ Enabled: true
753
+
754
+ UnusedBlockArgument:
755
+ Description: 'Checks for unused block arguments.'
756
+ Enabled: true
757
+
758
+ UnusedMethodArgument:
759
+ Description: 'Checks for unused method arguments.'
760
+ Enabled: true
761
+
762
+ UnreachableCode:
763
+ Description: 'Unreachable code.'
764
+ Enabled: true
765
+
766
+ UselessAccessModifier:
767
+ Description: 'Checks for useless access modifiers.'
768
+ Enabled: true
769
+
770
+ UselessAssignment:
771
+ Description: 'Checks for useless assignment to a local variable.'
772
+ Enabled: true
773
+
774
+ UselessComparison:
775
+ Description: 'Checks for comparison of something with itself.'
776
+ Enabled: true
777
+
778
+ UselessElseWithoutRescue:
779
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
780
+ Enabled: true
781
+
782
+ UselessSetterCall:
783
+ Description: 'Checks for useless setter call to a local variable.'
784
+ Enabled: true
785
+
786
+ Void:
787
+ Description: 'Possible use of operator/literal/variable in void context.'
788
+ Enabled: true
789
+
790
+ ##################### Rails ##################################
791
+
792
+ ActionFilter:
793
+ Description: 'Enforces consistent use of action filter methods.'
794
+ Enabled: true
795
+
796
+ DefaultScope:
797
+ Description: 'Checks if the argument passed to default_scope is a block.'
798
+ Enabled: true
799
+
800
+ HasAndBelongsToMany:
801
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
802
+ Enabled: true
803
+
804
+ Output:
805
+ Description: 'Checks for calls to puts, print, etc.'
806
+ Enabled: true
807
+
808
+ ReadWriteAttribute:
809
+ Description: 'Checks for read_attribute(:attr) and write_attribute(:attr, val).'
810
+ Enabled: true
811
+
812
+ ScopeArgs:
813
+ Description: 'Checks the arguments of ActiveRecord scopes.'
814
+ Enabled: true
815
+
816
+ Validation:
817
+ Description: 'Use sexy validations.'
818
+ Enabled: true