defmastership 1.3.4 → 1.3.5
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 +12 -2
- data/Gemfile +9 -9
- data/config/rubocop.yml +3 -0
- data/defmastership.gemspec +1 -1
- data/features/changeref.feature +11 -11
- data/lib/defmastership/modifier/change_ref.rb +1 -5
- data/lib/defmastership/version.rb +1 -1
- data/spec/unit/defmastership/modifier/change_ref_spec.rb +24 -28
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a331a25b15fb26d3d242bc037b8c084de0edacd13fac0a6bacb9b9a7e078dd1b
|
|
4
|
+
data.tar.gz: f166d30d3272ec3709c754978e1078bd4f67492dd697eb188e35c92317893578
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: beab382363108e87a92a566f8b84bc291053cd58161debbe35606abdf98eae2e3c1d1ab5e979d7f646f841219f6ea3ff8c3c7a4a288c02aea62641d7d439aaff
|
|
7
|
+
data.tar.gz: 5cad56201f0bc16c7b51d70466ae519090dad20d79401cb67ff017f6c0cb8e8d4bdb6000fcfcb21b2036e8877b7de77afbc785fcf684575b9b3e09a63cb27b89
|
data/.gitlab-ci.yml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
default:
|
|
2
|
-
image: ruby:
|
|
2
|
+
image: ruby:4.0
|
|
3
3
|
before_script:
|
|
4
4
|
- gem install bundler --no-document
|
|
5
5
|
- bundle install --jobs $(nproc) "${FLAGS[@]}"
|
|
@@ -42,13 +42,23 @@ bdd ruby3.3:
|
|
|
42
42
|
script:
|
|
43
43
|
- bundle exec rake test:features
|
|
44
44
|
|
|
45
|
+
bdd ruby3.4:
|
|
46
|
+
image: ruby:3.4
|
|
47
|
+
script:
|
|
48
|
+
- bundle exec rake test:features
|
|
49
|
+
|
|
45
50
|
unit tests ruby3.2:
|
|
46
51
|
image: ruby:3.2
|
|
47
52
|
script:
|
|
48
53
|
- bundle exec rake test:spec
|
|
49
54
|
|
|
50
55
|
unit tests ruby3.3:
|
|
51
|
-
image: ruby:3.
|
|
56
|
+
image: ruby:3.3
|
|
57
|
+
script:
|
|
58
|
+
- bundle exec rake test:spec
|
|
59
|
+
|
|
60
|
+
unit tests ruby3.4:
|
|
61
|
+
image: ruby:3.4
|
|
52
62
|
script:
|
|
53
63
|
- bundle exec rake test:spec
|
|
54
64
|
|
data/Gemfile
CHANGED
|
@@ -11,11 +11,11 @@ group :development do
|
|
|
11
11
|
# cucumber steps for command line tests
|
|
12
12
|
gem 'aruba', '~> 2.3'
|
|
13
13
|
# bdd
|
|
14
|
-
gem 'cucumber', '
|
|
14
|
+
gem 'cucumber', '10.1'
|
|
15
15
|
# code duplication
|
|
16
16
|
gem 'flay', '~> 2.14'
|
|
17
17
|
# automatic test run
|
|
18
|
-
gem 'guard', '~> 2.
|
|
18
|
+
gem 'guard', '~> 2.20'
|
|
19
19
|
# automatic update invocation
|
|
20
20
|
# gem 'guard-bundler', '~> 3.0'
|
|
21
21
|
# automatic style check
|
|
@@ -25,27 +25,27 @@ group :development do
|
|
|
25
25
|
# automatic style check
|
|
26
26
|
gem 'guard-rubocop', '~> 1.5'
|
|
27
27
|
# mutation testing
|
|
28
|
-
gem 'mutant-rspec', '~> 0.
|
|
28
|
+
gem 'mutant-rspec', '~> 0.14'
|
|
29
29
|
# to parse and execute Rakefile
|
|
30
30
|
gem 'rake', '~> 13.3'
|
|
31
31
|
# detect selling code
|
|
32
32
|
gem 'reek', '~> 6.5'
|
|
33
33
|
# needed by yard to render documentation
|
|
34
|
-
gem 'rdoc', '~> 7.
|
|
34
|
+
gem 'rdoc', '~> 7.1'
|
|
35
35
|
# tdd
|
|
36
36
|
gem 'rspec', '~> 3.13'
|
|
37
37
|
# code needs to be clean
|
|
38
|
-
gem 'rubocop', '~> 1.
|
|
38
|
+
gem 'rubocop', '~> 1.84'
|
|
39
39
|
# code needs to be clean
|
|
40
40
|
gem 'rubocop-performance', '~> 1.26'
|
|
41
41
|
# test code needs to be clean
|
|
42
|
-
gem 'rubocop-rspec', '~> 3.
|
|
42
|
+
gem 'rubocop-rspec', '~> 3.9'
|
|
43
43
|
# Rakefiles need to be clean
|
|
44
44
|
gem 'rubocop-rake', '~> 0.7'
|
|
45
45
|
# Doc need to be clean
|
|
46
|
-
gem 'rubocop-yard', '~> 1.
|
|
46
|
+
gem 'rubocop-yard', '~> 1.1'
|
|
47
47
|
# my code needs to be critiqued
|
|
48
|
-
gem 'rubycritic', '~>
|
|
48
|
+
gem 'rubycritic', '~> 5.0'
|
|
49
49
|
# What is tdd without code coverage ?
|
|
50
50
|
gem 'simplecov', '~> 0.22'
|
|
51
51
|
# to document code
|
|
@@ -54,5 +54,5 @@ end
|
|
|
54
54
|
|
|
55
55
|
group :debugging do
|
|
56
56
|
# Sometimes, we need to debug
|
|
57
|
-
gem 'pry', '~> 0.
|
|
57
|
+
gem 'pry', '~> 0.16'
|
|
58
58
|
end
|
data/config/rubocop.yml
CHANGED
data/defmastership.gemspec
CHANGED
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
|
25
25
|
spec.add_dependency('csv', '~> 3.3')
|
|
26
26
|
spec.add_dependency('defmastership-core', '~> 1.5.5')
|
|
27
27
|
spec.add_dependency('facets', '~> 3.1')
|
|
28
|
-
spec.add_dependency('git', '~> 4.
|
|
28
|
+
spec.add_dependency('git', '~> 4.3')
|
|
29
29
|
spec.add_dependency('gli', '~> 2.22')
|
|
30
30
|
spec.add_dependency('memoist', '~> 0.16')
|
|
31
31
|
spec.add_dependency('ostruct', '~> 0.6')
|
data/features/changeref.feature
CHANGED
|
@@ -308,7 +308,7 @@ Feature: The changeref command
|
|
|
308
308
|
| lines=1..7;9, tag=TOTO-TEMP-XXX1 | lines=1..7;9, tag=TOTO-0123 |
|
|
309
309
|
| tag=!TOTO-TEMP-XXX2;TOTO-TEMP-XXX1 | tag=!TOTO-TEMP-XXX2;TOTO-0123 |
|
|
310
310
|
|
|
311
|
-
Scenario Outline: Change definitions, modify
|
|
311
|
+
Scenario Outline: Change definitions, modify refs in included files
|
|
312
312
|
Given a file named "modifications.yml" with:
|
|
313
313
|
"""
|
|
314
314
|
---
|
|
@@ -338,17 +338,17 @@ Feature: The changeref command
|
|
|
338
338
|
"""
|
|
339
339
|
|
|
340
340
|
Examples:
|
|
341
|
-
| initial target comment
|
|
342
|
-
|
|
|
343
|
-
|
|
|
344
|
-
|
|
|
345
|
-
|
|
|
346
|
-
|
|
|
347
|
-
|
|
|
348
|
-
|
|
|
349
|
-
|
|
|
341
|
+
| initial target comment | modified target comment |
|
|
342
|
+
| TOTO-TEMP-XXX1 | TOTO-0123 |
|
|
343
|
+
| TOTO-TEMP-XXX1[] | TOTO-0123[] |
|
|
344
|
+
| TOTOTO-TEMP-XXX1 | TOTOTO-TEMP-XXX1 |
|
|
345
|
+
| TOTOTO-TEMP-XXX1[] | TOTOTO-TEMP-XXX1[] |
|
|
346
|
+
| TOTO-TEMP-XXX123 | TOTO-TEMP-XXX123 |
|
|
347
|
+
| TOTO-TEMP-XXX123[] | TOTO-TEMP-XXX123[] |
|
|
348
|
+
| TOTO-TEMP-XXX1ABC | TOTO-TEMP-XXX1ABC |
|
|
349
|
+
| TOTO-TEMP-XXX1ABC[] | TOTO-TEMP-XXX1ABC[] |
|
|
350
350
|
|
|
351
|
-
Scenario: Change definitions in subfolders, modify
|
|
351
|
+
Scenario: Change definitions in subfolders, modify refs in included files
|
|
352
352
|
Given a file named "modifications.yml" with:
|
|
353
353
|
"""
|
|
354
354
|
---
|
|
@@ -172,11 +172,7 @@ module Defmastership
|
|
|
172
172
|
# @return [String] the modified line with all changes
|
|
173
173
|
def self.apply_changes_in_included_file_line(line, changes)
|
|
174
174
|
changes.reduce(line) do |res_line, (from, to)|
|
|
175
|
-
|
|
176
|
-
res_line.sub(from, to)
|
|
177
|
-
else
|
|
178
|
-
res_line
|
|
179
|
-
end
|
|
175
|
+
res_line.gsub(/\b#{from}\b/, to)
|
|
180
176
|
end
|
|
181
177
|
end
|
|
182
178
|
|
|
@@ -217,35 +217,31 @@ RSpec.describe(Defmastership::Modifier::ChangeRef) do
|
|
|
217
217
|
end
|
|
218
218
|
|
|
219
219
|
let(:original_included_file) do
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
; end:TOTO-TEMP123[]
|
|
232
|
-
OIF
|
|
220
|
+
<<~OIF
|
|
221
|
+
TOTO-TEMP123
|
|
222
|
+
TOTO-TEMP123
|
|
223
|
+
TOTO-TEMP123 TOTO-TEMP123
|
|
224
|
+
TOTO-TEMP123[]
|
|
225
|
+
TOTOTO-TEMP123
|
|
226
|
+
TOTOTO-TEMP123[]
|
|
227
|
+
TOTO-TEMP12323
|
|
228
|
+
TOTO-TEMP12323[]
|
|
229
|
+
TOTO-TEMP123ABC
|
|
230
|
+
OIF
|
|
233
231
|
end
|
|
234
232
|
|
|
235
233
|
let(:mofified_included_file) do
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
; end:TOTO-TEMP123[]
|
|
248
|
-
MIF
|
|
234
|
+
<<~MIF
|
|
235
|
+
TOTO-0132
|
|
236
|
+
TOTO-0132
|
|
237
|
+
TOTO-0132 TOTO-0132
|
|
238
|
+
TOTO-0132[]
|
|
239
|
+
TOTOTO-TEMP123
|
|
240
|
+
TOTOTO-TEMP123[]
|
|
241
|
+
TOTO-TEMP12323
|
|
242
|
+
TOTO-TEMP12323[]
|
|
243
|
+
TOTO-TEMP123ABC
|
|
244
|
+
MIF
|
|
249
245
|
end
|
|
250
246
|
|
|
251
247
|
before do
|
|
@@ -253,7 +249,7 @@ MIF
|
|
|
253
249
|
refchanger.replace_refdef('', '[define, whatever, TITI-TEMP421]')
|
|
254
250
|
|
|
255
251
|
allow(File).to(receive(:readlines)).with('sub/target').and_return(['whatever'])
|
|
256
|
-
allow(File).to(receive(:readlines)).with('sub/path/target').and_return(original_included_file.
|
|
252
|
+
allow(File).to(receive(:readlines)).with('sub/path/target').and_return(original_included_file.lines(chomp: true))
|
|
257
253
|
allow(File).to(receive(:readlines)).with('./path/target').and_return(['whatever'])
|
|
258
254
|
allow(File).to(receive(:readlines)).with('./target').and_return(['whatever'])
|
|
259
255
|
|
|
@@ -266,7 +262,7 @@ MIF
|
|
|
266
262
|
it { expect(File).to(have_received(:readlines).with('sub/path/target')) }
|
|
267
263
|
|
|
268
264
|
it do
|
|
269
|
-
expect(File).to(have_received(:writelines).with('sub/path/target', mofified_included_file.
|
|
265
|
+
expect(File).to(have_received(:writelines).with('sub/path/target', mofified_included_file.lines(chomp: true)))
|
|
270
266
|
end
|
|
271
267
|
|
|
272
268
|
it { expect(File).not_to(have_received(:readlines).with('otherpath/othertarget')) }
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: defmastership
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jérôme Arbez-Gindre
|
|
@@ -85,14 +85,14 @@ dependencies:
|
|
|
85
85
|
requirements:
|
|
86
86
|
- - "~>"
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '4.
|
|
88
|
+
version: '4.3'
|
|
89
89
|
type: :runtime
|
|
90
90
|
prerelease: false
|
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
|
93
93
|
- - "~>"
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '4.
|
|
95
|
+
version: '4.3'
|
|
96
96
|
- !ruby/object:Gem::Dependency
|
|
97
97
|
name: gli
|
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
272
272
|
- !ruby/object:Gem::Version
|
|
273
273
|
version: '0'
|
|
274
274
|
requirements: []
|
|
275
|
-
rubygems_version: 4.0.
|
|
275
|
+
rubygems_version: 4.0.5
|
|
276
276
|
specification_version: 4
|
|
277
277
|
summary: Handling of references and definitions with asciidoctor
|
|
278
278
|
test_files: []
|