diff --git a/.gitignore b/.gitignore index 2cc4d76..bbde1a5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ Gemfile.lock test/destination .bundle pkg/ +.jekyll-metadata diff --git a/.travis.yml b/.travis.yml index a53da09..312fd15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,20 @@ +language: ruby +script : script/cibuild +sudo: false + rvm: -- 2.1 -- 2.0 -- 1.9.3 + - 2.2 + - 2.1 + - 2.0 +env: + - "" + - JEKYLL_VERSION=3.0.0.beta8 + - JEKYLL_VERSION=2.0 +matrix: + include: + - # GitHub Pages + rvm: 2.1.1 + env: GH_PAGES=true + - # Ruby 1.9 + rvm: 1.9 + env: JEKYLL_VERSION=2.0 diff --git a/Gemfile b/Gemfile index 851fabc..4296d7f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,8 @@ source 'https://rubygems.org' gemspec + +if ENV["GH_PAGES"] + gem "github-pages" +elsif ENV["JEKYLL_VERSION"] + gem "jekyll", "~> #{ENV["JEKYLL_VERSION"]}" +end diff --git a/lib/jekyll-archives.rb b/lib/jekyll-archives.rb index 63a1a7e..15eddc1 100644 --- a/lib/jekyll-archives.rb +++ b/lib/jekyll-archives.rb @@ -6,6 +6,14 @@ module Archives autoload :Archive, 'jekyll-archives/archive' autoload :VERSION, 'jekyll-archives/version' + if (Jekyll.const_defined? :Hooks) + Jekyll::Hooks.register :site, :after_reset do |site| + # We need to disable incremental regen for Archives to generate with the + # correct content + site.regenerator.instance_variable_set(:@disabled, true) + end + end + class Archives < Jekyll::Generator safe true diff --git a/script/cibuild b/script/cibuild index 972b7e5..a2f83b0 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,3 +1,4 @@ #! /bin/sh +set -e bundle exec rake test