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
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: bundler
directory: /
schedule:
interval: monthly
groups:
dependencies:
patterns:
- "*"

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
actions:
patterns:
- "*"
31 changes: 28 additions & 3 deletions .github/workflows/specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,46 @@ on:
branches:
- "*"

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
strategy:
fail-fast: false
matrix:
ruby:
- "3.4.6"
- "3.2"
- "3.3"
- "3.4"
- "4.0"
rails:
- "7.1"
- "7.2"
- "8.0"
- "8.1"
env:
RAILS_VERSION: ${{ matrix.rails }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
- name: Upload system spec screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: screenshots-ruby-${{ matrix.ruby }}-rails-${{ matrix.rails }}
path: spec/dummy/tmp/capybara
if-no-files-found: ignore
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@
# rspec failure tracking
.rspec_status
.DS_Store

# built gems
*.gem

# resolved per RAILS_VERSION, see Gemfile
/Gemfile.lock

# dummy app runtime files
/spec/dummy/tmp/
/spec/dummy/log/
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.1
ruby 4.0
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ All notable changes to this project will be documented in this file.
- Clarified in the README that the button label is a string (#12)

### Changed
- Requires Ruby 3.2+, Rails 7.1+ and Administrate 1.0+, now tested on Ruby 3.2–4.0 and Rails 7.1–8.1
- No longer depends on `sprockets-rails`, so Propshaft apps don't get Sprockets installed; the script works with either pipeline
- The button helper keeps its default `button` class when other options such as `confirm:` are passed
- The script no longer defines global variables, which could collide with other scripts on the page
- Helpers are included through `ActiveSupport.on_load(:action_view)`, so ActionView isn't loaded early
- Controllers are loaded for route generation through Zeitwerk instead of `require_dependency`
- Batch action buttons are now `button_to` forms that are truly disabled until rows are selected (#48)
- Batch action routes are now `POST /<namespace>/administrate_batch_actions/<controller>/<action>`, named `<namespace>_<action>_<controller>`, e.g. `admin_delete_batch_action_users_path`

Expand Down
27 changes: 22 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
source "https://rubygems.org"
source 'https://rubygems.org'

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# Specify your gem's dependencies in administrate_batch_actions.gemspec
gemspec

rails_version = ENV.fetch('RAILS_VERSION', '8.1')

gem 'rails', "~> #{rails_version}.0"

# Rails 8 apps default to Propshaft, older ones to Sprockets
if Gem::Version.new(rails_version) >= Gem::Version.new('8.0')
gem 'propshaft'
else
gem 'sprockets-rails'
end

gem 'rake', '~> 13.0'

group :development, :test do
gem 'pry'
end

group :test do
gem 'tzinfo-data', platforms: %i[mswin mswin64 mingw x64_mingw]
gem 'capybara'
gem 'cuprite'
gem 'puma'
gem 'rspec-rails', '>= 6.1'
end
257 changes: 0 additions & 257 deletions Gemfile.lock

This file was deleted.

Loading
Loading