diff --git a/.gitignore b/.gitignore index 4a40504..603fcd8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /*.gem /.bundle/ -/Gemfile.lock -/node_modules/ +/test/fixture/site/.jekyll-cache/ /test/fixture/site/_site/ +/vendor/ diff --git a/.travis.yml b/.travis.yml index 1591ffa..bf5acaf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,13 @@ rvm: - 2.5.7 - 2.6.5 - 2.7.0 +gemfile: + - Gemfile-jekyll3 + - Gemfile-jekyll4 +jobs: + exclude: + - rvm: 2.3.8 + gemfile: Gemfile-jekyll4 before_install: - "echo 'gem: --no-document' > ~/.gemrc" - gem update bundler diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..2036174 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,32 @@ +# Development + +Use [Bundler] to install project dependencies. Because we support Jekyll +versions 3 and 4, we have separate [Gemfiles][BundlerGemfile] for +installing dependencies: + +* [Gemfile-jekyll3](Gemfile-jekyll3) for Jekyll 3 +* [Gemfile-jekyll3](Gemfile-jekyll4) for Jekyll 4 + +Install dependencies for the selected Gemfile: + +``` shell +BUNDLE_GEMFILE=Gemfile-jekyll4 bundle install +``` + +Use the [Rakefile](Rakefile) to run common tasks. To see the tasks +available: + +``` shell +BUNDLE_GEMFILE=Gemfile-jekyll4 bundle exec rake -D +``` + +Run linter ([Rubocop]) and tests: + +``` shell +BUNDLE_GEMFILE=Gemfile-jekyll4 bundle exec rake +``` + +[BundlerGemfile]: https://bundler.io/v2.0/man/gemfile.5.html +[Bundler]: https://bundler.io/ +[Jekyll]: https://jekyllrb.com/ +[Rubocop]: https://docs.rubocop.org/en/stable/ diff --git a/Gemfile b/Gemfile-jekyll3 similarity index 56% rename from Gemfile rename to Gemfile-jekyll3 index ffb69a5..73da698 100644 --- a/Gemfile +++ b/Gemfile-jekyll3 @@ -1,4 +1,9 @@ # frozen_string_literal: true source 'https://rubygems.org/' + gemspec + +group :development do + gem 'jekyll', '~> 3.0' +end diff --git a/Gemfile-jekyll3.lock b/Gemfile-jekyll3.lock new file mode 100644 index 0000000..739b2be --- /dev/null +++ b/Gemfile-jekyll3.lock @@ -0,0 +1,101 @@ +PATH + remote: . + specs: + jekyll-minibundle (2.2.0) + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + ast (2.4.0) + benchmark-ips (2.7.2) + coderay (1.1.2) + colorator (1.1.0) + concurrent-ruby (1.1.6) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + eventmachine (1.2.7) + ffi (1.12.2) + forwardable-extended (2.6.0) + http_parser.rb (0.6.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jaro_winkler (1.5.4) + jekyll (3.8.6) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 2.0) + kramdown (~> 1.14) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) + safe_yaml (~> 1.0) + jekyll-sass-converter (1.5.2) + sass (~> 3.4) + jekyll-watch (2.2.1) + listen (~> 3.0) + kramdown (1.17.0) + liquid (4.0.3) + listen (3.2.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.3.6) + method_source (0.9.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + nokogiri (1.10.8) + mini_portile2 (~> 2.4.0) + parallel (1.19.1) + parser (2.7.0.3) + ast (~> 2.4.0) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + pry (0.12.2) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + public_suffix (4.0.3) + rainbow (3.0.0) + rake (13.0.1) + rb-fsevent (0.10.3) + rb-inotify (0.10.1) + ffi (~> 1.0) + rexml (3.2.4) + rouge (3.16.0) + rubocop (0.80.1) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.7.0.1) + rainbow (>= 2.2.2, < 4.0) + rexml + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 1.7) + ruby-progressbar (1.10.1) + safe_yaml (1.0.5) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + unicode-display_width (1.6.1) + +PLATFORMS + ruby + +DEPENDENCIES + benchmark-ips (~> 2.7) + jekyll (~> 3.0) + jekyll-minibundle! + minitest (~> 5.8) + nokogiri (~> 1.6) + pry (~> 0.10) + rake (~> 13.0) + rubocop (~> 0.80.1) + +BUNDLED WITH + 2.1.4 diff --git a/Gemfile-jekyll4 b/Gemfile-jekyll4 new file mode 100644 index 0000000..76af609 --- /dev/null +++ b/Gemfile-jekyll4 @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +source 'https://rubygems.org/' + +gemspec + +group :development do + gem 'jekyll', '~> 4.0' +end diff --git a/Gemfile-jekyll4.lock b/Gemfile-jekyll4.lock new file mode 100644 index 0000000..2a5e5a0 --- /dev/null +++ b/Gemfile-jekyll4.lock @@ -0,0 +1,104 @@ +PATH + remote: . + specs: + jekyll-minibundle (2.2.0) + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + ast (2.4.0) + benchmark-ips (2.7.2) + coderay (1.1.2) + colorator (1.1.0) + concurrent-ruby (1.1.6) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + eventmachine (1.2.7) + ffi (1.12.2) + forwardable-extended (2.6.0) + http_parser.rb (0.6.0) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + jaro_winkler (1.5.4) + jekyll (4.0.0) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (>= 0.9.5, < 2) + jekyll-sass-converter (~> 2.0) + jekyll-watch (~> 2.0) + kramdown (~> 2.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (~> 3.0) + safe_yaml (~> 1.0) + terminal-table (~> 1.8) + jekyll-sass-converter (2.1.0) + sassc (> 2.0.1, < 3.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + kramdown (2.1.0) + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.3) + listen (3.2.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.3.6) + method_source (0.9.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + nokogiri (1.10.8) + mini_portile2 (~> 2.4.0) + parallel (1.19.1) + parser (2.7.0.3) + ast (~> 2.4.0) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + pry (0.12.2) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + public_suffix (4.0.3) + rainbow (3.0.0) + rake (13.0.1) + rb-fsevent (0.10.3) + rb-inotify (0.10.1) + ffi (~> 1.0) + rexml (3.2.4) + rouge (3.16.0) + rubocop (0.80.1) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.7.0.1) + rainbow (>= 2.2.2, < 4.0) + rexml + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 1.7) + ruby-progressbar (1.10.1) + safe_yaml (1.0.5) + sassc (2.2.1) + ffi (~> 1.9) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + unicode-display_width (1.6.1) + +PLATFORMS + ruby + +DEPENDENCIES + benchmark-ips (~> 2.7) + jekyll (~> 4.0) + jekyll-minibundle! + minitest (~> 5.8) + nokogiri (~> 1.6) + pry (~> 0.10) + rake (~> 13.0) + rubocop (~> 0.80.1) + +BUNDLED WITH + 2.1.4 diff --git a/README.md b/README.md index a0a1194..6a29c3c 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ cache busting. There are no runtime dependencies, except for the minification tool used for bundling (fingerprinting has no dependencies). -The plugin requires Jekyll version 3.x. It is tested with Ruby MRI 2.3 -and later. Ruby 1.8 and 1.9 are *not* supported. +The plugin requires Jekyll version 3 or 4. It is tested with Ruby MRI +2.3 and later. The plugin works with Jekyll's watch mode (auto-regeneration, Jekyll option `--watch`), but not with incremental feature enabled (Jekyll diff --git a/Rakefile b/Rakefile index d24277d..c6c51b3 100644 --- a/Rakefile +++ b/Rakefile @@ -79,13 +79,14 @@ task :test do extra_opts = ENV['DEBUG'] ? '-w -rpp -rpry ' : '' + puts "Jekyll version: #{Gem::Specification.find_by_name('jekyll').version}" sh "ruby -I lib:test #{extra_opts}#{run_selected_or_all}" end namespace :fixture do CLEAN.include 'test/fixture/site/_site' - desc 'Generate fixture site' + desc 'Generate fixture site (tests use it, this task allows manual inspection)' task :build do run_jekyll_in_fixture_site('build') end