jekyll-scholar 4.3.0 → 4.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad49dc1f14b334b5134f49d75a24e73d50a79357
4
- data.tar.gz: d2b68d9a318ca228950d0ea661890bbe68a2931a
3
+ metadata.gz: 2a410135bb1dbc35398147338798d858ac0bce52
4
+ data.tar.gz: 187845c095db45a86a1e997047bc867d134e9609
5
5
  SHA512:
6
- metadata.gz: 8f76af59894107593462a73be48c13be140d1d5c74a221a598a8f130c26bb04eb01715bae58895263db5b152e47706117d9839e855a3bd53e031921ad260ee21
7
- data.tar.gz: 81b501fa00aee559d13455091d272cd769ac66da2c400ff2f52383481070b4cfca159e5f0055a70d8b54b9aa2afbe47e409b22410bb5c999b172a1be09029030
6
+ metadata.gz: e2eb494d21a698dc0a1ad040139231b42d18af57c37403b9e54c38457b7d3e71bf2d21b88867259b28a4dd564a388adca71ce1d651715d8dd1ecb2cdc514c86e
7
+ data.tar.gz: d78b4b72ff93b00afe8e9699e3bdf094caf8f58a2478d28d9112d587c68137a7bfc4f8988d4ae555a4923d2aba5c25d908a95679a3502267844bdbe0b8c81291
@@ -34,6 +34,42 @@ Feature: Sorting BibTeX Bibliographies
34
34
  And the "_site/scholar.html" file should exist
35
35
  Then "2007" should come before "2008" in "_site/scholar.html"
36
36
 
37
+ @tags @sorting
38
+ Scenario: Sort By Year With Nil Values
39
+ Given I have a scholar configuration with:
40
+ | key | value |
41
+ | sort_by | year |
42
+ And I have a "_bibliography" directory
43
+ And I have a file "_bibliography/references.bib":
44
+ """
45
+ @book{ruby1,
46
+ title = {The Ruby Programming Language},
47
+ author = {Flanagan, David and Matsumoto, Yukihiro},
48
+ year = {2008},
49
+ publisher = {O'Reilly Media}
50
+ }
51
+ @book{ruby2,
52
+ title = {Nil}
53
+ }
54
+ @book{ruby3,
55
+ title = {The Ruby Programming Language},
56
+ author = {Flanagan, David and Matsumoto, Yukihiro},
57
+ year = {2007},
58
+ publisher = {O'Reilly Media}
59
+ }
60
+ """
61
+ And I have a page "scholar.html":
62
+ """
63
+ ---
64
+ ---
65
+ {% bibliography -f references %}
66
+ """
67
+ When I run jekyll
68
+ Then the _site directory should exist
69
+ And the "_site/scholar.html" file should exist
70
+ Then "Nil" should come before "Ruby" in "_site/scholar.html"
71
+ And "2007" should come before "2008" in "_site/scholar.html"
72
+
37
73
  @tags @sorting
38
74
  Scenario: Reverse Sort Order
39
75
  Given I have a scholar configuration with:
@@ -141,7 +141,10 @@ module Jekyll
141
141
  def sort(unsorted)
142
142
  return unsorted if skip_sort?
143
143
 
144
- sorted = unsorted.sort_by { |e| e.values_at(*sort_keys) }
144
+ sorted = unsorted.sort_by do |e|
145
+ e.values_at(*sort_keys).map { |v| v.nil? ? BibTeX::Value.new : v }
146
+ end
147
+
145
148
  sorted.reverse! if config['order'] =~ /^(desc|reverse)/i
146
149
  sorted
147
150
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '4.3.0'.freeze
3
+ VERSION = '4.3.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-scholar
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.3.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: 2015-01-20 00:00:00.000000000 Z
11
+ date: 2015-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll