bibtex-ruby 2.1.0 → 2.1.1

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.

Potentially problematic release.


This version of bibtex-ruby might be problematic. Click here for more details.

data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ 2.1.1 / 2012-09-14
2
+ ==================
3
+
4
+ * Improved @comment and @preamble parsing (@JLimperg)
5
+
1
6
  2.1.0 / 2012-08-31
2
7
  ==================
3
8
 
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
@@ -20,7 +20,7 @@ module BibTeX
20
20
  module Version
21
21
  MAJOR = 2
22
22
  MINOR = 1
23
- PATCH = 0
23
+ PATCH = 1
24
24
  BUILD = nil
25
25
 
26
26
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.').freeze
@@ -292,4 +292,4 @@ module BibTeX
292
292
 
293
293
 
294
294
  end
295
- end
295
+ end
@@ -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(3, bib.data.length)
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)
@@ -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
@@ -14,15 +14,15 @@ module BibTeX
14
14
  end
15
15
 
16
16
  it 'parses all entries' do
17
- assert_equal 3, @bib.length
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
@@ -18,3 +18,8 @@
18
18
  year={2001},}
19
19
 
20
20
  @article{foo,}
21
+
22
+ @commentary{staudinger,
23
+ editor = {Staudinger, Julius von}
24
+ }
25
+
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.0
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-08-31 00:00:00.000000000 Z
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: &70168050368080 !ruby/object:Gem::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: *70168050368080
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: &70168050367300 !ruby/object:Gem::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: *70168050367300
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.10
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.