diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8d59960..ed98c3de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,13 +85,13 @@ jobs: run: bundle exec rage routes - name: Add a Rake task working-directory: ./my_app - run: printf "desc \"Prints From Rake\"\nnamespace :hello do\ntask :print do\nend\nend" > lib/tasks/hello.rake + run: printf "desc \"Prints From Rake\"\nnamespace :hello do\ntask :print do\nputs('Hello!')\nend\nend" > lib/tasks/hello.rake - name: Check available Rake tasks working-directory: ./my_app run: bundle exec rake --tasks | grep "rake hello:print" - name: Run the Rake task working-directory: ./my_app - run: bundle exec rake hello:print + run: test "$(bundle exec rake hello:print)" = "Hello!" cli-d: runs-on: ubuntu-latest name: CLI DB @@ -130,4 +130,12 @@ jobs: run: bundle exec rage s& - name: Test the default route run: curl --fail http://localhost:3000 - + - name: Add a Rake task + working-directory: ./my_app + run: printf "desc \"Prints From Rake\"\nnamespace :hello do\ntask :print do\nputs('Hello!')\nend\nend" > lib/tasks/hello.rake + - name: Check available Rake tasks + working-directory: ./my_app + run: bundle exec rake --tasks | grep "rake hello:print" + - name: Run the Rake task + working-directory: ./my_app + run: test "$(bundle exec rake hello:print)" = "Hello!" diff --git a/CHANGELOG.md b/CHANGELOG.md index 653c3aa4..f26e2886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +## [1.21.2] - 2026-03-11 + +- Fix duplicate Rake tasks (#238). + ## [1.21.1] - 2026-02-27 - Improve styling for the `skills` CLI (#223). diff --git a/lib/rage/tasks.rb b/lib/rage/tasks.rb index 95e94293..80c10ad8 100644 --- a/lib/rage/tasks.rb +++ b/lib/rage/tasks.rb @@ -28,6 +28,12 @@ def configuration_file end end) + begin + StandaloneMigrations::MinimalRailtieConfig.paths["lib/tasks"] = [] + rescue => e + warn("WARNING: Failed to disable StandaloneMigrations task auto-loading (#{e.class}: #{e.message})") + end + StandaloneMigrations::Tasks.load_tasks end diff --git a/lib/rage/version.rb b/lib/rage/version.rb index 467f9b70..d8dda69d 100644 --- a/lib/rage/version.rb +++ b/lib/rage/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Rage - VERSION = "1.21.1" + VERSION = "1.21.2" end