bibtex-ruby 3.0.0 → 3.0.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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 032d4eb545f4e0360cb12438d83c1177dd17af9a
4
- data.tar.gz: 2e855f8b6f4b23b67e0330cb4ffae8eea2476c08
3
+ metadata.gz: ae103a8c9230f10e182351e8c51e2d221d346bec
4
+ data.tar.gz: 81648119699714f234735ba3734bb317ab44786c
5
5
  SHA512:
6
- metadata.gz: 42bcd110dda57b116de19d63ad9e5ca336c0035bde9bad0818f7b0e06c3199e470b86288eb7b4d8bfaf2d1a01d0a7ce8c24d0a8c3728dcf510df2b776f86f2f0
7
- data.tar.gz: 7e4f01e424befdd4acec3685cbd3c87c3a1a6697574c93becadcece0433712be4a7dea645d5dc7593cbfa5cceef919161d50ee97d351f9a5392b3d79b4993294
6
+ metadata.gz: 1a5367f8a072bf8bd4bc941159d4741b221716c452f1c7feef319990c7c9cf5b20f0dacaa996673199e1b138ead4a406955f313f9b04c60d5e3a5267ebafbd2c
7
+ data.tar.gz: 7d1c9b931e9a42ee05e577fea66b193b9858feff69ab36337c2664c57219abf9e082869c5571a91426f8b1bc3999e14c1964b58c39da651e5af7a7a865d6056c
data/Gemfile CHANGED
@@ -32,7 +32,7 @@ end
32
32
 
33
33
  group :development do
34
34
  gem 'rake'
35
- gem 'racc'
35
+ gem 'racc', :platforms => [:mri_20, :mri_19]
36
36
  gem 'yard'
37
37
  gem 'iconv', :platforms => [:ruby_20]
38
38
  end
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ 3.0.1 / 2013-12-30
2
+ ==================
3
+
4
+ * Fixed sorting (@casutton)
5
+
1
6
  3.0.0 / 2013-11-11
2
7
  ==================
3
8
 
data/README.md CHANGED
@@ -97,14 +97,16 @@ Save a bibliography to a file:
97
97
 
98
98
  Compatibility
99
99
  -------------
100
- The BibTeX-Ruby gem has been developed and tested on Ruby 2.0 and 1.9; up to
101
- version 2.x BibTeX-Ruby also supports Ruby 1.8, but starting with version 3.0.0
102
- support 1.8 is not a priority anymore. It has
103
- been confirmed to work with JRuby, Rubinius, and REE, however, there have
104
- been repeated [issues](https://github.com/inukshuk/bibtex-ruby/issues)
100
+ The BibTeX-Ruby gem has been developed and tested on Ruby 2.x, 1.9.3, and 1.8;
101
+ it has been confirmed to work with JRuby, Rubinius, and REE, however, there
102
+ have been repeated [issues](https://github.com/inukshuk/bibtex-ruby/issues)
105
103
  (performance mostly) with MacRuby caused by MacRuby's current StringScanner
106
104
  implementation.
107
105
 
106
+ Starting with BibTeX-Ruby version 3.0, support for Ruby versions 1.9.2 and
107
+ earlier has been dropped; most features will likely continue to work, but
108
+ compliance with old Rubies is not a priority going forward.
109
+
108
110
 
109
111
  Documentation
110
112
  -------------
@@ -377,8 +377,13 @@ module BibTeX
377
377
  groups
378
378
  end
379
379
 
380
- def sort(*arguments, &block)
381
- data.sort(*arguments, &block)
380
+ def sort!(*arguments, &block)
381
+ data.sort!(*arguments, &block)
382
+ self
383
+ end
384
+
385
+ def sort_by!(*arguments, &block)
386
+ data.sort_by!(*arguments, &block)
382
387
  self
383
388
  end
384
389
 
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.4.9
3
+ # This file is automatically generated by Racc 1.4.10
4
4
  # from Racc grammer file "".
5
5
  #
6
6
 
data/lib/bibtex/parser.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.4.9
3
+ # This file is automatically generated by Racc 1.4.10
4
4
  # from Racc grammer file "".
5
5
  #
6
6
 
@@ -20,7 +20,7 @@ module BibTeX
20
20
  module Version
21
21
  MAJOR = 3
22
22
  MINOR = 0
23
- PATCH = 0
23
+ PATCH = 1
24
24
  BUILD = nil
25
25
 
26
26
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.').freeze
@@ -329,6 +329,60 @@ module BibTeX
329
329
 
330
330
  end
331
331
 
332
+ describe 'sorting' do
333
+
334
+ before do
335
+ @small_bib = BibTeX.parse <<-END
336
+ @book{flanagan2008,
337
+ title={{The ruby programming language}},
338
+ author={Flanagan, D. and Matsumoto, Y.},
339
+ keywords = {ruby},
340
+ year={2008},
341
+ publisher={O'Reilly}
342
+ }
343
+ @book{rails,
344
+ address = {Raleigh, North Carolina},
345
+ author = {Ruby, Sam, and Thomas, Dave, and Hansson Heinemeier, David},
346
+ booktitle = {Agile Web Development with Rails},
347
+ edition = {third},
348
+ keywords = {ruby, rails},
349
+ publisher = {The Pragmatic Bookshelf},
350
+ series = {The Facets of Ruby},
351
+ title = {Agile Web Development with Rails},
352
+ year = {2009}
353
+ }
354
+ @article{segaran2007,
355
+ title={{Programming collective intelligence}},
356
+ author={Segaran, T.},
357
+ year={2007},
358
+ publisher={O'Reilly}
359
+ }
360
+ END
361
+ end
362
+
363
+ it 'can be sorted destructively' do
364
+ @small_bib.sort!
365
+ @small_bib.map(&:key).must_equal [ 'segaran2007', 'flanagan2008', 'rails']
366
+ end
367
+
368
+ it 'can be sorted by field destructively' do
369
+ @small_bib.sort_by! { |e| -e[:year].to_i }
370
+ @small_bib.map(&:key).must_equal [ 'rails', 'flanagan2008', 'segaran2007' ]
371
+ end
372
+
373
+ it 'can be sorted non-destructively' do
374
+ sorted_entries = @small_bib.sort
375
+ sorted_entries.map(&:key).must_equal [ 'segaran2007', 'flanagan2008', 'rails']
376
+ @small_bib.map(&:key).must_equal [ 'flanagan2008', 'rails', 'segaran2007']
377
+ end
378
+
379
+ it 'can be sorted by field non-destructively' do
380
+ sorted_entries = @small_bib.sort_by { |e| -e[:year].to_i }
381
+ sorted_entries.map(&:key).must_equal [ 'rails', 'flanagan2008', 'segaran2007' ]
382
+ @small_bib.map(&:key).must_equal [ 'flanagan2008', 'rails', 'segaran2007']
383
+ end
384
+ end
385
+
332
386
  describe 'LaTeX filter' do
333
387
  before do
334
388
  @bib['rails'].keywords = 'r\\"uby'
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: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-11 00:00:00.000000000 Z
11
+ date: 2013-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: latex-decode
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.0.3
157
+ rubygems_version: 2.0.14
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: A BibTeX parser, converter and API for Ruby.