Skip to content

[wip] Upgrade to jekyll 3 and jekyll-assets 2 #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ build/
env

preparer-test-*
.asset-cache
83 changes: 19 additions & 64 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,116 +3,71 @@ PATH
specs:
preparermd (0.1.0)
faraday (= 0.9.1)
jekyll (= 2.5.3)
jekyll-assets (= 0.14.0)
jekyll (= 3.0.1)
jekyll-assets (= 2.0.1)
json (= 1.8.3)
therubyracer (= 0.12.2)
redcarpet (= 3.3.3)

GEM
remote: https://rubygems.org/
specs:
addressable (2.3.8)
blankslate (2.1.2.4)
classifier-reborn (2.0.3)
fast-stemmer (~> 1.0)
coderay (1.1.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.9.1.1)
colorator (0.1)
execjs (2.6.0)
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
fast-stemmer (1.0.2)
fastimage (1.7.0)
fastimage (1.8.0)
addressable (~> 2.3, >= 2.3.5)
ffi (1.9.10)
hashdiff (0.2.3)
hike (1.2.3)
jekyll (2.5.3)
classifier-reborn (~> 2.0)
jekyll (3.0.1)
colorator (~> 0.1)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 2.6.1)
liquid (~> 3.0)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
rouge (~> 1.7)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-assets (0.14.0)
fastimage (~> 1.6)
jekyll (~> 2.0)
mini_magick (~> 4.1)
sass (~> 3.2)
sprockets (~> 2.10)
sprockets-helpers
sprockets-sass
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-gist (1.3.4)
jekyll-paginate (1.1.0)
jekyll-assets (2.0.1)
fastimage (~> 1.8)
jekyll (~> 3.0)
sprockets (~> 3.3)
sprockets-helpers (~> 1.2)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-watch (1.3.0)
listen (~> 3.0)
json (1.8.3)
kramdown (1.8.0)
libv8 (3.16.14.11)
liquid (2.6.3)
listen (3.0.3)
kramdown (1.9.0)
liquid (3.0.6)
listen (3.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.5)
method_source (0.8.2)
mini_magick (4.3.3)
multi_json (1.11.2)
multipart-post (2.0.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.11)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pygments.rb (0.6.3)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.2.0)
rack (1.6.4)
rake (10.4.2)
rb-fsevent (0.9.6)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redcarpet (3.3.3)
ref (2.0.0)
rouge (1.10.1)
safe_yaml (1.0.4)
sass (3.4.18)
sass (3.4.19)
slop (3.6.0)
sprockets (2.12.4)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets (3.4.0)
rack (> 1, < 3)
sprockets-helpers (1.2.1)
sprockets (>= 2.2)
sprockets-sass (1.3.1)
sprockets (~> 2.0)
tilt (~> 1.1)
term-ansicolor (1.3.2)
tins (~> 1.0)
therubyracer (0.12.2)
libv8 (~> 3.16.14.0)
ref
tilt (1.4.1)
tins (1.7.0)
toml (0.1.2)
parslet (~> 1.5.0)
yajl-ruby (1.2.1)

PLATFORMS
ruby
Expand Down
4 changes: 2 additions & 2 deletions lib/preparermd/overrides/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'faraday'
require 'sprockets'
require 'jekyll/assets_plugin/environment'
require 'jekyll/assets/env'

# Module to be mixed in to each uploaded Asset to ensure that the correct URLs are generated.
#
Expand Down Expand Up @@ -75,7 +75,7 @@ def build_asset(path, pathname, options)

# Custom Sprockets Environment subclass that uses our injected Index subclass.
#
class Environment < Jekyll::AssetsPlugin::Environment
class Env < Jekyll::Assets::Env
def index
Index.new(self)
end
Expand Down
6 changes: 3 additions & 3 deletions preparermd.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 1.9"
spec.add_development_dependency "rake", "~> 10.0"

spec.add_runtime_dependency "jekyll", "2.5.3"
spec.add_runtime_dependency "jekyll", "3.0.1"
spec.add_runtime_dependency "faraday", "0.9.1"
spec.add_runtime_dependency "jekyll-assets", "0.14.0"
spec.add_runtime_dependency "therubyracer", "0.12.2"
spec.add_runtime_dependency "jekyll-assets", "2.0.1"
spec.add_runtime_dependency "redcarpet", "3.3.3"
spec.add_runtime_dependency "json", "1.8.3"
end
5 changes: 4 additions & 1 deletion test/all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def asset_set_from dir
return assets unless File.exists?(base) && File.directory?(base)

Find.find(base) do |path|
next if path == base
assets << path[base.size..-1]
end
assets.sort
Expand All @@ -121,7 +122,7 @@ def report

case @outcome
when :fail
header, diff = true, true
header, output, diff = true, true, true
when :error
header, output, stacktrace = true, true, true
end
Expand Down Expand Up @@ -182,3 +183,5 @@ def self.all
end

puts testcases.map { |t| t.report }.join("\n")

exit 1 unless testcases.all? { |t| t.outcome == :ok }
3 changes: 0 additions & 3 deletions test/envelopes/src/_deconst.json

This file was deleted.

Binary file added test/image-asset/dest/assets/wheatley-icon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/image-asset/dest/image-asset-base%2Fasset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"title":null,"body":"<p>This document contains a reference to an <a href=\"/assets/wheatley-icon.jpg\">asset</a>.</p>\n","categories":[],"meta":{"layout":null},"tags":[]}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
3 changes: 3 additions & 0 deletions test/image-asset/src/_deconst.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"contentIDBase": "image-asset-base"
}
4 changes: 4 additions & 0 deletions test/image-asset/src/asset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

This document contains a reference to an [asset]({% asset_path wheatley-icon %}).
9 changes: 9 additions & 0 deletions test/maximum-envelope/src/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Site settings
title: The site title
description: The site description

# Build settings
markdown: redcarpet
encoding: UTF-8
redcarpet:
extensions: ["with_toc_data"]
3 changes: 3 additions & 0 deletions test/maximum-envelope/src/_deconst.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"contentIDBase": "maximum-base"
}
File renamed without changes.
9 changes: 9 additions & 0 deletions test/minimum-envelope/src/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Site settings
title: The site title
description: The site description

# Build settings
markdown: redcarpet
encoding: UTF-8
redcarpet:
extensions: ["with_toc_data"]
3 changes: 3 additions & 0 deletions test/minimum-envelope/src/_deconst.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"contentIDBase": "minimal-base"
}
File renamed without changes.