jekyll-scholar 5.8.2 → 5.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90dcebb42bbaea9a1c38409bf3ea692140b71a3a
4
- data.tar.gz: 9d1acbf5ea85649e7b66ff78ce16dad1705ae859
3
+ metadata.gz: e0336aad197d9d6702e21a3ccf73e4b5e94f07e9
4
+ data.tar.gz: 8bf2a171a6fe4c213b6610f2a826c8682f5b6e3c
5
5
  SHA512:
6
- metadata.gz: 3a29f85b19f3e733e80052a4c9012cfc4acafbf30ca446eb283c893309a76e50242e6ce068eab262ff07794531c4d11d171857b05bc6ef8168dd6c3403319d57
7
- data.tar.gz: 074ef9f7336b289abd5c2a23199fddd8375fe2fd5d958cc2d77a078a99414addf47be33fa8a4edc3158407d83ea858bd079357651613c5db7b2e02bb3d98b317
6
+ metadata.gz: 8750a1a6e6bb4491ebb35936d00087e8c63577661a82673ef511f036d9d6a4f63b3b8615972620f3cc758e420a69afadf1e92a2fdcf0636076df4da3da67fb85
7
+ data.tar.gz: fad576cbbebed7780fcdd5b3b3cb4dd91d0f1f73465eeba84467b31356451810165b8dd34dcf7aa2affce91638ec7514189fcb9f7db5c7070f4ee7591dcb2c9d
data/.travis.yml CHANGED
@@ -1,20 +1,29 @@
1
1
  language: ruby
2
- bundler_args: --without debug
3
- script: bundle exec rake test_with_coveralls
4
2
  sudo: false
5
3
  cache: bundler
6
- rvm:
7
- - 2.3.0
8
- - 2.2.0
9
- - 2.1.0
10
- - 2.0.0
11
- - rbx-2
4
+ matrix:
5
+ include:
6
+ - rvm: 2.3.1
7
+ env: WITH_COVERALLS=true
8
+ - rvm: 2.1
9
+ env: WITH_COVERALLS=false
10
+ - rvm: 2.0
11
+ env: WITH_COVERALLS=false
12
+ install:
13
+ - if [[ $WITH_COVERALLS = "true" ]]; then
14
+ bundle install --without debug extra;
15
+ else
16
+ bundle install --without debug extra coverage;
17
+ fi
18
+ script:
19
+ - if [[ $WITH_COVERALLS = "true" ]]; then
20
+ bundle exec rake test_with_coveralls;
21
+ else
22
+ bundle exec rake;
23
+ fi
12
24
  notifications:
13
25
  email:
14
26
  recipients:
15
27
  - sylvester@keil.or.at
16
28
  on_success: change
17
- on_failure: always
18
- matrix:
19
- allow_failures:
20
- - rvm: rbx-2
29
+ on_failure: change
data/Gemfile CHANGED
@@ -2,12 +2,10 @@ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :development do
5
-
6
- if RUBY_VERSION >= '2.2'
5
+ if RUBY_VERSION >= '2.2.2'
7
6
  gem 'test-unit'
8
7
  else
9
8
  gem 'minitest', '< 5.0'
10
- gem 'listen', '~>3.0.0'
11
9
  end
12
10
 
13
11
  gem 'rake'
@@ -17,7 +15,13 @@ group :development do
17
15
  gem 'redcarpet'
18
16
 
19
17
  gem 'unicode_utils'
18
+ end
19
+
20
+ group :extra do
21
+ gem 'listen', '~>3.0.0'
22
+ end
20
23
 
24
+ group :coverage do
21
25
  gem 'simplecov', '~>0.9', :require => false
22
26
  gem 'rubinius-coverage', :platform => :rbx
23
27
  gem 'coveralls', :require => false
data/Rakefile CHANGED
@@ -15,9 +15,13 @@ Cucumber::Rake::Task.new(:features)
15
15
 
16
16
  task :default => [:features]
17
17
 
18
- require 'coveralls/rake/task'
19
- Coveralls::RakeTask.new
20
- task :test_with_coveralls => [:features, 'coveralls:push']
18
+ begin
19
+ require 'coveralls/rake/task'
20
+ Coveralls::RakeTask.new
21
+ task :test_with_coveralls => [:features, 'coveralls:push']
22
+ rescue LoadError => e
23
+ # ignore
24
+ end
21
25
 
22
26
  task :release do |t|
23
27
  system "gem build jekyll-scholar.gemspec"
@@ -368,4 +368,4 @@ Feature: BibTeX
368
368
  When I run jekyll
369
369
  Then the _site directory should exist
370
370
  And the "_site/scholar.html" file should exist
371
- And I should see "{%raw%}@book" in "_site/scholar.html"
371
+ And I should not see "{%[\w*]raw[\w*]%}" in "_site/scholar.html"
@@ -107,6 +107,53 @@ Feature: Details
107
107
  And I should see "Page title: An Umlaut \\\"a!" in "_site/bibliography/ruby.html"
108
108
  And I should see "Title: An Umlaut \\\"a!" in "_site/bibliography/ruby.html"
109
109
  And I should see "title = {An Umlaut \\\"a!}" in "_site/bibliography/ruby.html"
110
+
111
+
112
+ @generators
113
+ Scenario: Raw input can be turned on, but should not generate any {%raw%} tags on the details page, and also not parse the liquid tags inside the bibtex
114
+ Given I have a scholar configuration with:
115
+ | key | value |
116
+ | source | ./_bibliography |
117
+ | details_layout | details.html |
118
+ | bibtex_filters | |
119
+ | use_raw_bibtex_entry | true |
120
+ And I have a "_bibliography" directory
121
+ And I have a file "_bibliography/references.bib":
122
+ """
123
+ @book{sdf,
124
+ title = {{SDF^3}}
125
+ }
126
+ """
127
+ And I have a file "bibliography.html":
128
+ """
129
+ ---
130
+ ---
131
+ <html>
132
+ <head></head>
133
+ <body>
134
+ {%bibliography%}
135
+ </body>
136
+ </html>
137
+ """
138
+ And I have a "_layouts" directory
139
+ And I have a file "_layouts/details.html":
140
+ """
141
+ ---
142
+ ---
143
+ <html>
144
+ <head></head>
145
+ <body>
146
+ Page title: {{ page.title }}
147
+ Title: {{ page.entry.title }}
148
+ {{ page.entry.bibtex }}
149
+ </body>
150
+ </html>
151
+ """
152
+ When I run jekyll
153
+ Then the _site directory should exist
154
+ And the "_site/bibliography/sdf.html" file should exist
155
+ And I should not see "{%raw%}" in "_site/bibliography/sdf.html"
156
+ And I should see "SDF\^3" in "_site/bibliography/sdf.html"
110
157
 
111
158
  @tags @details
112
159
  Scenario: Links to Detail Pages are Generated Automatically
@@ -242,3 +289,32 @@ Feature: Details
242
289
  Then the _site directory should exist
243
290
  And the "_site/bibliography/august.html" file should exist
244
291
  And I should see "month = {August}" in "_site/bibliography/august.html"
292
+
293
+ @tags @details
294
+ Scenario: No details
295
+ Given I have a scholar configuration with:
296
+ | key | value |
297
+ | source | ./_bibliography |
298
+ | bibliogaphy | references |
299
+ And I have a "_bibliography" directory
300
+ And I have a file "_bibliography/references.bib":
301
+ """
302
+ @book{ruby,
303
+ title = {The Ruby Programming Language},
304
+ author = {Flanagan, David and Matsumoto, Yukihiro},
305
+ year = {2008},
306
+ publisher = {O'Reilly Media}
307
+ }
308
+ """
309
+ And I have a "_layouts" directory
310
+ And I have a page "scholar.html":
311
+ """
312
+ ---
313
+ ---
314
+ {% bibliography %}
315
+ """
316
+ When I run jekyll
317
+ Then the _site directory should exist
318
+ And the "_site/scholar.html" file should exist
319
+ And the "_site/bibliography/ruby.html" file should not exist
320
+ And I should not see "<a[^>]+href=\"/bibliography/ruby.html\">" in "_site/scholar.html"
@@ -32,7 +32,7 @@ def prepend_test_dir(options, key)
32
32
  end
33
33
 
34
34
  def run_jekyll(options = {})
35
-
35
+
36
36
  options = Jekyll.configuration(options)
37
37
 
38
38
  prepend_test_dir(options, 'source')
@@ -455,8 +455,8 @@ module Jekyll
455
455
 
456
456
  def bibliography_tag(entry, index)
457
457
  return missing_reference unless entry
458
-
459
- liquid_template.render(
458
+
459
+ tmp = liquid_template.render(
460
460
  reference_data(entry,index)
461
461
  .merge(site.site_payload)
462
462
  .merge({
@@ -468,6 +468,15 @@ module Jekyll
468
468
  :filters => [Jekyll::Filters]
469
469
  }
470
470
  )
471
+ # process the generated reference with Liquid, to get the same behaviour as
472
+ # when it is used on a page
473
+ Liquid::Template.parse(tmp).render(
474
+ site.site_payload,
475
+ {
476
+ :registers => { :site => site },
477
+ :filters => [Jekyll::Filters]
478
+ }
479
+ )
471
480
  end
472
481
 
473
482
  def reference_data(entry, index = nil)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '5.8.2'.freeze
3
+ VERSION = '5.8.3'.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: 5.8.2
4
+ version: 5.8.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: 2016-05-27 00:00:00.000000000 Z
11
+ date: 2016-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -162,4 +162,3 @@ test_files:
162
162
  - features/string.feature
163
163
  - features/support/env.rb
164
164
  - features/support/hooks.rb
165
- has_rdoc: