jekyll-scholar 4.2.1 → 4.2.2

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: 07a8a2fd3f3695fae59cf4570cee99a52e053bb7
4
- data.tar.gz: d44d4e4d1570d3753017660674c6d7a9cf2d02a6
3
+ metadata.gz: c16bae70f0ffc07f1992663a2701df9cd583ef2a
4
+ data.tar.gz: 72b599b29cd812aed688cb27b26690544b87eab1
5
5
  SHA512:
6
- metadata.gz: c343d40bc0ab7998529ce5cfc586b0fffe9e31790d14d6578c1e863f081df26b2ceebf7dade23d1d0a892e3ad1cdbe11ad55677bc05879c7f6a036f9c3157fa0
7
- data.tar.gz: 0fad5c9a6997abafafe708cefa4895fe01552c107913c79dc0ad78c10fb4d236e03bfef86b7ccbe7da9a490456861785f65c52d554c15a4020104712ac62490f
6
+ metadata.gz: c991da6b828bcb8951cbe61d089493d3306ac4fc3af57223f3dedd71bf507d09b773f666ffef45adcd2de9bba484d094962941ba81beb48eb500afab9093e683
7
+ data.tar.gz: e4f167a232610483e7886194c4d81db146d3c2b2e88a3ca0e70208981f17a10b006bbbd684a2647bc865ac853cb0ce229d608784f9eebeb5a33041a91c8041a2
data/.travis.yml CHANGED
@@ -1,7 +1,10 @@
1
1
  language: ruby
2
2
  bundler_args: --without debug
3
3
  script: bundle exec rake test_with_coveralls
4
+ sudo: false
5
+ cache: bundler
4
6
  rvm:
7
+ - 2.2.0
5
8
  - 2.1.0
6
9
  - 2.0.0
7
10
  - 1.9.3
@@ -12,3 +15,6 @@ notifications:
12
15
  - sylvester@keil.or.at
13
16
  on_success: change
14
17
  on_failure: always
18
+ matrix:
19
+ allow_failures:
20
+ - rvm: rbx-2
data/Gemfile CHANGED
@@ -2,24 +2,30 @@ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :development do
5
- gem 'minitest', '< 5.0'
5
+
6
+ if RUBY_VERSION.start_with?('2.2')
7
+ gem 'test-unit'
8
+ else
9
+ gem 'minitest', '< 5.0'
10
+ end
11
+
6
12
  gem 'rake'
7
13
  gem 'redgreen', '~> 1.2'
8
14
  gem 'shoulda', '~> 3.5'
9
15
  gem 'rr', '~> 1.1'
10
16
  gem 'cucumber', '1.3.11'
11
- gem 'redcarpet', '~> 3.1'
12
- gem 'launchy', '~> 2.1.2'
17
+ gem 'redcarpet'
18
+ gem 'launchy', '~> 2.3'
13
19
 
14
20
  gem 'unicode_utils'
15
21
 
16
- gem 'simplecov', '~>0.8', :require => false
22
+ gem 'simplecov', '~>0.9', :require => false
17
23
  gem 'rubinius-coverage', :platform => :rbx
18
24
  gem 'coveralls', :require => false
19
25
  end
20
26
 
21
27
  group :debug do
22
- gem 'debugger', '~>1.6', :require => false, :platform => :mri
28
+ gem 'debugger', '~>1.6', :require => false, :platform => [:mri_19, :mri_20]
23
29
  gem 'rubinius-compiler', '~>2.0', :require => false, :platform => :rbx
24
30
  gem 'rubinius-debugger', '~>2.0', :require => false, :platform => :rbx
25
31
  end
data/README.md CHANGED
@@ -200,10 +200,10 @@ would be a more complex template file:
200
200
  {{ reference }}
201
201
 
202
202
  {% if entry.abstract %}
203
- <p>{{ entry.abstract %}</p>
203
+ <p>{{ entry.abstract }}</p>
204
204
  {% endif %}
205
205
 
206
- <pre>{{ entry.bibtex %}</pre>
206
+ <pre>{{ entry.bibtex }}</pre>
207
207
 
208
208
  You can also override the default bibliography template, by passing the
209
209
  `--template` or `-T` option parameter to the bibliography tag.
@@ -190,3 +190,39 @@ Feature: Sorting BibTeX Bibliographies
190
190
  And the "_site/scholar.html" file should exist
191
191
  Then "Ruby Programming" should come before "Smalltalk" in "_site/scholar.html"
192
192
  And I should not see "<i>Ruby Not Cited</i>" in "_site/scholar.html"
193
+
194
+ @tags @sorting
195
+ Scenario: Sort By Year And Month
196
+ Given I have a scholar configuration with:
197
+ | key | value |
198
+ | sort_by | year, month |
199
+ And I have a "_bibliography" directory
200
+ And I have a file "_bibliography/references.bib":
201
+ """
202
+ @book{ruby1,
203
+ title = {December 08},
204
+ year = {2008},
205
+ month = dec
206
+ }
207
+ @book{ruby2,
208
+ title = {March 08},
209
+ year = {2008},
210
+ month = mar
211
+ }
212
+ @book{ruby3,
213
+ title = {August 07},
214
+ year = {2007},
215
+ month = aug
216
+ }
217
+ """
218
+ And I have a page "scholar.html":
219
+ """
220
+ ---
221
+ ---
222
+ {% bibliography %}
223
+ """
224
+ When I run jekyll
225
+ Then the _site directory should exist
226
+ And the "_site/scholar.html" file should exist
227
+ Then "August 07" should come before "March 08" in "_site/scholar.html"
228
+ And "March 08" should come before "December 08" in "_site/scholar.html"
@@ -16,10 +16,6 @@ require 'test/unit'
16
16
 
17
17
  require 'jekyll/scholar'
18
18
 
19
- World do
20
- include Test::Unit::Assertions
21
- end
22
-
23
19
  TEST_DIR = File.join('/', 'tmp', 'jekyll')
24
20
 
25
21
  def run_jekyll(options = {})
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.add_runtime_dependency('jekyll', '~> 2.0')
29
29
  s.add_runtime_dependency('citeproc-ruby', '~> 1.0')
30
30
  s.add_runtime_dependency('csl-styles', '~> 1.0')
31
- s.add_runtime_dependency('bibtex-ruby', '~> 4.0')
31
+ s.add_runtime_dependency('bibtex-ruby', '>= 4.0.8')
32
32
 
33
33
  s.files = `git ls-files`.split("\n")
34
34
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -13,7 +13,7 @@ module Jekyll
13
13
  'bibliography' => 'references.bib',
14
14
  'repository' => nil,
15
15
 
16
- 'bibtex_options' => { :strip => false },
16
+ 'bibtex_options' => { :strip => false, :parse_months => true },
17
17
  'bibtex_filters' => [ :latex ],
18
18
 
19
19
  'replace_strings' => true,
@@ -141,11 +141,20 @@ module Jekyll
141
141
  def sort(unsorted)
142
142
  return unsorted if skip_sort?
143
143
 
144
- sorted = unsorted.sort_by { |e| e[config['sort_by']].to_s }
144
+ sorted = unsorted.sort_by { |e| e.values_at(*sort_keys).map(&:v) }
145
145
  sorted.reverse! if config['order'] =~ /^(desc|reverse)/i
146
146
  sorted
147
147
  end
148
148
 
149
+ def sort_keys
150
+ return @sort_keys unless @sort_keys.nil?
151
+
152
+ @sort_keys = Array(config['sort_by'])
153
+ .map { |key| key.to_s.split(/\s*,\s*/) }
154
+ .flatten
155
+ .map { |key| key == 'month' ? 'month_numeric' : key }
156
+ end
157
+
149
158
  def suppress_author?
150
159
  !!@suppress_author
151
160
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '4.2.1'.freeze
3
+ VERSION = '4.2.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,84 +1,84 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-scholar
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
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-11-17 00:00:00.000000000 Z
11
+ date: 2015-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: citeproc-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: csl-styles
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bibtex-ruby
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '4.0'
61
+ version: 4.0.8
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '4.0'
69
- description: ' Jekyll-Scholar is for all the academic bloggers out there. It is a
68
+ version: 4.0.8
69
+ description: " Jekyll-Scholar is for all the academic bloggers out there. It is a
70
70
  set of extensions for Jekyll the awesome, blog aware, static site generator; it
71
71
  formats your BibTeX bibliographies for the web using CSL citation styles and generally
72
- gives your blog posts citation super-powers.'' '
72
+ gives your blog posts citation super-powers.' "
73
73
  email: http://sylvester.keil.or.at
74
74
  executables: []
75
75
  extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
- - .coveralls.yml
79
- - .gitignore
80
- - .simplecov
81
- - .travis.yml
78
+ - ".coveralls.yml"
79
+ - ".gitignore"
80
+ - ".simplecov"
81
+ - ".travis.yml"
82
82
  - Gemfile
83
83
  - LICENSE
84
84
  - README.md
@@ -122,17 +122,17 @@ require_paths:
122
122
  - lib
123
123
  required_ruby_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - '>='
125
+ - - ">="
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - '>='
130
+ - - ">="
131
131
  - !ruby/object:Gem::Version
132
132
  version: 1.3.6
133
133
  requirements: []
134
134
  rubyforge_project: jekyll-scholar
135
- rubygems_version: 2.1.8
135
+ rubygems_version: 2.2.2
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: Jekyll extensions for the academic blogger.
@@ -152,4 +152,3 @@ test_files:
152
152
  - features/string.feature
153
153
  - features/support/env.rb
154
154
  - features/support/hooks.rb
155
- has_rdoc: