Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/github/pages-gem
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/github-pages/version.rb
  • Loading branch information
sskylar committed Aug 8, 2017
2 parents 4f64d2e + 6497c8e commit 69c2dbd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: ruby
rvm:
- 2.0
- 2.1
- 2.2
- 2.3.3
Expand Down
21 changes: 15 additions & 6 deletions lib/github-pages/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Configuration
# Default, user overwritable options
DEFAULTS = {
"jailed" => false,
"gems" => GitHubPages::Plugins::DEFAULT_PLUGINS,
"plugins" => GitHubPages::Plugins::DEFAULT_PLUGINS,
"future" => true,
"theme" => "jekyll-theme-primer",
"kramdown" => {
Expand Down Expand Up @@ -44,7 +44,6 @@ class Configuration
OVERRIDES = {
"lsi" => false,
"safe" => true,
"plugins" => SecureRandom.hex,
"plugins_dir" => SecureRandom.hex,
"whitelist" => GitHubPages::Plugins::PLUGIN_WHITELIST,
"highlighter" => "rouge",
Expand All @@ -63,7 +62,7 @@ class Configuration
# Jekyll::Site and need to be set properly when the config is updated.
CONFIGS_WITH_METHODS = %w(
safe lsi highlighter baseurl exclude include future unpublished
show_drafts limit_posts keep_files gems
show_drafts limit_posts keep_files
).freeze

class << self
Expand Down Expand Up @@ -105,9 +104,15 @@ def effective_config(user_config)
config = Jekyll::Utils.deep_merge_hashes config, OVERRIDES

# Ensure we have those gems we want.
config["gems"] = Array(config["gems"]) | DEFAULT_PLUGINS
config["whitelist"] = config["whitelist"] | config["gems"] if disable_whitelist?
config["whitelist"] = config["whitelist"] | DEVELOPMENT_PLUGINS if development?
config["plugins"] = Array(config["plugins"]) | DEFAULT_PLUGINS

if disable_whitelist?
config["whitelist"] = config["whitelist"] | config["plugins"]
end

if development?
config["whitelist"] = config["whitelist"] | DEVELOPMENT_PLUGINS
end

config
end
Expand Down Expand Up @@ -141,6 +146,10 @@ def set!(site)
CONFIGS_WITH_METHODS.each do |opt|
site.public_send("#{opt}=", site.config[opt])
end

# While Configuration renamed the gems key to plugins, Site retained
# backwards compatability and must be set manually
site.gems = site.config["plugins"]
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/github-pages/dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ module GitHubPages
class Dependencies
VERSIONS = {
# Jekyll
"jekyll" => "3.4.5",
"jekyll" => "3.5.1",
"jekyll-sass-converter" => "1.5.0",

# Converters
"kramdown" => "1.13.2",
"redcarpet" => "3.3.4",

# Misc
"liquid" => "3.0.6",
"liquid" => "4.0.0",
"rouge" => "1.11.1",
"github-pages-health-check" => "1.3.5",

# Plugins
"jekyll-redirect-from" => "0.12.1",
"jekyll-sitemap" => "1.0.0",
"jekyll-feed" => "0.9.2",
"jekyll-gist" => "1.4.0",
"jekyll-gist" => "1.4.1",
"jekyll-paginate" => "1.1.0",
"jekyll-coffeescript" => "1.0.1",
"jekyll-seo-tag" => "2.2.3",
Expand All @@ -37,7 +37,7 @@ class Dependencies
"jekyll-optional-front-matter" => "0.2.0",
"jekyll-readme-index" => "0.1.0",
"jekyll-default-layout" => "0.1.4",
"jekyll-titles-from-headings" => "0.2.0",
"jekyll-titles-from-headings" => "0.3.0",

# Pin listen because it's broken on 2.1 & that's what we recommend.
# https://github.com/guard/listen/pull/371
Expand Down
2 changes: 1 addition & 1 deletion lib/github-pages/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module GitHubPages
VERSION = 146
VERSION = 147
.to_s + '-siteleaf'.freeze
end
8 changes: 4 additions & 4 deletions spec/github-pages/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
end

it "sets default gems" do
expect(effective_config["gems"]).to include("jekyll-coffeescript")
expect(effective_config["plugins"]).to include("jekyll-coffeescript")
end

it "lets the user specify additional gems" do
expect(effective_config["gems"]).to include("jekyll-sitemap")
expect(effective_config["plugins"]).to include("jekyll-sitemap")
end

it "honors the user's config" do
Expand Down Expand Up @@ -84,11 +84,11 @@
end

it "sets default gems" do
expect(site.config["gems"]).to include("jekyll-coffeescript")
expect(site.config["plugins"]).to include("jekyll-coffeescript")
end

it "lets the user specify additional gems" do
expect(site.config["gems"]).to include("jekyll-sitemap")
expect(site.config["plugins"]).to include("jekyll-sitemap")
end

it "honors the user's config" do
Expand Down

0 comments on commit 69c2dbd

Please sign in to comment.