diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d71e6a1 --- /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: [ 3.0, 2.7, 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/.gitignore b/.gitignore index 9106b2a..dc96cb9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /pkg/ /spec/reports/ /tmp/ +/Gemfile.lock 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/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 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