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 +4 -4
- data/features/sorting.feature +36 -0
- data/lib/jekyll/scholar/utilities.rb +4 -1
- data/lib/jekyll/scholar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a410135bb1dbc35398147338798d858ac0bce52
|
4
|
+
data.tar.gz: 187845c095db45a86a1e997047bc867d134e9609
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2eb494d21a698dc0a1ad040139231b42d18af57c37403b9e54c38457b7d3e71bf2d21b88867259b28a4dd564a388adca71ce1d651715d8dd1ecb2cdc514c86e
|
7
|
+
data.tar.gz: d78b4b72ff93b00afe8e9699e3bdf094caf8f58a2478d28d9112d587c68137a7bfc4f8988d4ae555a4923d2aba5c25d908a95679a3502267844bdbe0b8c81291
|
data/features/sorting.feature
CHANGED
@@ -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
|
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
|
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.
|
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-
|
11
|
+
date: 2015-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|