From 2c5e91c723c694bd1de743ea43094ace380a84ec Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 4 Feb 2021 11:39:26 +0000 Subject: [PATCH 1/2] Explicitly declare support for Ruby >= 2.0.0 This can be used to clarify support, as well as in the future to drop support for rubies, if so desired. --- ruby2_keywords.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/ruby2_keywords.gemspec b/ruby2_keywords.gemspec index 0610b4d..1340427 100644 --- a/ruby2_keywords.gemspec +++ b/ruby2_keywords.gemspec @@ -19,6 +19,7 @@ Gem::Specification.new do |s| s.files = [ "lib/ruby2_keywords.rb", ] + s.required_ruby_version = '>= 2.0.0' s.add_development_dependency 'test-unit', '>= 2.2' s.add_development_dependency 'rake' end From acbb79aea92b130999fb84f9d69af96c2c7927f5 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 4 Feb 2021 11:58:41 +0000 Subject: [PATCH 2/2] Add docker-compose.yml for easy testing of older rubies --- README.md | 8 +++++++ docker-compose.yml | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index 4cc0282..42e1157 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,14 @@ ruby2_keywords :delegating_method Bug reports and pull requests are welcome on [GitHub] or [Ruby Issue Tracking System]. +## Development + +After checking out the repo, run `bundle install` to install dependencies. +Then, run `bundle exec rake test` to run the tests. + +To test on older Ruby versions, you can use docker. E.g. to test on Ruby 2.0, +use `docker-compose run ruby-2.0`. + ## License The gem is available as open source under the terms of the diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3135f88 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,57 @@ +version: '3.0' + +services: + ruby-2.0: + image: ruby:2.0 + volumes: + - .:/app + command: + bash -c 'cd /app && bundle install && bundle exec rake test' + ruby-2.1: + image: ruby:2.1 + volumes: + - .:/app + command: + bash -c 'cd /app && bundle install && bundle exec rake test' + ruby-2.2: + image: ruby:2.2 + volumes: + - .:/app + command: + bash -c 'cd /app && bundle install && bundle exec rake test' + ruby-2.3: + image: ruby:2.3 + volumes: + - .:/app + command: + bash -c 'cd /app && bundle install && bundle exec rake test' + ruby-2.4: + image: ruby:2.4 + volumes: + - .:/app + command: + bash -c 'cd /app && bundle install && bundle exec rake test' + ruby-2.5: + image: ruby:2.5 + volumes: + - .:/app + command: + bash -c 'cd /app && bundle install && bundle exec rake test' + ruby-2.6: + image: ruby:2.6 + volumes: + - .:/app + command: + bash -c 'cd /app && bundle install && bundle exec rake test' + ruby-2.7: + image: ruby:2.7 + volumes: + - .:/app + command: + bash -c 'cd /app && bundle install && bundle exec rake test' + ruby-3.0: + image: ruby:3.0 + volumes: + - .:/app + command: + bash -c 'cd /app && bundle install && bundle exec rake test'