Skip to content

Commit 1bac405

Browse files
authored
🔨 Galtzo FLOSS Rakefile v1.0.1
1 parent c015a0c commit 1bac405

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

‎Rakefile‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# frozen_string_literal: true
22

3-
# Galtzo FLOSS Rakefile v1.0 - 2025-08-12
3+
# Galtzo FLOSS Rakefile v1.0.1 - 2025-08-12
44
#
55
# MIT License (see License.txt)
66
#
77
# Copyright (c) 2025 Peter H. Boling (galtzo.com)
88
#
99
# Expected to work in any project that uses Bundler.
10+
#
1011
# Sets up tasks for rspec, minitest, rubocop, reek, yard, and stone_checksums.
12+
#
1113
# rake build # Build my_gem-1.0.0.gem into the pkg directory
1214
# rake build:checksum # Generate SHA512 checksum of my_gem-1.0.0.gem into the checksums directory
1315
# rake build:generate_checksums # Generate both SHA256 & SHA512 checksums into the checksums directory, and git commit them
@@ -98,8 +100,16 @@ rescue LoadError
98100
end
99101
end
100102

101-
desc "run spec task with test task"
102-
task test: :spec
103+
if Rake::Task.task_defined?('spec') && !Rake::Task.task_defined?('test')
104+
desc "run spec task with test task"
105+
task test: :spec
106+
elsif !Rake::Task.task_defined?('spec') && Rake::Task.task_defined?('test')
107+
desc "run test task with spec task"
108+
task spec: :test
109+
else
110+
# Add spec as pre-requisite to 'test'
111+
Rake::Task[:test].enhance(['spec'])
112+
end
103113

104114
# Setup RuboCop-LTS
105115
begin

0 commit comments

Comments
 (0)