defmastership-core 1.3.0 → 1.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '034357962fd2a1625b213b5ed29b83bd7cc9a659c24b1b0a8f5b202dea47113a'
4
- data.tar.gz: d32796f5f8cb5eef96568e35011a09033badccb5d7708c3077ccd9519df71228
3
+ metadata.gz: 07bc53590b73e2833caaecb1bae8cfecd87a1ecef94fbe7ecb9b5eb6ea89d828
4
+ data.tar.gz: adf941d0a7655906428a6b0841780bae626e222284a192cae4e2c7af6dd25dec
5
5
  SHA512:
6
- metadata.gz: 04b9343450b59869b5100144cbf1ec8388ff72cfba713be83be2292b81a6f55e20e087fec8b91f3b49a63df88a2312cc9bdffca4f415c401581167021b60738a
7
- data.tar.gz: 979b8eed01f02b85ff4d2b314779c4210cd8372e6f901335662163d72c2135d480e3af501702de4a5ed88ab29410e3aa7cc58598133cdd2204e61ad83fc41c71
6
+ metadata.gz: 21867b6159f14e934248174adff6d253b36f55d19f50528e3ccd0fda55afa2bb391a27a339d0b3b9d9e92b0c4fe427e512a0cc666e895e1089e289678f8b52cb
7
+ data.tar.gz: a5efb633dd49c4cc0593cb9a1e8e1d2177b45680e78c89f457f55efd62b0156de913db8ff7bd07e710a35dc41226ac9604584008f113224cc68d0051285dee35
data/.gitlab-ci.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  default:
2
- image: ruby:3.3
2
+ image: ruby:3.4
3
3
  before_script:
4
4
  - apt-get update
5
5
  - ruby -v
@@ -54,6 +54,11 @@ unit tests ruby3.2:
54
54
  script:
55
55
  - bundle exec rake test:spec
56
56
 
57
+ unit tests ruby3.3:
58
+ image: ruby:3.3
59
+ script:
60
+ - bundle exec rake test:spec
61
+
57
62
  pages:
58
63
  stage: deploy
59
64
  script:
data/Gemfile CHANGED
@@ -10,27 +10,27 @@ ruby RUBY_VERSION
10
10
  # rubocop:disable Metrics/BlockLength
11
11
  group :development do
12
12
  # needed by yard to render documentation
13
- gem 'asciidoctor', '~> 2'
13
+ gem 'asciidoctor', '~> 2.0'
14
14
  # cucumber steps for command line tests
15
- gem 'aruba', '~> 2'
15
+ gem 'aruba', '~> 2.2'
16
16
  # bdd
17
- gem 'cucumber', '~> 9'
17
+ gem 'cucumber', '~> 9.2'
18
18
 
19
19
  # code duplication
20
- gem 'flay', '~> 2'
20
+ gem 'flay', '~> 2.13'
21
21
 
22
22
  # automatic test run
23
- gem 'guard', '~> 2'
23
+ gem 'guard', '~> 2.19'
24
24
  # automatic update invocation
25
- gem 'guard-bundler', '~> 3'
25
+ gem 'guard-bundler', '~> 3.0'
26
26
  if RUBY_VERSION >= '3.0'
27
27
  # automatic style check
28
28
  gem 'guard-reek', '~> 1.2'
29
29
  end
30
30
  # automatic tdd
31
- gem 'guard-rspec', '~> 4'
31
+ gem 'guard-rspec', '~> 4.7'
32
32
  # automatic style check
33
- gem 'guard-rubocop', '~> 1'
33
+ gem 'guard-rubocop', '~> 1.5'
34
34
 
35
35
  # if RUBY_VERSION >= '3.0'
36
36
  # # mutation testing
@@ -44,45 +44,45 @@ group :development do
44
44
  # gem 'mutant-rspec', '~> 0'
45
45
  # end
46
46
  # to parse and execute Rakefile
47
- gem 'rake', '~> 13'
47
+ gem 'rake', '~> 13.2'
48
48
 
49
49
  if RUBY_VERSION >= '3.0'
50
50
  # needed by yard to render documentation
51
- gem 'rdoc', '~> 6'
51
+ gem 'rdoc', '~> 6.1O'
52
52
  end
53
53
  # tdd
54
- gem 'rspec', '~> 3'
54
+ gem 'rspec', '~> 3.13'
55
55
  # # to test performances
56
56
  # gem 'rspec-benchmark', '~> 0'
57
57
  # code needs to be clean
58
- gem 'rubocop', '1.68'
58
+ gem 'rubocop', '1.69'
59
59
  # code needs to be clean
60
- gem 'rubocop-performance', '~> 1'
60
+ gem 'rubocop-performance', '~> 1.23'
61
61
  # test code needs to be clean
62
- gem 'rubocop-rspec', '~> 3'
62
+ gem 'rubocop-rspec', '~> 3.3'
63
63
  # Rakefiles need to be clean
64
- gem 'rubocop-rake', '~> 0'
64
+ gem 'rubocop-rake', '~> 0.6'
65
65
 
66
66
  if RUBY_VERSION >= '3.0'
67
67
  # detect selling code
68
- gem 'reek', '~> 6'
68
+ gem 'reek', '~> 6.3'
69
69
  # my code needs to be critiqued
70
- gem 'rubycritic', '~> 4'
70
+ gem 'rubycritic', '~> 4.9'
71
71
  # Doc need to be clean
72
- gem 'rubocop-yard', '~> 0'
72
+ gem 'rubocop-yard', '~> 0.10'
73
73
  end
74
74
 
75
75
  # What is tdd without code coverage ?
76
- gem 'simplecov', '~> 0'
76
+ gem 'simplecov', '~> 0.22'
77
77
 
78
78
  if RUBY_VERSION >= '3.0'
79
79
  # to document code
80
- gem 'yard', '~> 0'
80
+ gem 'yard', '~> 0.9'
81
81
  end
82
82
  end
83
83
  # rubocop:enable Metrics/BlockLength
84
84
 
85
85
  group :debugging do
86
86
  # Sometimes, we need to debug
87
- gem 'pry', '~> 0'
87
+ gem 'pry', '~> 0.15'
88
88
  end
@@ -49,7 +49,12 @@ module Defmastership
49
49
  public_constant :REFERENCE
50
50
 
51
51
  # [Regexp] match defintion summary
52
- DEF_SUMMARY = '\s*(,\s*(?<summary>[^\s,\[\]][^,\[\]]*?)\s*)?'
52
+ DEF_SUMMARY = <<~'SUM'
53
+ \s*
54
+ (,\s*
55
+ ((?<summary>[^\s,\[\]][^,\[\]]*?)|("\s*(?<summary>[^""]*?)\s*"))
56
+ \s*)?
57
+ SUM
53
58
  public_constant :DEF_SUMMARY
54
59
 
55
60
  # [Regexp] match definition labels
@@ -83,6 +88,7 @@ module Defmastership
83
88
  \\s*
84
89
  \\]
85
90
  DEF
91
+ # [Regexp] match a definition line
86
92
  DEFINITION = Regexp.new(definition_re_string, Regexp::EXTENDED)
87
93
  public_constant :DEFINITION
88
94
 
@@ -5,7 +5,7 @@ module Defmastership
5
5
  # Common to defmastership and asciidoctor-defmastership
6
6
  module Core
7
7
  # [String] Gem version
8
- VERSION = '1.3.0'
8
+ VERSION = '1.4.1'
9
9
  public_constant :VERSION
10
10
  end
11
11
  end
@@ -131,7 +131,8 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
131
131
  ']',
132
132
  ',[label1]]',
133
133
  ', a nice summary,[label1]]',
134
- ', a nice summary]'
134
+ ', a nice summary]',
135
+ ', "a nice summary, with comma"]'
135
136
  ].each do |def_end|
136
137
  it { is_expected.to(match(def_end)) }
137
138
  end
@@ -140,6 +141,7 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
140
141
  it { expect(regexp.match(' ,[ label1 , label2 ] ]')[:summary]).to(be_nil) }
141
142
  it { expect(regexp.match(', a summary ]')[:summary]).to(eq('a summary')) }
142
143
  it { expect(regexp.match(', a summary ]')[:labels]).to(be_nil) }
144
+ it { expect(regexp.match(', " a, comma " ]')[:summary]).to(eq('a, comma')) }
143
145
  end
144
146
 
145
147
  context 'when invalid definitions end' do
@@ -221,19 +223,26 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
221
223
  '',
222
224
  ', bla bla bli',
223
225
  ', bla bla bli ',
224
- ' , bla bla bli '
226
+ ' , bla bla bli ',
227
+ ', bla: bla bli',
228
+ ', "bla bla, bli"',
229
+ ', " bla bla , bli "'
225
230
  ].each do |line|
226
231
  it { is_expected.to(match(line)) }
227
232
  end
228
233
 
229
234
  it { expect(regexp.match('')[:summary]).to(be_nil) }
230
- it { expect(regexp.match(', bla bla bli ')[:summary]).to(eq('bla bla bli')) }
235
+ it { expect(regexp.match(', bla: bla bli ')[:summary]).to(eq('bla: bla bli')) }
236
+ it { expect(regexp.match(', " bla bla , bli "')[:summary]).to(eq('bla bla , bli')) }
231
237
  end
232
238
 
233
239
  context 'with invalid definition summary' do
234
240
  it { is_expected.not_to(match('blabla without coma')) }
235
241
  it { is_expected.not_to(match(', [bla bla bli')) }
236
242
  it { is_expected.not_to(match(', bla bla bli]')) }
243
+ it { is_expected.not_to(match(', "bla bla bli]')) }
244
+ it { is_expected.not_to(match(', bla bla bli"]')) }
245
+ it { is_expected.not_to(match(', ""bla bla bli]')) }
237
246
  it { is_expected.not_to(match(',')) }
238
247
  it { is_expected.not_to(match(', ')) }
239
248
  it { is_expected.not_to(match(',,')) }
@@ -274,7 +283,8 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
274
283
  '[define , definition_type, REFERENCE-0001]',
275
284
  '[ define,def-type , 001-REFERENCE, [ label1, label2 ] ] ',
276
285
  '[ define, def-type , REFERENCE-001 , [ label1, label2 ] ]',
277
- '[ define, def-type , REFERENCE-001 , a summary, [ label1, label2 ] ]'
286
+ '[ define, def-type , REFERENCE-001 , a summary, [ label1, label2 ] ]',
287
+ '[ define, def-type , REFERENCE-001 , "a, summary, comma", [ label1, label2 ] ]'
278
288
  ].each do |line|
279
289
  it { is_expected.to(match(line)) }
280
290
  end
@@ -287,6 +297,8 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
287
297
  it { expect(one_match[:explicit_checksum]).to(eq('~1234')) }
288
298
  it { expect(one_match[:summary]).to(eq('a summary')) }
289
299
  it { expect(one_match[:labels]).to(eq('a,b')) }
300
+
301
+ it { expect(regexp.match('[define,t,R," a , comma "]')[:summary]).to(eq('a , comma')) }
290
302
  end
291
303
 
292
304
  context 'with invalid definition lines' do
@@ -342,7 +354,8 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
342
354
  [
343
355
  '{my_var}',
344
356
  ' {my_var} ',
345
- '{var-with_dash}'
357
+ '{var-with_dash}',
358
+ '[define, requirement, TOTO-0001, A nice {a_variable}]'
346
359
  ].each do |line|
347
360
  it { is_expected.to(match(line)) }
348
361
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: defmastership-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérôme Arbez-Gindre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-22 00:00:00.000000000 Z
11
+ date: 2025-01-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: jeromearbezgindre@gmail.com
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.5.23
64
+ rubygems_version: 3.5.22
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: Handling of references and definitions with asciidoctor - common code