Skip to content

Commit

Permalink
chore(Taskfile): add ruby engine and version to appraisal name
Browse files Browse the repository at this point in the history
  • Loading branch information
marian13 committed Apr 26, 2023
1 parent 180a941 commit 829d451
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 23 deletions.
5 changes: 4 additions & 1 deletion Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
##

##
# This wrapper appends ruby engine and version to the `appraisal_name`.
# This wrapper appends Ruby engine and version to the `appraisal_name`.
# This way every Appraisal has a dedicated Gemfile for any combination of Ruby and particular `appraisal_name`.
# For example: `ruby_2.7_rails_5.2`, `ruby_3.0_rails_6.0`, `jruby_9.4_rails_7.0`, etc.
#
Expand All @@ -43,6 +43,9 @@
# @param block [Proc]
# @return [void]
#
# @internal
# Taskfile uses a combination of Ruby engine, Ruby version and `appraisal_name` as `{{.APPRAISAL_NAME}}`.
#
def appraise(appraisal_name, &block)
super([::RUBY_ENGINE, ::RUBY_VERSION, appraisal_name].join("_"), &block)
end
Expand Down
161 changes: 139 additions & 22 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,82 @@ tasks:
- bundle exec rake playground
interactive: true

##
# NOTE: `task console:all` is also aliased as `task playground:all`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
console:all:
cmds:
- bundle exec appraisal all rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "all"].join("_")'
interactive: true

##
# NOTE: `task console:dry` is also aliased as `task playground:dry`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
console:dry:
cmds:
- bundle exec appraisal dry rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "dry"].join("_")'
interactive: true

##
# NOTE: `task console:rails_5.2` is also aliased as `task playground:rails_5.2`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
console:rails_5.2:
cmds:
- bundle exec appraisal rails_5.2 rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_5.2"].join("_")'
interactive: true

##
# NOTE: `task console:rails_6.0` is also aliased as `task playground:rails_6.0`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
console:rails_6.0:
cmds:
- bundle exec appraisal rails_6.0 rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.0"].join("_")'
interactive: true

##
# NOTE: `task console:rails_6.1` is also aliased as `task playground:rails_6.1`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
console:rails_6.1:
cmds:
- bundle exec appraisal rails_6.1 rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.1"].join("_")'
interactive: true

##
# NOTE: `task console:rails_7.0` is also aliased as `task playground:rails_7.0`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
console:rails_7.0:
cmds:
- bundle exec appraisal rails_7.0 rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_7.0"].join("_")'
interactive: true

##
# NOTE: `task console:standard` is also aliased as `task playground:standard`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
console:standard:
cmds:
- bundle exec rake playground
Expand Down Expand Up @@ -354,41 +400,82 @@ tasks:
cmds:
- bundle exec ruby minitest.rb

playground:
cmds:
- bundle exec rake playground
interactive: true

##
# NOTE: `task playground:all` is also aliased as `task console:all`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
playground:all:
cmds:
- bundle exec appraisal all rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "all"].join("_")'
interactive: true

##
# NOTE: `task playground:dry` is also aliased as `task console:dry`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
playground:dry:
cmds:
- bundle exec appraisal dry rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "dry"].join("_")'
interactive: true

##
# NOTE: `task playground:rails_5.2` is also aliased as `task console:rails_5.2`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
playground:rails_5.2:
cmds:
- bundle exec appraisal rails_5.2 rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_5.2"].join("_")'
interactive: true

##
# NOTE: `task playground:rails_6.0` is also aliased as `task console:rails_6.0`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
playground:rails_6.0:
cmds:
- bundle exec appraisal rails_6.0 rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.0"].join("_")'
interactive: true

##
# NOTE: `task playground:rails_6.1` is also aliased as `task console:rails_6.1`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
playground:rails_6.1:
cmds:
- bundle exec appraisal rails_6.1 rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.1"].join("_")'
interactive: true

##
# NOTE: `task playground:rails_7.0` is also aliased as `task console:rails_7.0`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
playground:rails_7.0:
cmds:
- bundle exec appraisal rails_7.0 rake playground
- bundle exec appraisal {{.APPRAISAL_NAME}} rake playground
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_7.0"].join("_")'
interactive: true

##
# NOTE: `task playground:standard` is also aliased as `task console:standard`.
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
playground:standard:
cmds:
- bundle exec rake playground
Expand Down Expand Up @@ -420,9 +507,15 @@ tasks:
- task: rspec:rails_7.0:staged
- task: rspec:dry:staged

##
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
rspec:dry:
cmds:
- bundle exec appraisal dry rspec --format progress --require dry_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
- bundle exec appraisal {{.APPRAISAL_NAME}} rspec --format progress --require dry_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "dry"].join("_")'

rspec:dry:staged:
- task: rspec:dry
Expand All @@ -433,9 +526,15 @@ tasks:
#
sh: task git:staged:specs --silent

##
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
rspec:rails_5.2:
cmds:
- bundle exec appraisal rails_5.2 rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
- bundle exec appraisal {{.APPRAISAL_NAME}} rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_5.2"].join("_")'

rspec:rails_5.2:staged:
- task: rspec:rails_5.2
Expand All @@ -446,9 +545,15 @@ tasks:
#
sh: task git:staged:specs --silent

##
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
rspec:rails_6.0:
cmds:
- bundle exec appraisal rails_6.0 rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
- bundle exec appraisal {{.APPRAISAL_NAME}} rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.0"].join("_")'

rspec:rails_6.0:staged:
- task: rspec:rails_6.0
Expand All @@ -459,9 +564,15 @@ tasks:
#
sh: task git:staged:specs --silent

##
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
rspec:rails_6.1:
cmds:
- bundle exec appraisal rails_6.1 rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
- bundle exec appraisal {{.APPRAISAL_NAME}} rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_6.1"].join("_")'

rspec:rails_6.1:staged:
- task: rspec:rails_6.1
Expand All @@ -472,9 +583,15 @@ tasks:
#
sh: task git:staged:specs --silent

##
# NOTE: `APPRAISAL_NAME` should be kept in sync with `Appraisals` file.
#
rspec:rails_7.0:
cmds:
- bundle exec appraisal rails_7.0 rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
- bundle exec appraisal {{.APPRAISAL_NAME}} rspec --format progress --require rails_helper {{.GIT_STAGED_SPEC_FILES}} {{.CLI_ARGS}}
vars:
APPRAISAL_NAME:
sh: ruby -e 'print [::RUBY_ENGINE, ::RUBY_VERSION, "rails_7.0"].join("_")'

rspec:rails_7.0:staged:
- task: rspec:rails_7.0
Expand Down

0 comments on commit 829d451

Please sign in to comment.