Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.3", "3.4", "4.0"]
rails: ["~> 8.0.0", "~> 8.1.0"]
env:
RAILS_VERSION: ${{ matrix.rails }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run specs
run: bundle exec rspec
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

25 changes: 25 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
= 5.0.0
* performance optimizations across routing helpers, request introspection, and instance variable access
* the instance variable read/written by #resource and #resources is now the one named by the resource
specification. This means overriding #resource_name / #resources_name no longer changes which
instance variable those accessors use
* RequestPathIntrospection matches the current route segment literally (Regexp.escape), and no longer
keeps a process-wide cache of compiled segment regexps
* the spec suite runs under any RAILS_ENV, and the specs for the route mapping error messages, which
previously failed, were fixed
* development setup no longer needs Gemfile.lock.development: run bundle install
* CI moved from Travis to GitHub Actions, testing Ruby 3.3, 3.4 and 4.0 against Rails 8.0 and 8.1
* ResourceService#respond_to? now reports the proxy's own methods - it always returned false for
them, because a BasicObject has no #respond_to? for it to fall back on
* named route helpers are exposed through #respond_to_missing? rather than by overriding #respond_to?
* route_name.pluralize is memoised per controller: inflection was the most expensive operation on
the named route helper path
* lib is now frozen_string_literal: true
* removed the dead Rails 2 find_filter branch, spec/verify_rcov.rb, and the Rakefile's rake/rdoctask
fallback
* removed the spec:make_test_app / spec:rspec_generated_specs tasks: they generated a Rails 2-5 era
app and could no longer run
* gem packaging: added the MIT license and gem metadata, dropped the stale rubygems_version, and
s.files no longer ships the specs, CI config and other development files
* require Rails >= 8.0 and Ruby >= 3.3, dropping support for older versions

= 4.0.0
* replace remaining regex-based routing checks with string helpers for better performance

Expand Down
9 changes: 7 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
source :rubygems
source "https://rubygems.org"

gemspec
gemspec

# CI exercises the oldest and the newest supported Rails releases by setting
# RAILS_VERSION, e.g. RAILS_VERSION='~> 8.0.0' bundle install && bundle exec rspec
rails_version = ENV["RAILS_VERSION"].to_s
gem "rails", rails_version unless rails_version.empty?
152 changes: 0 additions & 152 deletions Gemfile.lock.development

This file was deleted.

17 changes: 12 additions & 5 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= resources_controller

{<img src="https://secure.travis-ci.org/ianwhite/resources_controller.png?branch=master" alt="Build Status" />}[http://travis-ci.org/ianwhite/resources_controller]
{<img src="https://github.com/ianwhite/resources_controller/actions/workflows/ci.yml/badge.svg" alt="Build Status" />}[https://github.com/ianwhite/resources_controller/actions/workflows/ci.yml]

is a plugin to facilitate inheritance and DRYness in your resources controllers. It introduces some abstraction to help
you override the default RESTful functionality in a clean and simple manner.
Expand All @@ -12,6 +12,10 @@ Add this to your Gemfile
gem 'rc_rails'


== Requirements

Version 5.0.0 and later require Rails >= 8.0 and Ruby >= 3.3.

== Rails 5 version

Version 3.x of this gem is compatible with Rails 5.x
Expand All @@ -38,10 +42,13 @@ To get set up for development, do the following:

git clone git://github.com/ianwhite/resources_controller
cd resources_controller
cp Gemfile.lock.development Gemfile.lock
bundle
rake spec
rake spec:rspec_generated_specs
bundle install
bundle exec rspec

The specs are run against Rails 8.0 and 8.1 on GitHub Actions. To run them against a
particular Rails version locally, set RAILS_VERSION:

RAILS_VERSION='~> 8.0.0' bundle install && bundle exec rspec

== Contributors

Expand Down
10 changes: 2 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ begin
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
begin
require 'rdoc/task'
rescue LoadError
require 'rdoc/rdoc'
require 'rake/rdoctask'
RDoc::Task = Rake::RDocTask
end

require 'rdoc/task'

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
Expand All @@ -23,7 +18,6 @@ end
Bundler::GemHelper.install_tasks

require 'rspec/core/rake_task'
require File.expand_path('../spec/rspec_generator_task', __FILE__) # for spec:generate task

task :default => [:spec]

Expand Down
2 changes: 2 additions & 0 deletions lib/rc_rails.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'resources_controller'

# BC
Expand Down
Loading
Loading