asciidoctor-bibliography 0.10.3 → 0.11.0

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: 29744edf85af3d884fd492dee1deef3a10a317dfd7c1085948dfb1f24938ff9a
4
- data.tar.gz: 61c41f1153c9709ecbfe6075524c1988a9459a6c17f86936f36da170436a0b54
3
+ metadata.gz: 2dea03494679072cad900828875fc0cb3dc3eb3f0f4653170ed7ef7981fef4ff
4
+ data.tar.gz: 36d894f8e6a4920598977929397e05ae7e840403ba23fb0971de8b37163d0d5c
5
5
  SHA512:
6
- metadata.gz: 4386ea833295bff8f81d026dc8b18493d19f4bbef2c997e9134d9ebbef90b35e5861f1b9c83cd64f7d9ef48922af9799a415c93fc2e16ec9e70f4401b7a9371f
7
- data.tar.gz: df9b5ecf5db644a1bd54d18798e04ed7eac279e46d6280a399cb60e689f21d6e4d0c6eef9b8d77d9201109e57528411d7b327bd176128dfd9316f2129e731817
6
+ metadata.gz: 488fc4067b7fbbeb69eb511b2fcfc31fe181872e07706a472a070c3b5e9dbb1b635083feed330d9e61221f01bddf5d50104dbfe3a1068e89f7b629ec311e3886
7
+ data.tar.gz: 370215eaa5fb4b4d5714bf91c157a8ada4d932698c180f5b1aab0eb6880c9a57c2d459e51ca9a9d1362c36c01205c5fdad73c8083db6d7fa7ba2965399b84c50
@@ -0,0 +1,47 @@
1
+ name: test-and-release
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ tags: [ 'v*' ]
7
+ pull_request:
8
+
9
+ concurrency:
10
+ group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ test:
15
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
16
+ runs-on: ${{ matrix.os }}
17
+ continue-on-error: false
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1' ]
22
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
23
+
24
+ steps:
25
+ - uses: actions/checkout@v3
26
+
27
+ - uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby }}
30
+ bundler-cache: true
31
+
32
+ - run: bundle exec rspec
33
+
34
+ release:
35
+ name: Release gem
36
+ needs: test
37
+ runs-on: ubuntu-latest
38
+ if: contains(github.ref, 'refs/tags/v')
39
+ steps:
40
+ - uses: actions/checkout@v3
41
+ - uses: ruby/setup-ruby@v1
42
+ with:
43
+ ruby-version: 2.7
44
+ bundler-cache: true
45
+ - uses: cadwallion/publish-rubygems-action@master
46
+ env:
47
+ RUBYGEMS_API_KEY: ${{secrets.RIBOSE_RUBYGEMS_API_KEY}}
data/README.adoc CHANGED
@@ -1,10 +1,11 @@
1
1
  = Citations and Bibliography the "asciidoctor-way"
2
2
 
3
- asciidoctor-bibliography lets you handle citations and bibliography the
4
- http://asciidoctor.org/[asciidoctor]-way!
3
+ asciidoctor-bibliography lets you handle citations and bibliography in
4
+ http://asciidoctor.org/[asciidoctor].
5
5
 
6
- image:https://img.shields.io/gem/v/asciidoctor-bibliography.svg["Gem Version", link="https://rubygems.org/gems/asciidoctor-bibliography"]
7
- image:https://img.shields.io/travis/riboseinc/asciidoctor-bibliography/master.svg["Build Status", link="https://travis-ci.org/riboseinc/asciidoctor-bibliography"]
6
+ image:https://github.com/riboseinc/asciidoctor-bibliography/actions/workflows/rspec.yml/badge.svg["Build Status", link="https://github.com/riboseinc/asciidoctor-bibliography/actions/workflows/test-and-release.yml"]
7
+ image:https://img.shields.io/gem/v/fontist.svg["Gem Version", link="https://rubygems.org/gems/fontist"]
8
+ image:https://img.shields.io/github/issues-pr-raw/riboseinc/asciidoctor-bibliography.svg["Pull Requests", link="https://github.com/riboseinc/asciidoctor-bibliography/pulls"]
8
9
  image:https://codeclimate.com/github/riboseinc/asciidoctor-bibliography/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/asciidoctor-bibliography"]
9
10
 
10
11
 
@@ -424,11 +425,11 @@ copyright covering the contribution to use the contribution by all means.
424
425
 
425
426
  Here are a few technical guidelines to follow:
426
427
 
427
- 1. Open an https://github.com/riboseinc/asciidoctor-bibliography/issues[issues] to discuss a new feature.
428
+ 1. Open an https://github.com/riboseinc/asciidoctor-bibliography/issues[issue] to discuss a new feature.
428
429
  2. Write tests to support your new feature.
429
430
  3. Make sure the entire test suite passes locally and on CI.
430
431
  4. Open a Pull Request.
431
- 5. https://github.com/thoughtbot/guides/tree/master/protocol/git=write-a-feature[Squash your commits] after receiving feedback.
432
+ 5. https://github.com/thoughtbot/guides/tree/main/git#write-a-feature[Squash your commits] after receiving feedback.
432
433
  6. Party!
433
434
 
434
435
  == Credits
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task default: :spec
6
+ task :default => :spec
@@ -32,19 +32,19 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
32
32
  spec.require_paths = ["lib"]
33
33
  spec.files = `git ls-files`.split("\n")
34
34
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
35
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
35
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
36
36
 
37
37
  spec.add_dependency "asciidoctor", ">= 1.5.6"
38
- spec.add_dependency "bibtex-ruby", "~> 4.4.4"
38
+ spec.add_dependency "bibtex-ruby", "~> 6.0.0"
39
39
  spec.add_dependency "citeproc-ruby", "~> 1.1.7"
40
40
  spec.add_dependency "csl-styles", "~> 1.0.1"
41
41
  spec.add_dependency "latex-decode", "~> 0.2.2"
42
- spec.add_dependency "nokogiri", "~> 1.8.1"
43
-
44
- spec.add_development_dependency "byebug", "~> 10.0.1"
45
- spec.add_development_dependency "rake", "~> 12.3.0"
46
- spec.add_development_dependency "rspec", "~> 3.7.0"
47
- spec.add_development_dependency "rubocop", "~> 0.54.0"
48
- spec.add_development_dependency "simplecov", "~> 0.16.1"
49
- spec.add_development_dependency "yard", "~> 0.9.12"
42
+ spec.add_dependency "nokogiri", "~> 1.8"
43
+
44
+ spec.add_development_dependency "byebug"
45
+ spec.add_development_dependency "rake", "~> 12.3"
46
+ spec.add_development_dependency "rspec", "~> 3.7"
47
+ spec.add_development_dependency "rubocop"
48
+ spec.add_development_dependency "simplecov"
49
+ spec.add_development_dependency "yard"
50
50
  end
@@ -79,10 +79,15 @@ module AsciidoctorBibliography
79
79
  end
80
80
 
81
81
  def glob_pattern(pattern_string, base_dir)
82
- pattern_string.split(/(?<!\\)\s+/).map do |pattern|
83
- Dir.chdir(base_dir) { Dir.glob(pattern) }
82
+ pattern_string.split.map do |pattern|
83
+ Dir.chdir(base_dir) { Dir.glob(normalize_separator(pattern)) }
84
84
  end.flatten
85
85
  end
86
+
87
+ def normalize_separator(path)
88
+ return path if File::ALT_SEPARATOR.nil?
89
+ path.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
90
+ end
86
91
  end
87
92
  end
88
93
  end
@@ -1,3 +1,3 @@
1
1
  module AsciidoctorBibliography
2
- VERSION = "0.10.3".freeze
2
+ VERSION = "0.11.0".freeze
3
3
  end
@@ -40,7 +40,9 @@ module CiteProc
40
40
  end
41
41
 
42
42
  def aligned_first_accessible?
43
- !(node.root.is_a? CSL::Locale) && node.root.bibliography["second-field-align"]
43
+ !(node.root.is_a? CSL::Locale) &&
44
+ node.root.respond_to?(:bibliography) &&
45
+ node.root.bibliography["second-field-align"]
44
46
  end
45
47
  end
46
48
  end
data/spec/macros_spec.rb CHANGED
@@ -4,12 +4,12 @@ require_relative "citation_helper"
4
4
 
5
5
  describe "cite macro with apa style" do
6
6
  it "formats a complex citation" do
7
- expect(formatted_citation("cite:[Erdos65, prefix=see]+[Einstein35, page=41-43]",
7
+ expect(formatted_citation("cite:[Erdos65, prefix='see ']+[Einstein35, page=41-43]",
8
8
  options: { "bibliography-style" => "apa",
9
9
  "bibliography-database" => "database.bib",
10
10
  "bibliography-hyperlinks" => "true" })).
11
- to eq "(<<bibliography-default-Einstein35,Einstein, Podolsky, & Rosen, 1935, pp. 41-43>>; " +
12
- "<<bibliography-default-Erdos65,seeErdős, Heyting, & Brouwer, 1965>>)"
11
+ to eq "(<<bibliography-default-Einstein35,Einstein et al., 1935, pp. 41-43>>; " +
12
+ "<<bibliography-default-Erdos65,see Erdős et al., 1965>>)"
13
13
  end
14
14
  end
15
15
 
@@ -19,7 +19,7 @@ describe "cite macro with arbitrary interpolated text" do
19
19
  options: { "bibliography-style" => "apa",
20
20
  "bibliography-database" => "database.bib",
21
21
  "bibliography-hyperlinks" => "true" })).
22
- to eq "(<<bibliography-default-Erdos65,foo Erdős, Heyting, & Brouwer, 1965 bar>>)"
22
+ to eq "(<<bibliography-default-Erdos65,foo Erdős et al., 1965 bar>>)"
23
23
  end
24
24
  end
25
25
 
@@ -48,6 +48,6 @@ describe "cite macro using more than two keys" do
48
48
  options: { "bibliography-style" => "apa",
49
49
  "bibliography-database" => "database.bib",
50
50
  "bibliography-hyperlinks" => "true" })).
51
- to eq "(<<bibliography-default-Einstein35,Einstein, Podolsky, & Rosen, 1935>>; <<bibliography-default-Erdos65,Erdős, Heyting, & Brouwer, 1965>>; <<bibliography-default-Lane12a,Lane, 2000>>; <<bibliography-default-Lane12b,Mane & Smith, 2000>>)"
51
+ to eq "(<<bibliography-default-Einstein35,Einstein et al., 1935>>; <<bibliography-default-Erdos65,Erdős et al., 1965>>; <<bibliography-default-Lane12a,Lane, 2000>>; <<bibliography-default-Lane12b,Mane & Smith, 2000>>)"
52
52
  end
53
53
  end
data/spec/sanity_spec.rb CHANGED
@@ -86,7 +86,7 @@ describe "asciidoctor integration" do
86
86
  <p>Hello World. (<a href="#bibliography-default-Foo00">Bar, 2000</a>)</p>
87
87
  </div>
88
88
  <div class="paragraph">
89
- <p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). Title.</p>
89
+ <p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). <em>Title</em>.</p>
90
90
  </div>
91
91
  </div>
92
92
  BODY
@@ -119,7 +119,7 @@ describe "asciidoctor integration" do
119
119
  <p>This is content from a nested file. (<a href="#bibliography-default-Foo00">Bar, 2000</a>)</p>
120
120
  </div>
121
121
  <div class="paragraph">
122
- <p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). Title.</p>
122
+ <p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). <em>Title</em>.</p>
123
123
  </div>
124
124
  </div>
125
125
  BODY
@@ -183,22 +183,22 @@ describe "asciidoctor integration" do
183
183
  <div class="sect2">
184
184
  <h3 id="_default">Default</h3>
185
185
  <div class="paragraph">
186
- <p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). Title.</p>
186
+ <p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). <em>Title</em>.</p>
187
187
  </div>
188
188
  </div>
189
189
  <div class="sect2">
190
190
  <h3 id="_first">First</h3>
191
191
  <div class="paragraph">
192
- <p><a id="bibliography-first-Foo00"></a>Bar, F. (2000). Title.</p>
192
+ <p><a id="bibliography-first-Foo00"></a>Bar, F. (2000). <em>Title</em>.</p>
193
193
  </div>
194
194
  <div class="paragraph">
195
- <p><a id="bibliography-first-Qux00"></a>Zot, Q. (3000). Title.</p>
195
+ <p><a id="bibliography-first-Qux00"></a>Zot, Q. (3000). <em>Title</em>.</p>
196
196
  </div>
197
197
  </div>
198
198
  <div class="sect2">
199
199
  <h3 id="_last">Last</h3>
200
200
  <div class="paragraph">
201
- <p><a id="bibliography-last-Qux00"></a>Zot, Q. (3000). Title.</p>
201
+ <p><a id="bibliography-last-Qux00"></a>Zot, Q. (3000). <em>Title</em>.</p>
202
202
  </div>
203
203
  </div>
204
204
  </div>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-bibliography
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-08 00:00:00.000000000 Z
11
+ date: 2022-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 4.4.4
33
+ version: 6.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 4.4.4
40
+ version: 6.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: citeproc-ruby
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,98 +86,98 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.8.1
89
+ version: '1.8'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.8.1
96
+ version: '1.8'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: byebug
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 10.0.1
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 10.0.1
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 12.3.0
117
+ version: '12.3'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 12.3.0
124
+ version: '12.3'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 3.7.0
131
+ version: '3.7'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 3.7.0
138
+ version: '3.7'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: 0.54.0
145
+ version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: 0.54.0
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: simplecov
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 0.16.1
159
+ version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 0.16.1
166
+ version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: yard
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - "~>"
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
- version: 0.9.12
173
+ version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - "~>"
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
- version: 0.9.12
180
+ version: '0'
181
181
  description: |
182
182
  asciidoctor-bibliography lets you handle citations and bibliography the "asciidoctor-way"!
183
183
 
@@ -198,12 +198,12 @@ extensions: []
198
198
  extra_rdoc_files: []
199
199
  files:
200
200
  - ".codeclimate.yml"
201
+ - ".github/workflows/test-and-release.yml"
201
202
  - ".gitignore"
202
203
  - ".hound.yml"
203
204
  - ".oss-guides.rubocop.yml"
204
205
  - ".rspec"
205
206
  - ".rubocop.yml"
206
- - ".travis.yml"
207
207
  - Gemfile
208
208
  - LICENSE.txt
209
209
  - README.adoc
@@ -326,14 +326,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
326
326
  requirements:
327
327
  - - ">="
328
328
  - !ruby/object:Gem::Version
329
- version: 2.3.0
329
+ version: 2.5.0
330
330
  required_rubygems_version: !ruby/object:Gem::Requirement
331
331
  requirements:
332
332
  - - ">="
333
333
  - !ruby/object:Gem::Version
334
334
  version: '0'
335
335
  requirements: []
336
- rubygems_version: 3.0.4
336
+ rubygems_version: 3.3.7
337
337
  signing_key:
338
338
  specification_version: 4
339
339
  summary: Citations and bibliography the "asciidoctor-way"
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3
5
- before_script:
6
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
7
- - chmod +x ./cc-test-reporter
8
- - ./cc-test-reporter before-build
9
- script:
10
- - bundle exec rspec
11
- after_script:
12
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT