asciidoc-bib 2.4.5 → 2.4.6

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: 28a9a41d86ee2820dd4eae638d5b30eb367a01b6fba84db47f860725a7fecb8c
4
- data.tar.gz: 9e59a842758e91db5c751bdffd4a25d60d079de9f791fdc20f9ea2c0aa3b5028
3
+ metadata.gz: c8ad95e9c899acee423b2abfd935c41d7038da853a99ae7d3f28edd715401649
4
+ data.tar.gz: 3790662b0f92c37c17d2cca5f301e3c476b043c6e00743f3b35c4b6c05cb86b9
5
5
  SHA512:
6
- metadata.gz: cfa817faad29f0fa5264cdbc8a750594a10c00ed76365aa266be98c8e38bbd3aa4d69f4f745a2eab524f5a14e233b921717d9c991cd77d425a575571fa1e47e6
7
- data.tar.gz: 69a5837ccd61d00e2414b227484a57098c45de36c1eeba54f289fb1dbefae6c6555f7b39652072a0ad46482ef63553ce3ab47364008c46832ba044c2d32e5053
6
+ metadata.gz: 3ef71d2200aeed0e54dba9f648c3a8a7b4699f77be9d28f44ee9e260df93745d8413d16d8e54b85e7caf9a3e33f379196600160f5d3427256797198de8576c45
7
+ data.tar.gz: 297c33d8155a1f55f9fac2263178bb21faed45c9bf5bc04dff4915f42d0ebe6e2c8125856f4c48e9c8591f1d8c0d50b3ae910d5fcfc9ef9b7857b09bdf0a083e
@@ -1,6 +1,6 @@
1
- MIT License
1
+ = MIT License
2
2
 
3
- Copyright (c) 2019-20, Peter Lane
3
+ Copyright (c) 2019-25, Peter Lane
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/bin/asciidoc-bib CHANGED
File without changes
@@ -11,9 +11,9 @@ module AsciidocBib
11
11
  # Construct instance of citation, from a reference and definition of page numbers.
12
12
  def initialize ref, pages
13
13
  @ref = ref
14
- @pages = pages
14
+ @pages = pages.dup
15
15
  # clean up pages
16
- @pages = '' unless @pages
16
+ @pages = "".dup unless @pages
17
17
  @pages.gsub!("--","-")
18
18
  end
19
19
 
@@ -13,7 +13,7 @@ class Array
13
13
  if size < 2
14
14
  return self.join("")
15
15
  end
16
- result = ""
16
+ result = "".dup
17
17
  self.each_with_index do |item, index|
18
18
  if index.zero?
19
19
  result << item
@@ -131,8 +131,8 @@ module AsciidocBib
131
131
 
132
132
  # Return the complete citation text for given cite_data.
133
133
  def complete_citation cite_data
134
- result = ''
135
- ob, cb = '(', ')'
134
+ result = "".dup
135
+ ob, cb = "(", ")"
136
136
 
137
137
  cite_data.cites.each_with_index do |cite, index|
138
138
  # before all items apart from the first, insert appropriate separator
@@ -168,7 +168,7 @@ module AsciidocBib
168
168
  # Retrieve text for reference in given style.
169
169
  # ref:: reference for item to give reference for
170
170
  def get_reference ref
171
- result = ""
171
+ result = "".dup
172
172
  result << ". " if Styles.is_numeric? @style
173
173
 
174
174
  begin
@@ -197,11 +197,11 @@ module AsciidocBib
197
197
 
198
198
  # Format pages with pp/p as appropriate.
199
199
  def with_pp pages
200
- return '' if pages.empty?
200
+ return "".dup if pages.empty?
201
201
 
202
202
  if @style.include? "chicago"
203
203
  pages
204
- elsif pages.include? '-'
204
+ elsif pages.include? "-"
205
205
  "pp.&#160;#{pages}"
206
206
  else
207
207
  "p.&#160;#{pages}"
@@ -210,7 +210,7 @@ module AsciidocBib
210
210
 
211
211
  # Return page string for given _cite_.
212
212
  def page_str cite
213
- result = ''
213
+ result ="".dup
214
214
  unless cite.pages.empty?
215
215
  result << "," unless Styles.is_numeric? @style
216
216
  result << " #{with_pp(cite.pages)}"
@@ -1,4 +1,4 @@
1
1
  module AsciidocBib
2
2
  # Version number of project.
3
- VERSION = '2.4.5'
3
+ VERSION = "2.4.6"
4
4
  end
data/lib/asciidoc-bib.rb CHANGED
@@ -1,19 +1,30 @@
1
1
  # asciidoc-bib.rb
2
2
  #
3
3
 
4
- require 'bibtex'
5
- require 'citeproc'
6
- require 'csl/styles'
7
- require 'set'
4
+ require "bibtex"
5
+ require "citeproc"
6
+ require "csl/styles"
8
7
 
9
- require 'asciidoc-bib/citation'
10
- require 'asciidoc-bib/citationdata'
11
- require 'asciidoc-bib/citationutils'
12
- require 'asciidoc-bib/citations'
13
- require 'asciidoc-bib/extensions'
14
- require 'asciidoc-bib/filehandlers'
15
- require 'asciidoc-bib/options'
16
- require 'asciidoc-bib/processorutils'
17
- require 'asciidoc-bib/processor'
18
- require 'asciidoc-bib/styles'
19
- require 'asciidoc-bib/version'
8
+ # suppress some warning messages
9
+ module Warning
10
+ def self.warn(message)
11
+ # Ignore the frozen string warning if it comes from the specific gem path
12
+ return if message.include?("--debug-frozen-string-literal")
13
+
14
+ super(message) # Otherwise, print as usual
15
+ end
16
+ end
17
+
18
+ require "set"
19
+
20
+ require "asciidoc-bib/citation"
21
+ require "asciidoc-bib/citationdata"
22
+ require "asciidoc-bib/citationutils"
23
+ require "asciidoc-bib/citations"
24
+ require "asciidoc-bib/extensions"
25
+ require "asciidoc-bib/filehandlers"
26
+ require "asciidoc-bib/options"
27
+ require "asciidoc-bib/processorutils"
28
+ require "asciidoc-bib/processor"
29
+ require "asciidoc-bib/styles"
30
+ require "asciidoc-bib/version"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoc-bib
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.5
4
+ version: 2.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Lane
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-04-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bibtex-ruby
@@ -16,63 +15,45 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '5.0'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 5.1.4
18
+ version: '6.2'
23
19
  type: :runtime
24
20
  prerelease: false
25
21
  version_requirements: !ruby/object:Gem::Requirement
26
22
  requirements:
27
23
  - - "~>"
28
24
  - !ruby/object:Gem::Version
29
- version: '5.0'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 5.1.4
25
+ version: '6.2'
33
26
  - !ruby/object:Gem::Dependency
34
27
  name: citeproc-ruby
35
28
  requirement: !ruby/object:Gem::Requirement
36
29
  requirements:
37
30
  - - "~>"
38
31
  - !ruby/object:Gem::Version
39
- version: '1.0'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 1.0.5
32
+ version: '2.1'
43
33
  type: :runtime
44
34
  prerelease: false
45
35
  version_requirements: !ruby/object:Gem::Requirement
46
36
  requirements:
47
37
  - - "~>"
48
38
  - !ruby/object:Gem::Version
49
- version: '1.0'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 1.0.5
39
+ version: '2.1'
53
40
  - !ruby/object:Gem::Dependency
54
41
  name: csl-styles
55
42
  requirement: !ruby/object:Gem::Requirement
56
43
  requirements:
57
44
  - - "~>"
58
45
  - !ruby/object:Gem::Version
59
- version: '1.0'
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: 1.0.1.6
46
+ version: '2.0'
63
47
  type: :runtime
64
48
  prerelease: false
65
49
  version_requirements: !ruby/object:Gem::Requirement
66
50
  requirements:
67
51
  - - "~>"
68
52
  - !ruby/object:Gem::Version
69
- version: '1.0'
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- version: 1.0.1.6
53
+ version: '2.0'
73
54
  description: "asciidoc-bib generates in-text references and a reference list from
74
55
  an asciidoc\nfile, using a bibtex file as a source of citation information. The
75
- syntax for\nan in-text reference is simply [cite:bibref], and a line containing\n[bibliography]
56
+ syntax for\nan in-text reference is [[cite:bibref]], and a line containing\n[[bibliography]]
76
57
  inserts a complete reference list. See the README for more\nexamples and further
77
58
  options. The references are formatted using styles provided \nby CSL.\n"
78
59
  email: peterlane@gmx.com
@@ -80,13 +61,12 @@ executables:
80
61
  - asciidoc-bib
81
62
  extensions: []
82
63
  extra_rdoc_files:
64
+ - LICENSE.rdoc
83
65
  - README.rdoc
84
- - LICENSE.txt
85
66
  files:
86
- - LICENSE.txt
67
+ - LICENSE.rdoc
87
68
  - README.rdoc
88
69
  - bin/asciidoc-bib
89
- - changes.txt
90
70
  - lib/asciidoc-bib.rb
91
71
  - lib/asciidoc-bib/citation.rb
92
72
  - lib/asciidoc-bib/citationdata.rb
@@ -99,14 +79,12 @@ files:
99
79
  - lib/asciidoc-bib/processorutils.rb
100
80
  - lib/asciidoc-bib/styles.rb
101
81
  - lib/asciidoc-bib/version.rb
102
- - samples/biblio.bib
103
- - samples/sample-1.txt
104
- - samples/sample-2.txt
105
- homepage:
82
+ homepage: https://rubygems.org/gems/asciidoc-bib
106
83
  licenses:
107
84
  - MIT
108
- metadata: {}
109
- post_install_message:
85
+ metadata:
86
+ documentation_uri: https://rubydoc.info/gems/asciidoc-bib
87
+ source_code_uri: https://codeberg.org/peterlane/asciidoc-bib
110
88
  rdoc_options:
111
89
  - "-m"
112
90
  - README.rdoc
@@ -116,15 +94,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
94
  requirements:
117
95
  - - ">="
118
96
  - !ruby/object:Gem::Version
119
- version: '2.0'
97
+ version: '3.1'
120
98
  required_rubygems_version: !ruby/object:Gem::Requirement
121
99
  requirements:
122
100
  - - ">="
123
101
  - !ruby/object:Gem::Version
124
102
  version: '0'
125
103
  requirements: []
126
- rubygems_version: 3.3.7
127
- signing_key:
104
+ rubygems_version: 3.6.9
128
105
  specification_version: 4
129
106
  summary: asciidoc-bib adds references from a bibtex file to an asciidoc file.
130
107
  test_files: []
data/changes.txt DELETED
@@ -1,39 +0,0 @@
1
- = Changes to asciidoc-bib
2
-
3
- == version 2.4.4
4
-
5
- - confirm works with ruby 3.0-preview
6
-
7
- == version 2.4.3
8
-
9
- - update tests to support minitest 5.13
10
- - confirm works with ruby 2.7
11
- - updated documentation to most classes
12
-
13
- == version 2.4.2
14
-
15
- - updated documentation
16
- - removed all OWL license references
17
- - removed all asciidoctor references
18
-
19
- == version 2.4.1
20
-
21
- - changed license to MIT
22
-
23
- == version 2.4.0
24
-
25
- - removed asciidoctor references
26
-
27
- == github version
28
-
29
- - accepted dash inside citation keys
30
-
31
- == version 2.3.1
32
-
33
- - now works with asciidoctor 1.5 api
34
-
35
- == version 2.3.0
36
-
37
- - added switch for order of numeric citations in bibliography, with choice of
38
- order of appearance or alphabetical order
39
-
data/samples/biblio.bib DELETED
@@ -1,31 +0,0 @@
1
- @book{Lane12a,
2
- author = {P. Lane},
3
- title = {Book title},
4
- publisher = {Publisher},
5
- year = {2000}
6
- }
7
-
8
- @book{Lane12b,
9
- author = {P. Lane and D. Smith},
10
- title = {Book title},
11
- publisher = {Publisher},
12
- year = {2000}
13
- }
14
-
15
- @book{Anderson98,
16
- editor = {J. R. Anderson and C. Lebiere},
17
- title = {The Atomic Components of Thought},
18
- publisher = {Lawrence Erlbaum},
19
- address = {Mahwah, NJ},
20
- year = {1998}
21
- }
22
-
23
- @article{Anderson04,
24
- author = {J. R. Anderson and D. Bothell and M. D. Byrne and S. Douglass and C. Lebiere and Y. L. Qin},
25
- title = {An integrated theory of the mind},
26
- journal = {Psychological Review},
27
- volume = {111},
28
- number = {4},
29
- pages = {1036--1060},
30
- year = {2004}
31
- }
data/samples/sample-1.txt DELETED
@@ -1,23 +0,0 @@
1
- = Sample of using asciidoc-bib =
2
-
3
- The bibliography is searched in the folder of the document, and then
4
- in ~/Documents.
5
-
6
- Author-year references can use different styles such as: [cite:Lane12a] or
7
- [citenp:Lane12a].
8
-
9
- Page numbers can be added: [cite:Lane12a,89] or [citenp:Lane12a,89-93].
10
-
11
- A bit of pretext can be included too: [cite:See:Lane12a,89]
12
-
13
- We can include other files, which are also processed:
14
-
15
- include::sample-2.txt[]
16
-
17
- To include the reference list, use the section template before
18
- title, to prevent problems with a2x.
19
-
20
- [sect2]
21
- == Bibliography ==
22
-
23
- [bibliography]
data/samples/sample-2.txt DELETED
@@ -1,18 +0,0 @@
1
- == Sample file 2: multiple authors ==
2
-
3
- Author-year references can use different styles such as: [cite:Lane12b] or
4
- [citenp:Lane12b].
5
-
6
- Page numbers can be added: [cite:Lane12b,89] or [citenp:Lane12b,89-93].
7
-
8
- A bit of pretext can be included too: [cite:See:Lane12b,89]
9
-
10
- === multiple refs ===
11
-
12
- One citation can include several references, such as [cite:Lane12a;Lane12b].
13
-
14
- These can include pages and be in-text: [citenp:Lane12a,78;Lane12b,89-93].
15
-
16
- And include pretext: [cite:See:Lane12a;Lane12b,89-93]
17
-
18
- Note: citations cannot be split over lines; each citation must be on one line.