bibtex-ruby 4.0.2 → 4.0.3

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a428ad531c0d99dcd0b59768129faf638c07f353
4
- data.tar.gz: 61aacb13595a21341a3e54700229baf2f237fecb
3
+ metadata.gz: 9de82cd417f354a88a91476f719c5e74d7a50770
4
+ data.tar.gz: 169a387d3f991820f7acd9b12f56d8419e4cd624
5
5
  SHA512:
6
- metadata.gz: 6796f7a764624ed9895f6d99b72815610e21643f09f60b24b7c6f87ac0dff3f77918d3d8690eac67ddaac8d0846dd996f0769d92d75410162d6e284da94249b4
7
- data.tar.gz: 87c7f23607942368211c3040678b121c42570cc77ae98c1d52d682ed96e29d67c44d4128e85ec38eb76ad633f8071613f69112b396921d3471bc1b2099f16397
6
+ metadata.gz: 4ae3525c8dc076d32f4bad9283dfb8a813ff182419ad98af8499057bfd5b4c2d5a42595977972ae862c8a5ad272d75e9981d186f5de16829e9faccbf8d5ccb00
7
+ data.tar.gz: dba0dc62e3b76afe70c0afe4adea9f32a6a772df365e32c21e581aa9cfcb954a78b6f114bea0df7040f37e9c152624614419a1c0f8b2df2df105b099e34f36e4
data/lib/bibtex/entry.rb CHANGED
@@ -660,7 +660,7 @@ module BibTeX
660
660
  k = k.respond_to?(:family) ? k.family : k.to_s
661
661
  k = BibTeX.transliterate(k).gsub(/["']/, '')
662
662
  k = k[/[A-Za-z-]+/] || 'unknown'
663
- k << (year || '-')
663
+ k << (year.to_s[/\d+/] || '-')
664
664
  k << 'a'
665
665
  k.downcase!
666
666
  k
@@ -20,7 +20,7 @@ module BibTeX
20
20
  module Version
21
21
  MAJOR = 4
22
22
  MINOR = 0
23
- PATCH = 2
23
+ PATCH = 3
24
24
  BUILD = nil
25
25
 
26
26
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.').freeze
@@ -531,6 +531,8 @@ module BibTeX
531
531
  @e2 = Entry.new(:bibtex_type => 'book', :title => 'The Raven', :editor => 'John Hopkins', :year => 1996)
532
532
  @e3 = Entry.new(:bibtex_type => 'book', :author => 'Poe, Edgar A.', :title => 'The Raven', :editor => 'John Hopkins')
533
533
  @e4 = Entry.new(:bibtex_type => 'book', :author => 'Poe, Edgar A.', :title => 'The Raven', :editor => 'John Hopkins', :date => '2003-09')
534
+ @e5 = Entry.new(:bibtex_type => 'book', :author => 'Poe, Edgar A.', :title => 'The Raven', :editor => 'John Hopkins', :year => 'n.d.')
535
+ @e6 = Entry.new(:bibtex_type => 'book', :author => 'Poe, Edgar A.', :title => 'The Raven', :editor => 'John Hopkins', :year => '[2009]')
534
536
  }
535
537
 
536
538
  it 'should return "unknown-a" for an empty Entry' do
@@ -553,9 +555,17 @@ module BibTeX
553
555
  @e3.key.must_be :==, 'poe-a'
554
556
  end
555
557
 
558
+ it 'skips the year if not numeric' do
559
+ @e5.key.must_be :==, 'poe-a'
560
+ end
561
+
556
562
  it 'extracts the year from the date field if present' do
557
563
  @e4.key.must_be :==, 'poe2003a'
558
564
  end
565
+
566
+ it 'extracts the year from as a number' do
567
+ @e6.key.must_be :==, 'poe2009a'
568
+ end
559
569
  end
560
570
 
561
571
  describe 'when the entry is added to a Bibliography' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibtex-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-10 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: latex-decode