From 6ddeb3ee4730a1555488722c75919a4a8eb519ea Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 28 Dec 2020 13:11:18 +0900 Subject: [PATCH 1/5] Use GitHub Actions for CI --- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ .travis.yml | 6 ------ Gemfile.lock | 17 +++++++++++++++++ 3 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml create mode 100644 Gemfile.lock diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c9f932b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: build + +on: [push, pull_request] + +jobs: + build: + name: build (${{ matrix.ruby }} / ${{ matrix.os }}) + strategy: + matrix: + ruby: [ 2.7, 2.6, 2.5, head ] + os: [ ubuntu-latest, macos-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + run: | + gem install bundler --no-document + bundle install + - name: Run test + run: rake test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 613b724..0000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -language: ruby -cache: bundler -rvm: - - 2.8.0 -before_install: gem install bundler -v 2.1.4 diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..99c3687 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,17 @@ +GEM + remote: https://rubygems.org/ + specs: + power_assert (1.2.0) + rake (13.0.3) + test-unit (3.3.8) + power_assert + +PLATFORMS + x86_64-darwin-20 + +DEPENDENCIES + rake + test-unit + +BUNDLED WITH + 2.2.3 From 52ea07aea6810ef9b5ad11ac96f7a5c016c71282 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 28 Dec 2020 13:21:42 +0900 Subject: [PATCH 2/5] gitignore Gemfile.lock --- .gitignore | 1 + Gemfile.lock | 17 ----------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index 9106b2a..dc96cb9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /pkg/ /spec/reports/ /tmp/ +/Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 99c3687..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,17 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - power_assert (1.2.0) - rake (13.0.3) - test-unit (3.3.8) - power_assert - -PLATFORMS - x86_64-darwin-20 - -DEPENDENCIES - rake - test-unit - -BUNDLED WITH - 2.2.3 From 3ee131ae9218ce69123d5c87cc52cc026c6598d6 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 28 Dec 2020 13:37:11 +0900 Subject: [PATCH 3/5] Support < Ruby 3.0 --- lib/pp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pp.rb b/lib/pp.rb index a410a0d..53fda14 100644 --- a/lib/pp.rb +++ b/lib/pp.rb @@ -236,7 +236,7 @@ def seplist(list, sep=nil, iter_method=:each) # :yield: element else sep.call end - yield(*v, **{}) + RUBY_VERSION >= "3.0" ? yield(*v, **{}) : yield(*v) } end From e92228964b9fc915ee3616d7f01520d659807b33 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 28 Dec 2020 13:43:44 +0900 Subject: [PATCH 4/5] Drop to support < Ruby 2.7 --- .github/workflows/test.yml | 2 +- pp.gemspec | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9f932b..d1292e5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: name: build (${{ matrix.ruby }} / ${{ matrix.os }}) strategy: matrix: - ruby: [ 2.7, 2.6, 2.5, head ] + ruby: [ 2.7, head ] os: [ ubuntu-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: diff --git a/pp.gemspec b/pp.gemspec index b7bbcf1..aa6f14e 100644 --- a/pp.gemspec +++ b/pp.gemspec @@ -7,9 +7,10 @@ Gem::Specification.new do |spec| spec.summary = %q{Provides a PrettyPrinter for Ruby objects} spec.description = %q{Provides a PrettyPrinter for Ruby objects} spec.homepage = "https://github.com/ruby/pp" - spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0") spec.licenses = ["Ruby", "BSD-2-Clause"] + spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0") + spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage From 56a8107b74f16b088206e1ba5907726bd8b8a786 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 28 Dec 2020 13:49:13 +0900 Subject: [PATCH 5/5] Test with Ruby 3.0 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d1292e5..d71e6a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: name: build (${{ matrix.ruby }} / ${{ matrix.os }}) strategy: matrix: - ruby: [ 2.7, head ] + ruby: [ 3.0, 2.7, head ] os: [ ubuntu-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: