diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 0000000..d799415 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,51 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake +# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby + +name: Ruby + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + test: + + runs-on: ubuntu-latest + strategy: + matrix: + rails-version: ['5.2.5', '6.0.3.6', '6.1.3.1', 'main'] + ruby-version: ['2.5', '2.6', '2.7', '3.0'] + exclude: + - rails-version: 'main' + ruby-version: '2.5' + - rails-version: 'main' + ruby-version: '2.6' + - rails-version: '5.2.5' + ruby-version: '3.0' + + env: + RAILS_VERSION: ${{ matrix.rails-version }} + + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby + # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, + # change this to (see https://github.com/ruby/setup-ruby#versioning): + # uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake build + - name: Lint + run: bundle exec standardrb diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0743e78..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: ruby -rvm: - - 2.5.8 - - 2.6.6 - - 2.7.2 - - 3.0.0 - -env: - - "RAILS_VERSION=5.2.5" - - "RAILS_VERSION=6.0.3.6" - - "RAILS_VERSION=6.1.3.1" - - "RAILS_VERSION=main" - -matrix: - exclude: - - rvm: 3.0.0 - env: "RAILS_VERSION=5.2.5" - - rvm: 2.5.8 - env: "RAILS_VERSION=main" - - rvm: 2.6.6 - env: "RAILS_VERSION=main" - -addons: - code_climate: - repo_token: 9b174f785a3f1ad8986730da28c2756320f0413067e7e06bad278280f47743fd - -script: - - bundle exec rake build - - bundle exec standardrb - -after_success: - - bundle exec codeclimate-test-reporter diff --git a/Gemfile b/Gemfile index e79d56a..433ce3f 100644 --- a/Gemfile +++ b/Gemfile @@ -8,12 +8,12 @@ gemspec # Enable testing of multiple rails versions rails_version = ENV["RAILS_VERSION"] || "default" rails = case rails_version - when "main" - {github: "rails/rails", branch: "main"} - when "default" - ">= 6.1.0" - else - "~> #{rails_version}" +when "main" + {github: "rails/rails", branch: "main"} +when "default" + ">= 6.1.0" +else + "~> #{rails_version}" end gem "rails", rails ############################################### diff --git a/README.rdoc b/README.rdoc index 076f864..9692cb8 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,7 +1,5 @@ = RouteDowncaser -{Build Status}[https://travis-ci.org/substancelab/route_downcaser] {}[https://codeclimate.com/github/substancelab/route_downcaser] - Makes routing in Rails case-insensitive (and other Rack-servers like Sinatra) This gem hooks into the Rack middleware of Rails. This way all paths are downcased before dispatching to Rails' routing mechanism. Querystring parameters and asset paths are not changed in any way. diff --git a/route_downcaser.gemspec b/route_downcaser.gemspec index ff9d6af..9d40577 100644 --- a/route_downcaser.gemspec +++ b/route_downcaser.gemspec @@ -15,12 +15,11 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/carstengehling/route_downcaser" s.summary = "Makes routing in Rails case-insensitive" s.description = - "This gem hooks into the Rack middleware of Rails. This way all paths are "\ - "downcased before dispatching to Rails' routing mechanism. Querystring "\ + "This gem hooks into the Rack middleware of Rails. This way all paths are " \ + "downcased before dispatching to Rails' routing mechanism. Querystring " \ "parameters are not changed in any way." s.files = Dir["{lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] - s.test_files = Dir["test/**/*"] s.add_runtime_dependency "activesupport", ">= 3.2" s.add_development_dependency "standard" end