druid-tools 1.0.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +10 -0
- data/.github/pull_request_template.md +9 -0
- data/.rubocop.yml +121 -24
- data/.rubocop_todo.yml +39 -311
- data/Gemfile +3 -5
- data/README.md +4 -4
- data/Rakefile +4 -2
- data/VERSION +1 -1
- data/druid-tools.gemspec +10 -7
- data/lib/druid-tools.rb +3 -1
- data/lib/druid_tools/access_druid.rb +7 -6
- data/lib/druid_tools/druid.rb +75 -121
- data/lib/druid_tools/exceptions.rb +6 -4
- data/lib/druid_tools/version.rb +2 -0
- data/lib/druid_tools.rb +2 -0
- data/spec/druid_tools/purl_druid_spec.rb +34 -0
- data/spec/druid_tools_spec.rb +419 -0
- data/spec/spec_helper.rb +3 -1
- metadata +45 -30
- data/.travis.yml +0 -18
- data/spec/access_druid_spec.rb +0 -28
- data/spec/druid_spec.rb +0 -470
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d5dc0962b18ff34e8085117a830f53761c49ba2bec46938ce9c3c660480c30aa
|
4
|
+
data.tar.gz: b30f1011c1f67e7e9f189af18c63b636411c72458b20e8e0e9acd2ab27c14efd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6003ded589605e4a8634b966a6789b3ec482421e339bdfb07449fac3352c8c849b215c3346224b33518f2141e556bd008b7986e0bc46d2cfc523d2babb30adcf
|
7
|
+
data.tar.gz: 6db961fbe64227aa86bd02e6835e57187a6f833574b60d9f5c12511a48b40cb34dfe69d1648608771291f07b36a2de47fa33f18abd8e1fd2f802087a35eaa50d
|
@@ -0,0 +1,9 @@
|
|
1
|
+
## Why was this change made? 🤔
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
## How was this change tested? 🤨
|
6
|
+
|
7
|
+
⚡ ⚠ If this change has cross service impact, ***run [integration tests](https://github.com/sul-dlss/infrastructure-integration-test)*** that exercise the code and/or test in [stage|qa] environment, in addition to specs. ⚡
|
8
|
+
|
9
|
+
|
data/.rubocop.yml
CHANGED
@@ -1,28 +1,18 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
|
-
# Turn on RSpec cops
|
4
3
|
require: rubocop-rspec
|
5
4
|
|
6
5
|
AllCops:
|
6
|
+
TargetRubyVersion: 3.0
|
7
7
|
DisplayCopNames: true
|
8
|
-
Include:
|
9
|
-
- 'Rakefile'
|
10
8
|
Exclude:
|
11
9
|
- 'Gemfile.lock'
|
12
10
|
- '**/*.md'
|
13
|
-
- 'vendor/**/*' # avoid running rubocop on
|
11
|
+
- 'vendor/**/*' # avoid running rubocop on cached bundler
|
14
12
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
# --- Metrics ---
|
20
|
-
|
21
|
-
# because this isn't 1994
|
22
|
-
Metrics/LineLength:
|
23
|
-
Max: 167 # would like to reduce this to 120
|
24
|
-
|
25
|
-
# --- Naming ---
|
13
|
+
Metrics/BlockLength:
|
14
|
+
Exclude:
|
15
|
+
- 'spec/**/*_spec.rb'
|
26
16
|
|
27
17
|
Naming/FileName:
|
28
18
|
Exclude:
|
@@ -30,12 +20,119 @@ Naming/FileName:
|
|
30
20
|
- druid-tools.gemspec
|
31
21
|
- lib/druid-tools.rb
|
32
22
|
|
33
|
-
#
|
34
|
-
|
35
|
-
#
|
36
|
-
|
37
|
-
#
|
38
|
-
|
39
|
-
#
|
40
|
-
|
41
|
-
|
23
|
+
Gemspec/DateAssignment: # new in 1.10
|
24
|
+
Enabled: true
|
25
|
+
Gemspec/RequireMFA: # new in 1.23
|
26
|
+
Enabled: true
|
27
|
+
Layout/LineEndStringConcatenationIndentation: # new in 1.18
|
28
|
+
Enabled: true
|
29
|
+
Layout/SpaceBeforeBrackets: # new in 1.7
|
30
|
+
Enabled: true
|
31
|
+
Lint/AmbiguousAssignment: # new in 1.7
|
32
|
+
Enabled: true
|
33
|
+
Lint/AmbiguousOperatorPrecedence: # new in 1.21
|
34
|
+
Enabled: true
|
35
|
+
Lint/AmbiguousRange: # new in 1.19
|
36
|
+
Enabled: true
|
37
|
+
Lint/DeprecatedConstants: # new in 1.8
|
38
|
+
Enabled: true
|
39
|
+
Lint/DuplicateBranch: # new in 1.3
|
40
|
+
Enabled: true
|
41
|
+
Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
|
42
|
+
Enabled: true
|
43
|
+
Lint/EmptyBlock: # new in 1.1
|
44
|
+
Enabled: true
|
45
|
+
Lint/EmptyClass: # new in 1.3
|
46
|
+
Enabled: true
|
47
|
+
Lint/EmptyInPattern: # new in 1.16
|
48
|
+
Enabled: true
|
49
|
+
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
|
50
|
+
Enabled: true
|
51
|
+
Lint/LambdaWithoutLiteralBlock: # new in 1.8
|
52
|
+
Enabled: true
|
53
|
+
Lint/NoReturnInBeginEndBlocks: # new in 1.2
|
54
|
+
Enabled: true
|
55
|
+
Lint/NumberedParameterAssignment: # new in 1.9
|
56
|
+
Enabled: true
|
57
|
+
Lint/OrAssignmentToConstant: # new in 1.9
|
58
|
+
Enabled: true
|
59
|
+
Lint/RedundantDirGlobSort: # new in 1.8
|
60
|
+
Enabled: true
|
61
|
+
Lint/RequireRelativeSelfPath: # new in 1.22
|
62
|
+
Enabled: true
|
63
|
+
Lint/SymbolConversion: # new in 1.9
|
64
|
+
Enabled: true
|
65
|
+
Lint/ToEnumArguments: # new in 1.1
|
66
|
+
Enabled: true
|
67
|
+
Lint/TripleQuotes: # new in 1.9
|
68
|
+
Enabled: true
|
69
|
+
Lint/UnexpectedBlockArity: # new in 1.5
|
70
|
+
Enabled: true
|
71
|
+
Lint/UnmodifiedReduceAccumulator: # new in 1.1
|
72
|
+
Enabled: true
|
73
|
+
Lint/UselessRuby2Keywords: # new in 1.23
|
74
|
+
Enabled: true
|
75
|
+
Naming/BlockForwarding: # new in 1.24
|
76
|
+
Enabled: true
|
77
|
+
Security/IoMethods: # new in 1.22
|
78
|
+
Enabled: true
|
79
|
+
Style/ArgumentsForwarding: # new in 1.1
|
80
|
+
Enabled: true
|
81
|
+
Style/CollectionCompact: # new in 1.2
|
82
|
+
Enabled: true
|
83
|
+
Style/DocumentDynamicEvalDefinition: # new in 1.1
|
84
|
+
Enabled: true
|
85
|
+
Style/EndlessMethod: # new in 1.8
|
86
|
+
Enabled: true
|
87
|
+
Style/FileRead: # new in 1.24
|
88
|
+
Enabled: true
|
89
|
+
Style/FileWrite: # new in 1.24
|
90
|
+
Enabled: true
|
91
|
+
Style/HashConversion: # new in 1.10
|
92
|
+
Enabled: true
|
93
|
+
Style/HashExcept: # new in 1.7
|
94
|
+
Enabled: true
|
95
|
+
Style/IfWithBooleanLiteralBranches: # new in 1.9
|
96
|
+
Enabled: true
|
97
|
+
Style/InPatternThen: # new in 1.16
|
98
|
+
Enabled: true
|
99
|
+
Style/MapToHash: # new in 1.24
|
100
|
+
Enabled: true
|
101
|
+
Style/MultilineInPatternThen: # new in 1.16
|
102
|
+
Enabled: true
|
103
|
+
Style/NegatedIfElseCondition: # new in 1.2
|
104
|
+
Enabled: true
|
105
|
+
Style/NilLambda: # new in 1.3
|
106
|
+
Enabled: true
|
107
|
+
Style/NumberedParameters: # new in 1.22
|
108
|
+
Enabled: true
|
109
|
+
Style/NumberedParametersLimit: # new in 1.22
|
110
|
+
Enabled: true
|
111
|
+
Style/OpenStructUse: # new in 1.23
|
112
|
+
Enabled: true
|
113
|
+
Style/QuotedSymbols: # new in 1.16
|
114
|
+
Enabled: true
|
115
|
+
Style/RedundantArgument: # new in 1.4
|
116
|
+
Enabled: true
|
117
|
+
Style/RedundantSelfAssignmentBranch: # new in 1.19
|
118
|
+
Enabled: true
|
119
|
+
Style/SelectByRegexp: # new in 1.22
|
120
|
+
Enabled: true
|
121
|
+
Style/StringChars: # new in 1.12
|
122
|
+
Enabled: true
|
123
|
+
Style/SwapValues: # new in 1.1
|
124
|
+
Enabled: true
|
125
|
+
RSpec/BeEq: # new in 2.9.0
|
126
|
+
Enabled: true
|
127
|
+
RSpec/BeNil: # new in 2.9.0
|
128
|
+
Enabled: true
|
129
|
+
RSpec/ExcessiveDocstringSpacing: # new in 2.5
|
130
|
+
Enabled: true
|
131
|
+
RSpec/IdenticalEqualityAssertion: # new in 2.4
|
132
|
+
Enabled: true
|
133
|
+
RSpec/SubjectDeclaration: # new in 2.5
|
134
|
+
Enabled: true
|
135
|
+
RSpec/FactoryBot/SyntaxMethods: # new in 2.7
|
136
|
+
Enabled: true
|
137
|
+
RSpec/Rails/AvoidSetupHook: # new in 2.4
|
138
|
+
Enabled: true
|
data/.rubocop_todo.yml
CHANGED
@@ -1,372 +1,100 @@
|
|
1
1
|
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude`
|
3
|
+
# on 2022-04-01 18:08:00 UTC using RuboCop version 1.26.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count: 2
|
10
|
-
# Cop supports --auto-correct.
|
11
|
-
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
|
12
|
-
# Include: **/Gemfile, **/gems.rb
|
13
|
-
Bundler/OrderedGems:
|
14
|
-
Exclude:
|
15
|
-
- 'Gemfile'
|
16
|
-
|
17
|
-
# Offense count: 6
|
18
|
-
# Cop supports --auto-correct.
|
19
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
20
|
-
# SupportedStyles: empty_lines, no_empty_lines
|
21
|
-
Layout/EmptyLinesAroundBlockBody:
|
22
|
-
Exclude:
|
23
|
-
- 'spec/access_druid_spec.rb'
|
24
|
-
- 'spec/druid_spec.rb'
|
25
|
-
|
26
|
-
# Offense count: 4
|
27
|
-
# Cop supports --auto-correct.
|
28
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
29
|
-
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
|
30
|
-
Layout/EmptyLinesAroundClassBody:
|
31
|
-
Exclude:
|
32
|
-
- 'lib/druid_tools/access_druid.rb'
|
33
|
-
- 'lib/druid_tools/druid.rb'
|
34
|
-
|
35
|
-
# Offense count: 2
|
36
|
-
# Cop supports --auto-correct.
|
37
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
38
|
-
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
|
39
|
-
Layout/EmptyLinesAroundModuleBody:
|
40
|
-
Exclude:
|
41
|
-
- 'lib/druid_tools/access_druid.rb'
|
42
|
-
|
43
|
-
# Offense count: 2
|
44
|
-
# Cop supports --auto-correct.
|
45
|
-
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
|
46
|
-
Layout/ExtraSpacing:
|
47
|
-
Exclude:
|
48
|
-
- 'lib/druid_tools/druid.rb'
|
49
|
-
- 'spec/druid_spec.rb'
|
50
|
-
|
51
9
|
# Offense count: 1
|
52
|
-
#
|
53
|
-
|
54
|
-
Layout/IndentationWidth:
|
55
|
-
Exclude:
|
56
|
-
- 'spec/access_druid_spec.rb'
|
57
|
-
|
58
|
-
# Offense count: 44
|
59
|
-
# Cop supports --auto-correct.
|
60
|
-
Layout/LeadingCommentSpace:
|
61
|
-
Exclude:
|
62
|
-
- 'lib/druid_tools/druid.rb'
|
63
|
-
- 'spec/druid_spec.rb'
|
64
|
-
- 'spec/spec_helper.rb'
|
65
|
-
|
66
|
-
# Offense count: 13
|
67
|
-
# Cop supports --auto-correct.
|
68
|
-
Layout/SpaceAfterComma:
|
69
|
-
Exclude:
|
70
|
-
- 'lib/druid_tools/access_druid.rb'
|
71
|
-
- 'lib/druid_tools/druid.rb'
|
72
|
-
- 'spec/access_druid_spec.rb'
|
73
|
-
|
74
|
-
# Offense count: 11
|
75
|
-
# Cop supports --auto-correct.
|
76
|
-
# Configuration parameters: SupportedStyles.
|
77
|
-
# SupportedStyles: space, no_space
|
78
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
79
|
-
EnforcedStyle: no_space
|
80
|
-
|
81
|
-
# Offense count: 3
|
82
|
-
# Cop supports --auto-correct.
|
83
|
-
Layout/SpaceAroundKeyword:
|
84
|
-
Exclude:
|
85
|
-
- 'lib/druid_tools/druid.rb'
|
86
|
-
|
87
|
-
# Offense count: 2
|
88
|
-
# Cop supports --auto-correct.
|
89
|
-
# Configuration parameters: AllowForAlignment.
|
90
|
-
Layout/SpaceAroundOperators:
|
10
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
|
11
|
+
Metrics/AbcSize:
|
91
12
|
Exclude:
|
92
13
|
- 'lib/druid_tools/druid.rb'
|
93
14
|
|
94
|
-
# Offense count:
|
95
|
-
#
|
96
|
-
|
97
|
-
# SupportedStyles: space, no_space
|
98
|
-
# SupportedStylesForEmptyBraces: space, no_space
|
99
|
-
Layout/SpaceBeforeBlockBraces:
|
100
|
-
Exclude:
|
101
|
-
- 'druid-tools.gemspec'
|
102
|
-
- 'spec/druid_spec.rb'
|
103
|
-
|
104
|
-
# Offense count: 8
|
105
|
-
# Cop supports --auto-correct.
|
106
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces, SpaceBeforeBlockParameters.
|
107
|
-
# SupportedStyles: space, no_space
|
108
|
-
# SupportedStylesForEmptyBraces: space, no_space
|
109
|
-
Layout/SpaceInsideBlockBraces:
|
110
|
-
Exclude:
|
111
|
-
- 'spec/druid_spec.rb'
|
112
|
-
|
113
|
-
# Offense count: 2
|
114
|
-
# Cop supports --auto-correct.
|
115
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
116
|
-
# SupportedStyles: final_newline, final_blank_line
|
117
|
-
Layout/TrailingBlankLines:
|
118
|
-
Exclude:
|
119
|
-
- 'lib/druid-tools.rb'
|
120
|
-
- 'lib/druid_tools/exceptions.rb'
|
121
|
-
|
122
|
-
# Offense count: 21
|
123
|
-
# Cop supports --auto-correct.
|
124
|
-
Lint/DeprecatedClassMethods:
|
15
|
+
# Offense count: 1
|
16
|
+
# Configuration parameters: CountComments, Max, CountAsOne.
|
17
|
+
Metrics/ClassLength:
|
125
18
|
Exclude:
|
126
|
-
- 'lib/druid_tools/access_druid.rb'
|
127
19
|
- 'lib/druid_tools/druid.rb'
|
128
|
-
- 'spec/druid_spec.rb'
|
129
|
-
|
130
|
-
# Offense count: 3
|
131
|
-
# Cop supports --auto-correct.
|
132
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
133
|
-
# SupportedStyles: runtime_error, standard_error
|
134
|
-
Lint/InheritException:
|
135
|
-
Exclude:
|
136
|
-
- 'lib/druid_tools/exceptions.rb'
|
137
20
|
|
138
21
|
# Offense count: 1
|
139
|
-
|
22
|
+
# Configuration parameters: IgnoredMethods, Max.
|
23
|
+
Metrics/CyclomaticComplexity:
|
140
24
|
Exclude:
|
141
|
-
- '
|
142
|
-
|
143
|
-
# Offense count: 1
|
144
|
-
Metrics/AbcSize:
|
145
|
-
Max: 21
|
146
|
-
|
147
|
-
# Offense count: 8
|
148
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
149
|
-
Metrics/BlockLength:
|
150
|
-
Max: 371
|
151
|
-
|
152
|
-
# Offense count: 1
|
153
|
-
# Configuration parameters: CountComments.
|
154
|
-
Metrics/ClassLength:
|
155
|
-
Max: 146
|
25
|
+
- 'lib/druid_tools/druid.rb'
|
156
26
|
|
157
27
|
# Offense count: 1
|
158
|
-
# Configuration parameters: CountComments.
|
28
|
+
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
|
159
29
|
Metrics/MethodLength:
|
160
|
-
Max: 12
|
161
|
-
|
162
|
-
# Offense count: 1
|
163
|
-
# Configuration parameters: Blacklist.
|
164
|
-
# Blacklist: END, (?-mix:EO[A-Z]{1})
|
165
|
-
Naming/HeredocDelimiterNaming:
|
166
30
|
Exclude:
|
167
31
|
- 'lib/druid_tools/druid.rb'
|
168
32
|
|
169
|
-
# Offense count: 2
|
170
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
171
|
-
# SupportedStyles: snake_case, normalcase, non_integer
|
172
|
-
Naming/VariableNumber:
|
173
|
-
Exclude:
|
174
|
-
- 'spec/druid_spec.rb'
|
175
|
-
|
176
33
|
# Offense count: 2
|
177
34
|
RSpec/BeforeAfterAll:
|
178
35
|
Exclude:
|
179
36
|
- 'spec/spec_helper.rb'
|
180
37
|
- 'spec/rails_helper.rb'
|
181
38
|
- 'spec/support/**/*.rb'
|
182
|
-
- 'spec/
|
39
|
+
- 'spec/druid_tools_spec.rb'
|
183
40
|
|
184
|
-
# Offense count:
|
185
|
-
# Configuration parameters:
|
186
|
-
# SupportedStyles: described_class, explicit
|
187
|
-
RSpec/DescribedClass:
|
188
|
-
Exclude:
|
189
|
-
- 'spec/access_druid_spec.rb'
|
190
|
-
- 'spec/druid_spec.rb'
|
191
|
-
|
192
|
-
# Offense count: 10
|
193
|
-
# Configuration parameters: Max.
|
41
|
+
# Offense count: 8
|
42
|
+
# Configuration parameters: Max, CountAsOne.
|
194
43
|
RSpec/ExampleLength:
|
195
44
|
Exclude:
|
196
|
-
- 'spec/
|
45
|
+
- 'spec/druid_tools_spec.rb'
|
197
46
|
|
198
|
-
# Offense count:
|
199
|
-
# Configuration parameters: CustomTransform, IgnoreMethods.
|
47
|
+
# Offense count: 1
|
48
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
49
|
+
# Include: **/*_spec*rb*, **/spec/**/*
|
200
50
|
RSpec/FilePath:
|
201
51
|
Exclude:
|
202
|
-
- 'spec/
|
203
|
-
- 'spec/druid_spec.rb'
|
52
|
+
- 'spec/druid_tools_spec.rb'
|
204
53
|
|
205
|
-
# Offense count:
|
206
|
-
# Configuration parameters:
|
207
|
-
# SupportedStyles: implicit, each, example
|
208
|
-
RSpec/HookArgument:
|
209
|
-
EnforcedStyle: each
|
210
|
-
|
211
|
-
# Offense count: 22
|
54
|
+
# Offense count: 16
|
55
|
+
# Configuration parameters: Max.
|
212
56
|
RSpec/MultipleExpectations:
|
213
|
-
Max: 11
|
214
|
-
|
215
|
-
# Offense count: 8
|
216
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
217
|
-
# SupportedStyles: not_to, to_not
|
218
|
-
RSpec/NotToNot:
|
219
57
|
Exclude:
|
220
|
-
- 'spec/
|
221
|
-
- 'spec/druid_spec.rb'
|
58
|
+
- 'spec/druid_tools_spec.rb'
|
222
59
|
|
223
|
-
# Offense count:
|
224
|
-
# Configuration parameters:
|
225
|
-
|
226
|
-
RSpec/PredicateMatcher:
|
60
|
+
# Offense count: 4
|
61
|
+
# Configuration parameters: AllowSubject, Max.
|
62
|
+
RSpec/MultipleMemoizedHelpers:
|
227
63
|
Exclude:
|
228
|
-
- 'spec/
|
64
|
+
- 'spec/druid_tools_spec.rb'
|
229
65
|
|
230
66
|
# Offense count: 2
|
231
67
|
RSpec/RepeatedExample:
|
232
68
|
Exclude:
|
233
|
-
- 'spec/
|
234
|
-
|
235
|
-
# Offense count: 3
|
236
|
-
# Cop supports --auto-correct.
|
237
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
238
|
-
# SupportedStyles: always, conditionals
|
239
|
-
Style/AndOr:
|
240
|
-
Exclude:
|
241
|
-
- 'lib/druid_tools/access_druid.rb'
|
242
|
-
- 'lib/druid_tools/druid.rb'
|
69
|
+
- 'spec/druid_tools_spec.rb'
|
243
70
|
|
244
71
|
# Offense count: 1
|
245
|
-
|
246
|
-
Exclude:
|
247
|
-
- 'lib/druid_tools/druid.rb'
|
248
|
-
|
249
|
-
# Offense count: 4
|
250
|
-
# Cop supports --auto-correct.
|
251
|
-
Style/ColonMethodCall:
|
252
|
-
Exclude:
|
253
|
-
- 'lib/druid_tools/druid.rb'
|
254
|
-
- 'spec/druid_spec.rb'
|
255
|
-
|
256
|
-
# Offense count: 2
|
72
|
+
# Configuration parameters: AllowedConstants.
|
257
73
|
Style/Documentation:
|
258
74
|
Exclude:
|
259
75
|
- 'spec/**/*'
|
260
76
|
- 'test/**/*'
|
261
|
-
- 'lib/druid_tools.rb'
|
262
|
-
- 'lib/druid_tools/druid.rb'
|
263
|
-
|
264
|
-
# Offense count: 1
|
265
|
-
# Cop supports --auto-correct.
|
266
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles, AutoCorrectEncodingComment.
|
267
|
-
# SupportedStyles: when_needed, always, never
|
268
|
-
Style/Encoding:
|
269
|
-
Exclude:
|
270
|
-
- 'druid-tools.gemspec'
|
271
|
-
|
272
|
-
# Offense count: 8
|
273
|
-
# Cop supports --auto-correct.
|
274
|
-
# Configuration parameters: SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
275
|
-
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
276
|
-
Style/HashSyntax:
|
277
|
-
EnforcedStyle: hash_rockets
|
278
|
-
|
279
|
-
# Offense count: 1
|
280
|
-
# Cop supports --auto-correct.
|
281
|
-
Style/MethodCallWithoutArgsParentheses:
|
282
|
-
Exclude:
|
283
|
-
- 'spec/druid_spec.rb'
|
284
|
-
|
285
|
-
# Offense count: 1
|
286
|
-
# Cop supports --auto-correct.
|
287
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
288
|
-
# SupportedStyles: both, prefix, postfix
|
289
|
-
Style/NegatedIf:
|
290
|
-
Exclude:
|
291
|
-
- 'lib/druid_tools/druid.rb'
|
292
|
-
|
293
|
-
# Offense count: 2
|
294
|
-
# Cop supports --auto-correct.
|
295
|
-
Style/Not:
|
296
|
-
Exclude:
|
297
|
-
- 'lib/druid_tools/access_druid.rb'
|
298
77
|
- 'lib/druid_tools/druid.rb'
|
299
78
|
|
300
79
|
# Offense count: 1
|
301
|
-
#
|
302
|
-
|
303
|
-
# SupportedStyles: predicate, comparison
|
304
|
-
Style/NumericPredicate:
|
80
|
+
# This cop supports safe auto-correction (--auto-correct).
|
81
|
+
Style/IfUnlessModifier:
|
305
82
|
Exclude:
|
306
|
-
- 'spec/**/*'
|
307
83
|
- 'lib/druid_tools/druid.rb'
|
308
84
|
|
309
|
-
# Offense count:
|
310
|
-
#
|
311
|
-
#
|
312
|
-
Style/
|
313
|
-
Exclude:
|
314
|
-
- 'spec/druid_spec.rb'
|
315
|
-
|
316
|
-
# Offense count: 2
|
317
|
-
# Cop supports --auto-correct.
|
318
|
-
Style/RedundantParentheses:
|
85
|
+
# Offense count: 8
|
86
|
+
# Configuration parameters: AllowedMethods.
|
87
|
+
# AllowedMethods: respond_to_missing?
|
88
|
+
Style/OptionalBooleanParameter:
|
319
89
|
Exclude:
|
320
90
|
- 'lib/druid_tools/access_druid.rb'
|
321
91
|
- 'lib/druid_tools/druid.rb'
|
322
92
|
|
323
|
-
# Offense count: 4
|
324
|
-
# Cop supports --auto-correct.
|
325
|
-
# Configuration parameters: AllowMultipleReturnValues.
|
326
|
-
Style/RedundantReturn:
|
327
|
-
Exclude:
|
328
|
-
- 'lib/druid_tools/druid.rb'
|
329
|
-
|
330
|
-
# Offense count: 11
|
331
|
-
# Cop supports --auto-correct.
|
332
|
-
Style/RedundantSelf:
|
333
|
-
Exclude:
|
334
|
-
- 'lib/druid_tools/druid.rb'
|
335
|
-
|
336
|
-
# Offense count: 2
|
337
|
-
# Cop supports --auto-correct.
|
338
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
|
339
|
-
# SupportedStyles: slashes, percent_r, mixed
|
340
|
-
Style/RegexpLiteral:
|
341
|
-
Exclude:
|
342
|
-
- 'spec/access_druid_spec.rb'
|
343
|
-
- 'spec/druid_spec.rb'
|
344
|
-
|
345
|
-
# Offense count: 1
|
346
|
-
# Cop supports --auto-correct.
|
347
|
-
# Configuration parameters: SupportedStyles.
|
348
|
-
# SupportedStyles: use_perl_names, use_english_names
|
349
|
-
Style/SpecialGlobalVars:
|
350
|
-
EnforcedStyle: use_perl_names
|
351
|
-
|
352
|
-
# Offense count: 3
|
353
|
-
# Cop supports --auto-correct.
|
354
|
-
# Configuration parameters: MinSize, SupportedStyles.
|
355
|
-
# SupportedStyles: percent, brackets
|
356
|
-
Style/SymbolArray:
|
357
|
-
EnforcedStyle: brackets
|
358
|
-
|
359
|
-
# Offense count: 2
|
360
|
-
# Cop supports --auto-correct.
|
361
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles, MinSize, WordRegex.
|
362
|
-
# SupportedStyles: percent, brackets
|
363
|
-
Style/WordArray:
|
364
|
-
Exclude:
|
365
|
-
- 'spec/access_druid_spec.rb'
|
366
|
-
- 'spec/druid_spec.rb'
|
367
|
-
|
368
93
|
# Offense count: 2
|
369
|
-
#
|
370
|
-
|
94
|
+
# This cop supports safe auto-correction (--auto-correct).
|
95
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
96
|
+
# URISchemes: http, https
|
97
|
+
Layout/LineLength:
|
371
98
|
Exclude:
|
372
99
|
- 'lib/druid_tools/druid.rb'
|
100
|
+
- 'spec/druid_tools_spec.rb'
|
data/Gemfile
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
group :development do
|
4
|
-
gem
|
5
|
-
gem "rcov", :platform => :ruby_18
|
6
|
-
gem "simplecov", :platform => [:ruby_19, :ruby_20]
|
7
|
-
gem "debugger", :platform => :ruby_19
|
8
|
-
gem "pry-debugger", :platform => :ruby_19
|
6
|
+
gem 'byebug'
|
9
7
|
end
|
10
8
|
|
11
9
|
gemspec
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
[![
|
2
|
-
[![Coverage Status](https://coveralls.io/repos/github/sul-dlss/druid-tools/badge.svg?branch=master)](https://coveralls.io/github/sul-dlss/druid-tools?branch=master)
|
3
|
-
[![Dependency Status](https://gemnasium.com/badges/github.com/sul-dlss/druid-tools.svg)](https://gemnasium.com/github.com/sul-dlss/druid-tools)
|
1
|
+
[![CircleCI](https://circleci.com/gh/sul-dlss/druid-tools/tree/main.svg?style=svg)](https://circleci.com/gh/sul-dlss/druid-tools/tree/main)
|
4
2
|
[![Gem Version](https://badge.fury.io/rb/druid-tools.svg)](https://badge.fury.io/rb/druid-tools)
|
3
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/a21a8f4d0abae265638e/test_coverage)](https://codeclimate.com/github/sul-dlss/druid-tools/test_coverage)
|
4
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/a21a8f4d0abae265638e/maintainability)](https://codeclimate.com/github/sul-dlss/druid-tools/maintainability)
|
5
5
|
|
6
6
|
# Druid::Tools
|
7
7
|
|
@@ -11,7 +11,7 @@ Note that druid syntax is defined in consul (and druids are issued by the SURI s
|
|
11
11
|
|
12
12
|
Druid format:
|
13
13
|
|
14
|
-
bbdddbbdddd (two letters
|
14
|
+
bbdddbbdddd (two letters three digits two letters 4 digits)
|
15
15
|
|
16
16
|
Letters must be lowercase, and must not include A, E, I, O, U or L. (capitals for easier distinction here)
|
17
17
|
We often use vowels in our test data, and this code base has allowed vowels historically (though not
|
data/Rakefile
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
|
-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/gem_tasks'
|
3
5
|
|
4
6
|
require 'rspec/core/rake_task'
|
5
7
|
RSpec::Core::RakeTask.new(:spec)
|
@@ -7,4 +9,4 @@ RSpec::Core::RakeTask.new(:spec)
|
|
7
9
|
require 'rubocop/rake_task'
|
8
10
|
RuboCop::RakeTask.new
|
9
11
|
|
10
|
-
task :
|
12
|
+
task default: %i[spec rubocop]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.2.0
|