asciidoctor-defmastership 1.0.0 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb46c0579286b760f1486d9458034fdabfef220e34cacae49c574f20c5e2c093
4
- data.tar.gz: 5f18f5ca0b93543c936fcbdd8269e53aa0bbebdc13c80cae8cb152f236c9f3f8
3
+ metadata.gz: 0425e34011a043292dc14256c4649ec16f0bdade8f2a746e586c3011dc4ad1fc
4
+ data.tar.gz: c30c83e7c430f0b20889011ef5fd8b8fa5ff21419cd48dfef7f8be0302ca7832
5
5
  SHA512:
6
- metadata.gz: 0d4a76c605cea45280dff495d465e6121bac39b24e26625f9476c0dcf3823e2fbe25fa2d287e2f8494ab9d6b708d109e7f1424211ed1f1c13c47d9f3419e1bc9
7
- data.tar.gz: 777021aef8fca7a5402ba60d012f10b8d395c85dafa4ef44897068f84da03808a594ff613b6e7ba854c2ee1e0d1c0b76ed80c5fa4036f59c7276485483137308
6
+ metadata.gz: 8084b8fbe8836c2bcd30b8b9afc754879f53341d7b117234183be59dcdab6c6d87e5fef7f534b673f9f13283f6e4f398decd341c4c6cc185b138ee35134f118c
7
+ data.tar.gz: '0869b435d1224cab6ffe0637b87bedf6f9080e991b9382331d72e2238270eaa7b286997a071fc161f54249794e0afd9d8eb91b94d1f288cc654501934db1c159'
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  /measurements
13
13
  *.csv
14
14
  *.gem
15
+ /Gemfile.lock
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,16 @@
1
+ default:
2
+ image: ruby:2.5
3
+ before_script:
4
+ - apt-get update
5
+ - ruby -v
6
+ - which ruby
7
+ - gem install bundler --no-document
8
+ - bundle install --jobs $(nproc) "${FLAGS[@]}"
9
+
10
+ rspec:
11
+ script:
12
+ - bundle exec rake spec
13
+
14
+ rubocop:
15
+ script:
16
+ - bundle exec rake rubocop
data/.rubocop.yml CHANGED
@@ -13,16 +13,17 @@ require:
13
13
  - rubocop-rspec
14
14
 
15
15
  AllCops:
16
- TargetRubyVersion: 2.3
16
+ TargetRubyVersion: 2.5
17
17
  EnabledByDefault: true
18
18
  DisplayCopNames: true
19
19
 
20
20
  Style/Copyright:
21
- Enabled: false
22
- AutocorrectNotice: 'Copyright 2020 by Jérôme Arbez-Gindre'
21
+ Enabled: true
22
+ Notice: 'Copyright (\(c\) )?2020 Jerome Arbez-Gindre'
23
+ AutocorrectNotice: '# Copyright (c) 2020 Jerome Arbez-Gindre'
23
24
 
24
- # Lint/ConstantResolution: # not available in rubocop 0.81
25
- # Enabled: false
25
+ Lint/ConstantResolution:
26
+ Enabled: false
26
27
 
27
28
  # Style/DocumentationMethod:
28
29
  # Enabled: false
@@ -42,9 +43,6 @@ Metrics/BlockLength :
42
43
  - 'spec/**/*'
43
44
  - '*.gemspec'
44
45
 
45
- Layout/LineLength:
46
- Max: 120 # default for rubocop later than 0.81
47
-
48
46
  # Security/Eval :
49
47
  # Exclude:
50
48
  # - 'Rakefile'
@@ -64,3 +62,10 @@ RSpec/FilePath :
64
62
 
65
63
  # RSpec/NestedGroups:
66
64
  # Max: 4
65
+
66
+ Layout/RedundantLineBreak:
67
+ Enabled: false
68
+
69
+ Style/DisableCopsWithinSourceCodeDirective:
70
+ Enabled: true
71
+ AllowedCops: ['Lint/InterpolationCheck']
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
+ # Copyright (c) 2020 Jerome Arbez-Gindre
1
2
  # frozen_string_literal: true
2
3
 
3
4
  source('https://rubygems.org')
data/LICENCE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Jérôme Arbez-Gindre, and the individual contributors
4
+ to asciidoctor-defmastership.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ # Copyright (c) 2020 Jerome Arbez-Gindre
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require('bundler/gem_tasks')
@@ -1,3 +1,4 @@
1
+ # Copyright (c) 2020 Jerome Arbez-Gindre
1
2
  # frozen_string_literal: true
2
3
 
3
4
  lib = File.expand_path('lib', __dir__)
@@ -5,12 +6,12 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
6
  require('asciidoctor/defmastership/version')
6
7
 
7
8
  Gem::Specification.new do |spec|
8
- spec.required_ruby_version = '>= 2.3'
9
+ spec.required_ruby_version = '>= 2.5'
9
10
  spec.name = 'asciidoctor-defmastership'
10
11
  spec.version = Asciidoctor::DefMastership::VERSION
11
12
  spec.authors = ['Jérôme Arbez-Gindre']
12
13
  spec.email = ['jeromearbezgindre@gmail.com']
13
- spec.licenses = 'Nonstandard'
14
+ spec.licenses = ['MIT']
14
15
 
15
16
  spec.summary = %(asciidoctor extension to handle applicable
16
17
  definition references)
@@ -35,9 +36,10 @@ Gem::Specification.new do |spec|
35
36
  spec.add_development_dependency('aruba')
36
37
  spec.add_development_dependency('rake')
37
38
  spec.add_development_dependency('rspec')
38
- spec.add_development_dependency('rubocop', '0.81')
39
- spec.add_development_dependency('rubocop-rspec', '~> 1')
39
+ spec.add_development_dependency('rubocop', '1.13')
40
+ spec.add_development_dependency('rubocop-rake', '~> 0.5')
41
+ spec.add_development_dependency('rubocop-rspec', '~> 2.0')
40
42
 
41
43
  spec.add_dependency('asciidoctor', '~> 2.0')
42
- spec.add_dependency('defmastership', '>= 1.0.2', '< 2.0')
44
+ spec.add_dependency('defmastership', '>= 1.0.13', '< 2.0')
43
45
  end
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # Copyright (c) 2020 Jerome Arbez-Gindre
2
3
  # frozen_string_literal: true
3
4
 
4
5
  require('bundler/setup')
@@ -1,3 +1,4 @@
1
+ # Copyright (c) 2020 Jerome Arbez-Gindre
1
2
  # frozen_string_literal: true
2
3
 
3
4
  if RUBY_ENGINE == 'opal'
@@ -1,3 +1,4 @@
1
+ # Copyright (c) 2020 Jerome Arbez-Gindre
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require('asciidoctor/extensions') unless RUBY_ENGINE == 'opal'
@@ -20,6 +21,7 @@ require('asciidoctor/extensions') unless RUBY_ENGINE == 'opal'
20
21
  # This shall be nice.
21
22
  #
22
23
  require('defmastership/constants')
24
+ require('defmastership/parsing_state')
23
25
 
24
26
  module Asciidoctor
25
27
  module DefMastership
@@ -57,6 +59,7 @@ module Asciidoctor
57
59
  # This is a preprocessor: we need to parse tag attributes
58
60
  @parsing_is_enabled = true
59
61
  @has_url = {}
62
+ @parsing_state = ::DefMastership::ParsingState.new
60
63
  end
61
64
 
62
65
  # process the document
@@ -70,11 +73,10 @@ module Asciidoctor
70
73
  private
71
74
 
72
75
  def parse_and_replace(lines)
73
- parsing_is_enabled = true
74
76
  lines.reduce([]) do |new_lines, line|
75
- parsing_is_enabled = !parsing_is_enabled if line == '....'
77
+ shall_parse = @parsing_state.enabled?(line)
76
78
  filter = FILTERS.find { |onefilter| line.match(onefilter.regex) }
77
- if filter && parsing_is_enabled
79
+ if filter && shall_parse
78
80
  new_lines + __send__(filter.apply, line, Regexp.last_match)
79
81
  else
80
82
  new_lines + [line]
@@ -89,15 +91,12 @@ module Asciidoctor
89
91
 
90
92
  def build_definition(_line, matches)
91
93
  definition_lines = []
92
- if matches[:labels]
93
- labels_str = labels_strings(matches[:labels]).join(' ')
94
- definition_lines << ".#{matches[:reference]} #{labels_str}"
95
- else
96
- definition_lines << ".#{matches[:reference]}"
97
- end
94
+ explicit_checksum_str = " [.checksum]\#(#{matches[:explicit_checksum]})\#" if matches[:explicit_checksum]
95
+ explicit_version_str = " [.version]\#(#{matches[:explicit_version]})\#" if matches[:explicit_version]
96
+ labels_str = " #{labels_strings(matches[:labels]).join(' ')}" if matches[:labels]
97
+ definition_lines << ".#{matches[:reference]}#{explicit_version_str}#{explicit_checksum_str}#{labels_str}"
98
98
  definition_lines <<
99
99
  "[\##{matches[:reference]}.define.#{matches[:type]}]"
100
- definition_lines
101
100
  end
102
101
 
103
102
  def labels_strings(labels)
@@ -121,13 +120,15 @@ module Asciidoctor
121
120
  new_line = "[.external_reference]\#{eref-#{matches[:refname]}-prefix} "
122
121
  extref_line = extrefs.map { |ref| build_link(ref, matches) }
123
122
  @has_url[matches[:refname]]
124
- [new_line + extref_line.join(', ') + '.#']
123
+ ["#{new_line}#{extref_line.join(', ')}.\#"]
125
124
  end
126
125
 
127
126
  def build_internal_ref(line, _matches)
128
- [line.gsub(IREF_DEF_REGEXP) do
129
- "<<#{Regexp.last_match[:intref]},#{Regexp.last_match[:intref]}>>"
130
- end]
127
+ [
128
+ line.gsub(IREF_DEF_REGEXP) do
129
+ "<<#{Regexp.last_match[:intref]},#{Regexp.last_match[:intref]}>>"
130
+ end
131
+ ]
131
132
  end
132
133
 
133
134
  def attribute_setting(_line, matches)
@@ -1,8 +1,9 @@
1
+ # Copyright (c) 2020 Jerome Arbez-Gindre
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Asciidoctor
4
5
  module DefMastership
5
- VERSION = '1.0.0'
6
+ VERSION = '1.0.5'
6
7
  public_constant :VERSION
7
8
  end
8
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-defmastership
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.5
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: 2020-09-16 00:00:00.000000000 Z
11
+ date: 2021-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba
@@ -58,28 +58,42 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '0.81'
61
+ version: '1.13'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '0.81'
68
+ version: '1.13'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.5'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.5'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rubocop-rspec
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: '1'
89
+ version: '2.0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: '1'
96
+ version: '2.0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: asciidoctor
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +114,7 @@ dependencies:
100
114
  requirements:
101
115
  - - ">="
102
116
  - !ruby/object:Gem::Version
103
- version: 1.0.2
117
+ version: 1.0.13
104
118
  - - "<"
105
119
  - !ruby/object:Gem::Version
106
120
  version: '2.0'
@@ -110,7 +124,7 @@ dependencies:
110
124
  requirements:
111
125
  - - ">="
112
126
  - !ruby/object:Gem::Version
113
- version: 1.0.2
127
+ version: 1.0.13
114
128
  - - "<"
115
129
  - !ruby/object:Gem::Version
116
130
  version: '2.0'
@@ -125,11 +139,12 @@ extensions: []
125
139
  extra_rdoc_files: []
126
140
  files:
127
141
  - ".gitignore"
142
+ - ".gitlab-ci.yml"
128
143
  - ".rspec"
129
144
  - ".rubocop.yml"
130
145
  - ".travis.yml"
131
146
  - Gemfile
132
- - Gemfile.lock
147
+ - LICENCE
133
148
  - README.md
134
149
  - Rakefile
135
150
  - asciidoctor-defmastership.gemspec
@@ -151,7 +166,7 @@ files:
151
166
  - lib/asciidoctor/defmastership/version.rb
152
167
  homepage: https://gitlab.com/jjag/asciidoctor-defmastership/
153
168
  licenses:
154
- - Nonstandard
169
+ - MIT
155
170
  metadata: {}
156
171
  post_install_message:
157
172
  rdoc_options: []
@@ -161,14 +176,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
176
  requirements:
162
177
  - - ">="
163
178
  - !ruby/object:Gem::Version
164
- version: '2.3'
179
+ version: '2.5'
165
180
  required_rubygems_version: !ruby/object:Gem::Requirement
166
181
  requirements:
167
182
  - - ">="
168
183
  - !ruby/object:Gem::Version
169
184
  version: '0'
170
185
  requirements: []
171
- rubygems_version: 3.1.2
186
+ rubygems_version: 3.2.5
172
187
  signing_key:
173
188
  specification_version: 4
174
189
  summary: asciidoctor extension to handle applicable definition references
data/Gemfile.lock DELETED
@@ -1,132 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- asciidoctor-defmastership (1.0.0)
5
- asciidoctor (~> 2.0)
6
- defmastership (>= 1.0.2, < 2.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- aasm (5.1.1)
12
- concurrent-ruby (~> 1.0)
13
- activesupport (6.0.3.3)
14
- concurrent-ruby (~> 1.0, >= 1.0.2)
15
- i18n (>= 0.7, < 2)
16
- minitest (~> 5.1)
17
- tzinfo (~> 1.1)
18
- zeitwerk (~> 2.2, >= 2.2.2)
19
- aruba (1.0.3)
20
- childprocess (>= 2.0, < 5.0)
21
- contracts (~> 0.16.0)
22
- cucumber (>= 2.4, < 6.0)
23
- ffi (~> 1.9)
24
- rspec-expectations (~> 3.4)
25
- thor (~> 1.0)
26
- asciidoctor (2.0.10)
27
- ast (2.4.1)
28
- builder (3.2.4)
29
- childprocess (4.0.0)
30
- concurrent-ruby (1.1.7)
31
- contracts (0.16.0)
32
- cucumber (5.1.1)
33
- builder (~> 3.2, >= 3.2.4)
34
- cucumber-core (~> 8.0, >= 8.0.1)
35
- cucumber-create-meta (~> 2.0, >= 2.0.2)
36
- cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
37
- cucumber-gherkin (~> 15.0, >= 15.0.2)
38
- cucumber-html-formatter (~> 9.0, >= 9.0.0)
39
- cucumber-messages (~> 13.0, >= 13.0.1)
40
- cucumber-wire (~> 4.0, >= 4.0.1)
41
- diff-lcs (~> 1.4, >= 1.4.4)
42
- multi_test (~> 0.1, >= 0.1.2)
43
- sys-uname (~> 1.2, >= 1.2.1)
44
- cucumber-core (8.0.1)
45
- cucumber-gherkin (~> 15.0, >= 15.0.2)
46
- cucumber-messages (~> 13.0, >= 13.0.1)
47
- cucumber-tag-expressions (~> 2.0, >= 2.0.4)
48
- cucumber-create-meta (2.0.2)
49
- cucumber-messages (~> 13.0, >= 13.0.1)
50
- sys-uname (~> 1.2, >= 1.2.1)
51
- cucumber-cucumber-expressions (10.3.0)
52
- cucumber-gherkin (15.0.2)
53
- cucumber-messages (~> 13.0, >= 13.0.1)
54
- cucumber-html-formatter (9.0.0)
55
- cucumber-messages (~> 13.0, >= 13.0.1)
56
- cucumber-messages (13.1.0)
57
- protobuf-cucumber (~> 3.10, >= 3.10.8)
58
- cucumber-tag-expressions (2.0.4)
59
- cucumber-wire (4.0.1)
60
- cucumber-core (~> 8.0, >= 8.0.1)
61
- cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
62
- cucumber-messages (~> 13.0, >= 13.0.1)
63
- defmastership (1.0.2)
64
- aasm (~> 5)
65
- asciidoctor (~> 2)
66
- gli (~> 2)
67
- diff-lcs (1.4.4)
68
- ffi (1.13.1)
69
- gli (2.19.2)
70
- i18n (1.8.5)
71
- concurrent-ruby (~> 1.0)
72
- jaro_winkler (1.5.4)
73
- middleware (0.1.0)
74
- minitest (5.14.2)
75
- multi_test (0.1.2)
76
- parallel (1.19.2)
77
- parser (2.7.1.4)
78
- ast (~> 2.4.1)
79
- protobuf-cucumber (3.10.8)
80
- activesupport (>= 3.2)
81
- middleware
82
- thor
83
- thread_safe
84
- rainbow (3.0.0)
85
- rake (13.0.1)
86
- rexml (3.2.4)
87
- rspec (3.9.0)
88
- rspec-core (~> 3.9.0)
89
- rspec-expectations (~> 3.9.0)
90
- rspec-mocks (~> 3.9.0)
91
- rspec-core (3.9.2)
92
- rspec-support (~> 3.9.3)
93
- rspec-expectations (3.9.2)
94
- diff-lcs (>= 1.2.0, < 2.0)
95
- rspec-support (~> 3.9.0)
96
- rspec-mocks (3.9.1)
97
- diff-lcs (>= 1.2.0, < 2.0)
98
- rspec-support (~> 3.9.0)
99
- rspec-support (3.9.3)
100
- rubocop (0.81.0)
101
- jaro_winkler (~> 1.5.1)
102
- parallel (~> 1.10)
103
- parser (>= 2.7.0.1)
104
- rainbow (>= 2.2.2, < 4.0)
105
- rexml
106
- ruby-progressbar (~> 1.7)
107
- unicode-display_width (>= 1.4.0, < 2.0)
108
- rubocop-rspec (1.41.0)
109
- rubocop (>= 0.68.1)
110
- ruby-progressbar (1.10.1)
111
- sys-uname (1.2.1)
112
- ffi (>= 1.0.0)
113
- thor (1.0.1)
114
- thread_safe (0.3.6)
115
- tzinfo (1.2.7)
116
- thread_safe (~> 0.1)
117
- unicode-display_width (1.7.0)
118
- zeitwerk (2.4.0)
119
-
120
- PLATFORMS
121
- ruby
122
-
123
- DEPENDENCIES
124
- aruba
125
- asciidoctor-defmastership!
126
- rake
127
- rspec
128
- rubocop (= 0.81)
129
- rubocop-rspec (~> 1)
130
-
131
- BUNDLED WITH
132
- 2.1.4