defmastership-core 1.4.1 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +0 -11
- data/Gemfile +20 -52
- data/config/mutant.yml +2 -1
- data/config/rubocop.yml +1 -1
- data/defmastership-core.gemspec +1 -1
- data/lib/defmastership/core/constants.rb +14 -14
- data/lib/defmastership/core/version.rb +1 -1
- data/spec/unit/defmastership/core/dm_regexp_spec.rb +7 -4
- metadata +4 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e305c214cf30723ae670f46f1bf3ffbe4d00b1867581e1db5be79f2ab8155a35
|
4
|
+
data.tar.gz: b00c8a4e447f269176696da0b743d184e594ffd5a8fb0a0b83787343917a4846
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 847be19dfe955889f38c8e07c23c5fe297d84aec7d0cd3b81a2a6d2188ab3f8cfc5c6d4330a17969b14068baa73524b85a37fe469136b720c6d2f7bd71e99be0
|
7
|
+
data.tar.gz: 4645b59b7d0ed3b7497b5e38dc9a29c7fcb32c54a622bdc7cba22dede1be05719b818c991727aae4ff229ec2e46ab58834c74b5b449eea4ed4f30bf48cdab957
|
data/.gitlab-ci.yml
CHANGED
@@ -28,17 +28,6 @@ yard documentation:
|
|
28
28
|
paths:
|
29
29
|
- doc
|
30
30
|
|
31
|
-
unit tests ruby2.7:
|
32
|
-
image: ruby:2.7
|
33
|
-
before_script:
|
34
|
-
- apt-get update
|
35
|
-
- ruby -v
|
36
|
-
- which ruby
|
37
|
-
- gem install bundler -v 2.4.22 --no-document
|
38
|
-
- bundle install --jobs $(nproc) "${FLAGS[@]}"
|
39
|
-
script:
|
40
|
-
- bundle exec rake test:spec
|
41
|
-
|
42
31
|
unit tests ruby3.0:
|
43
32
|
image: ruby:3.0
|
44
33
|
script:
|
data/Gemfile
CHANGED
@@ -7,80 +7,48 @@ gemspec
|
|
7
7
|
|
8
8
|
ruby RUBY_VERSION
|
9
9
|
|
10
|
-
# rubocop:disable Metrics/BlockLength
|
11
10
|
group :development do
|
12
11
|
# needed by yard to render documentation
|
13
12
|
gem 'asciidoctor', '~> 2.0'
|
14
|
-
# cucumber steps for command line tests
|
15
|
-
gem 'aruba', '~> 2.2'
|
16
|
-
# bdd
|
17
|
-
gem 'cucumber', '~> 9.2'
|
18
|
-
|
19
13
|
# code duplication
|
20
14
|
gem 'flay', '~> 2.13'
|
21
|
-
|
22
15
|
# automatic test run
|
23
16
|
gem 'guard', '~> 2.19'
|
24
17
|
# automatic update invocation
|
25
18
|
gem 'guard-bundler', '~> 3.0'
|
26
|
-
|
27
|
-
|
28
|
-
gem 'guard-reek', '~> 1.2'
|
29
|
-
end
|
19
|
+
# automatic style check
|
20
|
+
gem 'guard-reek', '~> 1.2'
|
30
21
|
# automatic tdd
|
31
22
|
gem 'guard-rspec', '~> 4.7'
|
32
23
|
# automatic style check
|
33
24
|
gem 'guard-rubocop', '~> 1.5'
|
34
|
-
|
35
|
-
|
36
|
-
# # mutation testing
|
37
|
-
# plan = 'oss'
|
38
|
-
# key = '7oac4dMz95cTUuFPtGDfTDSQep6ZhdGW'
|
39
|
-
# source "https://#{plan}:#{key}@gem.mutant.dev" do
|
40
|
-
# # license needed
|
41
|
-
# gem 'mutant-license', '~> 0'
|
42
|
-
# end
|
43
|
-
# # mutation testing
|
44
|
-
# gem 'mutant-rspec', '~> 0'
|
45
|
-
# end
|
25
|
+
# mutation testing
|
26
|
+
gem 'mutant-rspec', '~> 0.13'
|
46
27
|
# to parse and execute Rakefile
|
47
|
-
gem 'rake',
|
48
|
-
|
49
|
-
|
50
|
-
# needed by yard to render documentation
|
51
|
-
gem 'rdoc', '~> 6.1O'
|
52
|
-
end
|
28
|
+
gem 'rake', '~> 13.3'
|
29
|
+
# needed by yard to render documentation
|
30
|
+
gem 'rdoc', '~> 6.14'
|
53
31
|
# tdd
|
54
32
|
gem 'rspec', '~> 3.13'
|
55
|
-
# # to test performances
|
56
|
-
# gem 'rspec-benchmark', '~> 0'
|
57
33
|
# code needs to be clean
|
58
|
-
gem 'rubocop', '1.
|
34
|
+
gem 'rubocop', '1.80'
|
59
35
|
# code needs to be clean
|
60
|
-
gem 'rubocop-performance', '~> 1.
|
36
|
+
gem 'rubocop-performance', '~> 1.25'
|
61
37
|
# test code needs to be clean
|
62
|
-
gem 'rubocop-rspec', '~> 3.
|
38
|
+
gem 'rubocop-rspec', '~> 3.6'
|
63
39
|
# Rakefiles need to be clean
|
64
|
-
gem 'rubocop-rake', '~> 0.
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
# Doc need to be clean
|
72
|
-
gem 'rubocop-yard', '~> 0.10'
|
73
|
-
end
|
74
|
-
|
40
|
+
gem 'rubocop-rake', '~> 0.7'
|
41
|
+
# detect smelling code
|
42
|
+
gem 'reek', '~> 6.5'
|
43
|
+
# my code needs to be critiqued
|
44
|
+
gem 'rubycritic', '~> 4.10'
|
45
|
+
# Doc need to be clean
|
46
|
+
gem 'rubocop-yard', '~> 1.0'
|
75
47
|
# What is tdd without code coverage ?
|
76
|
-
gem 'simplecov',
|
77
|
-
|
78
|
-
|
79
|
-
# to document code
|
80
|
-
gem 'yard', '~> 0.9'
|
81
|
-
end
|
48
|
+
gem 'simplecov', '~> 0.22'
|
49
|
+
# to document code
|
50
|
+
gem 'yard', '~> 0.9'
|
82
51
|
end
|
83
|
-
# rubocop:enable Metrics/BlockLength
|
84
52
|
|
85
53
|
group :debugging do
|
86
54
|
# Sometimes, we need to debug
|
data/config/mutant.yml
CHANGED
data/config/rubocop.yml
CHANGED
data/defmastership-core.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.metadata = {
|
20
20
|
'rubygems_mfa_required' => 'true'
|
21
21
|
}
|
22
|
-
spec.required_ruby_version = '>=
|
22
|
+
spec.required_ruby_version = '>= 3.0'
|
23
23
|
spec.name = 'defmastership-core'
|
24
24
|
spec.version = Defmastership::Core::VERSION
|
25
25
|
spec.author = 'Jérôme Arbez-Gindre'
|
@@ -15,7 +15,7 @@ module Defmastership
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# [Regexp] to match a single line comment
|
18
|
-
SINGLE_LINE_COMMENT = %r{^//[^/]}
|
18
|
+
SINGLE_LINE_COMMENT = %r{^//[^/]}
|
19
19
|
public_constant :SINGLE_LINE_COMMENT
|
20
20
|
|
21
21
|
# [Regexp] match the definition keyword
|
@@ -23,11 +23,11 @@ module Defmastership
|
|
23
23
|
public_constant :DEF_KEYWORD
|
24
24
|
|
25
25
|
# [Regexp] match a definition type
|
26
|
-
DEF_TYPE = ",\\s*#{an_id('type')}\\s*"
|
26
|
+
DEF_TYPE = ",\\s*#{an_id('type')}\\s*".freeze
|
27
27
|
public_constant :DEF_TYPE
|
28
28
|
|
29
29
|
# [Regexp] match all text before the definition's reference
|
30
|
-
DEF_BEFORE_REF = <<~"BEF"
|
30
|
+
DEF_BEFORE_REF = <<~"BEF".freeze
|
31
31
|
^
|
32
32
|
\\s*
|
33
33
|
\\[
|
@@ -52,7 +52,7 @@ module Defmastership
|
|
52
52
|
DEF_SUMMARY = <<~'SUM'
|
53
53
|
\s*
|
54
54
|
(,\s*
|
55
|
-
((
|
55
|
+
(("\s*(?<summary>[^""]*?)\s*")|(?<summary>[^\s,\[\]][^,\[\]]*?))
|
56
56
|
\s*)?
|
57
57
|
SUM
|
58
58
|
public_constant :DEF_SUMMARY
|
@@ -62,7 +62,7 @@ module Defmastership
|
|
62
62
|
public_constant :DEF_LABELS
|
63
63
|
|
64
64
|
# [Regexp] match all text after the definition's reference
|
65
|
-
DEF_AFTER_REF = <<~"AFT"
|
65
|
+
DEF_AFTER_REF = <<~"AFT".freeze
|
66
66
|
\\s*
|
67
67
|
#{DEF_SUMMARY}
|
68
68
|
#{DEF_LABELS}
|
@@ -94,26 +94,26 @@ module Defmastership
|
|
94
94
|
|
95
95
|
# [Regexp] match a asciidcotor attribute definition
|
96
96
|
VARIABLE_DEF = /^\s*:#{an_id('varname')}:\s+
|
97
|
-
(?<value>\S.*\S)\s*$/x
|
97
|
+
(?<value>\S.*\S)\s*$/x
|
98
98
|
public_constant :VARIABLE_DEF
|
99
99
|
|
100
100
|
# [Regexp] match a asciidcotor attribute use
|
101
|
-
VARIABLE_USE = /{#{an_id('varname')}}/x
|
101
|
+
VARIABLE_USE = /{#{an_id('varname')}}/x
|
102
102
|
public_constant :VARIABLE_USE
|
103
103
|
|
104
104
|
# [Regexp] match an external cross reference type configuration
|
105
105
|
EREF_CONFIG = /^\s*:eref-#{an_id('reference')}-(?<symb>prefix|url):\s*
|
106
|
-
\s*(?<value>\S.*\S)\s*/x
|
106
|
+
\s*(?<value>\S.*\S)\s*/x
|
107
107
|
public_constant :EREF_CONFIG
|
108
108
|
# [Regexp] match an external cross reference use
|
109
109
|
EREF_DEF = /^\s*
|
110
110
|
defs:eref\[
|
111
111
|
\s*#{an_id('reference')}\s*,
|
112
|
-
\s*\[\s*(?<extrefs>[^\]]+?)\s*\]\s*\]/x
|
112
|
+
\s*\[\s*(?<extrefs>[^\]]+?)\s*\]\s*\]/x
|
113
113
|
public_constant :EREF_DEF
|
114
114
|
|
115
115
|
# [Regexp] match an asciidoc block delimiter
|
116
|
-
BLOCK = /^--\s
|
116
|
+
BLOCK = /^--\s*$/
|
117
117
|
public_constant :BLOCK
|
118
118
|
|
119
119
|
# [Regexp] match the begining of an internal cross reference
|
@@ -131,21 +131,21 @@ module Defmastership
|
|
131
131
|
|
132
132
|
# [Regexp] match an attribute configuration
|
133
133
|
ATTR_CONFIG = /\s*:attr-#{an_id('attr')}-prefix:
|
134
|
-
\s+(?<prefix>.+?)\s*$/x
|
134
|
+
\s+(?<prefix>.+?)\s*$/x
|
135
135
|
public_constant :ATTR_CONFIG
|
136
136
|
# [Regexp] match an attribute use
|
137
137
|
ATTR_SET = /\s*
|
138
138
|
defs:attribute\[
|
139
139
|
\s*#{an_id('attr')}\s*,
|
140
|
-
\s*(?<value>.+?)\s*\]/x
|
140
|
+
\s*(?<value>.+?)\s*\]/x
|
141
141
|
public_constant :ATTR_SET
|
142
142
|
|
143
143
|
# [Regexp] match an empty line
|
144
|
-
EMPTY_LINE = /^\s
|
144
|
+
EMPTY_LINE = /^\s*$/
|
145
145
|
public_constant :EMPTY_LINE
|
146
146
|
|
147
147
|
# [Regexp] match everything
|
148
|
-
WHATEVER =
|
148
|
+
WHATEVER = //
|
149
149
|
public_constant :WHATEVER
|
150
150
|
|
151
151
|
# [Regexp] match asciidoc include statement keyword
|
@@ -132,7 +132,8 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
|
|
132
132
|
',[label1]]',
|
133
133
|
', a nice summary,[label1]]',
|
134
134
|
', a nice summary]',
|
135
|
-
', "a nice summary, with comma"]'
|
135
|
+
', "a nice summary, with comma"]',
|
136
|
+
', "a nice summary with quotation mark"]'
|
136
137
|
].each do |def_end|
|
137
138
|
it { is_expected.to(match(def_end)) }
|
138
139
|
end
|
@@ -142,6 +143,7 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
|
|
142
143
|
it { expect(regexp.match(', a summary ]')[:summary]).to(eq('a summary')) }
|
143
144
|
it { expect(regexp.match(', a summary ]')[:labels]).to(be_nil) }
|
144
145
|
it { expect(regexp.match(', " a, comma " ]')[:summary]).to(eq('a, comma')) }
|
146
|
+
it { expect(regexp.match(', " no comma " ]')[:summary]).to(eq('no comma')) }
|
145
147
|
end
|
146
148
|
|
147
149
|
context 'when invalid definitions end' do
|
@@ -418,7 +420,7 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
|
|
418
420
|
describe 'EREF_DEF' do
|
419
421
|
subject(:regexp) { described_class::EREF_DEF }
|
420
422
|
|
421
|
-
let(:one_match) { regexp.match('defs:eref[abcdef, [ABC, EDF]]') }
|
423
|
+
let(:one_match) { regexp.match('defs:eref[abcdef, [ABC, EDF(a~1234abcd)]]') }
|
422
424
|
|
423
425
|
context 'with valid external ref' do
|
424
426
|
[
|
@@ -428,13 +430,14 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
|
|
428
430
|
'defs:eref[abcdef,[ABC,EDF]]',
|
429
431
|
'defs:eref[abcdef, [ABC, EDF] ]',
|
430
432
|
'defs:eref[abcdef, [ABC, EDF ]]',
|
431
|
-
'defs:eref[abcdef, [ABC]]'
|
433
|
+
'defs:eref[abcdef, [ABC]]',
|
434
|
+
'defs:eref[abcdef, [ABC(a~1234abcd)]]'
|
432
435
|
].each do |line|
|
433
436
|
it { is_expected.to(match(line)) }
|
434
437
|
end
|
435
438
|
|
436
439
|
it { expect(one_match[:reference]).to(eq('abcdef')) }
|
437
|
-
it { expect(one_match[:extrefs]).to(eq('ABC, EDF')) }
|
440
|
+
it { expect(one_match[:extrefs]).to(eq('ABC, EDF(a~1234abcd)')) }
|
438
441
|
end
|
439
442
|
|
440
443
|
context 'with invalid external ref' do
|
metadata
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: defmastership-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jérôme Arbez-Gindre
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
|
-
description:
|
14
12
|
email: jeromearbezgindre@gmail.com
|
15
13
|
executables: []
|
16
14
|
extensions: []
|
@@ -45,7 +43,6 @@ licenses:
|
|
45
43
|
- MIT
|
46
44
|
metadata:
|
47
45
|
rubygems_mfa_required: 'true'
|
48
|
-
post_install_message:
|
49
46
|
rdoc_options: []
|
50
47
|
require_paths:
|
51
48
|
- lib
|
@@ -54,15 +51,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
54
51
|
requirements:
|
55
52
|
- - ">="
|
56
53
|
- !ruby/object:Gem::Version
|
57
|
-
version: '
|
54
|
+
version: '3.0'
|
58
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
56
|
requirements:
|
60
57
|
- - ">="
|
61
58
|
- !ruby/object:Gem::Version
|
62
59
|
version: '0'
|
63
60
|
requirements: []
|
64
|
-
rubygems_version: 3.
|
65
|
-
signing_key:
|
61
|
+
rubygems_version: 3.7.1
|
66
62
|
specification_version: 4
|
67
63
|
summary: Handling of references and definitions with asciidoctor - common code
|
68
64
|
test_files: []
|