bibtex-ruby 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bibtex-ruby might be problematic. Click here for more details.
- data/History.txt +5 -0
- data/lib/bibtex/lexer.rb +2 -2
- data/lib/bibtex/version.rb +1 -1
- data/test/bibtex/test_bibliography.rb +1 -1
- data/test/bibtex/test_entry.rb +1 -1
- data/test/bibtex/test_lexer.rb +10 -2
- data/test/bibtex/test_parser.rb +3 -3
- data/test/fixtures/entry.bib +5 -0
- metadata +17 -13
data/History.txt
CHANGED
data/lib/bibtex/lexer.rb
CHANGED
@@ -57,8 +57,8 @@ module BibTeX
|
|
57
57
|
:next => /(^|\n)[\t ]*@[\t ]*/o,
|
58
58
|
:entry => /[a-z\d:_!\.$%&*-]+/io,
|
59
59
|
:string => /string/io,
|
60
|
-
:comment => /comment/io,
|
61
|
-
:preamble => /preamble/io,
|
60
|
+
:comment => /comment\b/io,
|
61
|
+
:preamble => /preamble\b/io,
|
62
62
|
:key => /[[:alpha:]\d \/:_!$\?\.%&\*-]+,/io,
|
63
63
|
:optional_key => /[[:alpha:]\d \/:_!$\?\.%&\*-]*,/io
|
64
64
|
}.freeze
|
data/lib/bibtex/version.rb
CHANGED
data/test/bibtex/test_entry.rb
CHANGED
@@ -323,7 +323,7 @@ module BibTeX
|
|
323
323
|
bib = BibTeX::Bibliography.open(Test.fixtures(:entry), :debug => false)
|
324
324
|
refute_nil(bib)
|
325
325
|
assert_equal(BibTeX::Bibliography, bib.class)
|
326
|
-
assert_equal(
|
326
|
+
assert_equal(4, bib.data.length)
|
327
327
|
assert_equal([BibTeX::Entry], bib.data.map(&:class).uniq)
|
328
328
|
assert_equal('key:0', bib.data[0].key)
|
329
329
|
assert_equal('key:1', bib.data[1].key)
|
data/test/bibtex/test_lexer.rb
CHANGED
@@ -16,9 +16,17 @@ module BibTeX
|
|
16
16
|
Lexer.new.analyse(%Q(@string{ x = "foo\n bar" })).stack[-3].must_be :==,
|
17
17
|
[:STRING_LITERAL, 'foo bar']
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
it 'matches KEY tokens' do
|
21
21
|
Lexer.new.analyse("@misc{foo, }").symbols.must_be :==, [:AT, :NAME, :LBRACE, :KEY, :RBRACE, false]
|
22
22
|
end
|
23
|
+
|
24
|
+
it 'doesn\'t start a comment for types starting with but not equal @comment' do
|
25
|
+
Lexer.new.analyse("@commentary{staudinger, }").symbols.must_be :==, [:AT, :NAME, :LBRACE, :KEY, :RBRACE, false]
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'doesn\'t start a preamble for types starting with but not equal @preamble' do
|
29
|
+
Lexer.new.analyse("@preamblestring{ preamble }").symbols.must_be :==, [:AT, :NAME, :LBRACE, :NAME, :RBRACE, false]
|
30
|
+
end
|
23
31
|
end
|
24
|
-
end
|
32
|
+
end
|
data/test/bibtex/test_parser.rb
CHANGED
@@ -14,15 +14,15 @@ module BibTeX
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'parses all entries' do
|
17
|
-
assert_equal
|
17
|
+
assert_equal 4, @bib.length
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'parses the key values' do
|
21
|
-
assert_equal %w{ key:0 key:1 foo }, @bib.map(&:key)
|
21
|
+
assert_equal %w{ key:0 key:1 foo staudinger }, @bib.map(&:key)
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'should parse the entry types' do
|
25
|
-
assert_equal [:book, :article, :article], @bib.map(&:type)
|
25
|
+
assert_equal [:book, :article, :article, :commentary], @bib.map(&:type)
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'should parse all values correctly' do
|
data/test/fixtures/entry.bib
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bibtex-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: latex-decode
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 0.0.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.0.6
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: multi_json
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '1.3'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.3'
|
36
46
|
description: ! 'BibTeX-Ruby is the Rubyist''s swiss-army-knife for all things BibTeX.
|
37
47
|
It
|
38
48
|
|
@@ -149,21 +159,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
149
159
|
- - ! '>='
|
150
160
|
- !ruby/object:Gem::Version
|
151
161
|
version: '0'
|
152
|
-
segments:
|
153
|
-
- 0
|
154
|
-
hash: 769369451757676187
|
155
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
163
|
none: false
|
157
164
|
requirements:
|
158
165
|
- - ! '>='
|
159
166
|
- !ruby/object:Gem::Version
|
160
167
|
version: '0'
|
161
|
-
segments:
|
162
|
-
- 0
|
163
|
-
hash: 769369451757676187
|
164
168
|
requirements: []
|
165
169
|
rubyforge_project:
|
166
|
-
rubygems_version: 1.8.
|
170
|
+
rubygems_version: 1.8.24
|
167
171
|
signing_key:
|
168
172
|
specification_version: 3
|
169
173
|
summary: A BibTeX parser, converter and API for Ruby.
|