Skip to content

Commit 8c8d278

Browse files
committed
🔨 Galtzo FLOSS Rakefile v1.0.3
1 parent b86b1b6 commit 8c8d278

21 files changed

+84
-21
lines changed

.idea/GitLink.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rakefile

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
# Galtzo FLOSS Rakefile v1.0.2 - 2025-08-12
3+
# Galtzo FLOSS Rakefile v1.0.3 - 2025-08-14
44
#
55
# MIT License (see License.txt)
66
#
@@ -10,6 +10,9 @@
1010
#
1111
# Sets up tasks for rspec, minitest, rubocop, reek, yard, and stone_checksums.
1212
#
13+
# rake bench # Run all benchmarks (alias for bench:run)
14+
# rake bench:list # List available benchmark scripts
15+
# rake bench:run # Run all benchmark scripts (skips on CI)
1316
# rake build # Build my_gem-1.0.0.gem into the pkg directory
1417
# rake build:checksum # Generate SHA512 checksum of my_gem-1.0.0.gem into the checksums directory
1518
# rake build:generate_checksums # Generate both SHA256 & SHA512 checksums into the checksums directory, and git commit them
@@ -30,10 +33,11 @@
3033
# rake rubocop_gradual:check # Run RuboCop Gradual to check the lock file
3134
# rake rubocop_gradual:force_update # Run RuboCop Gradual to force update the lock file
3235
# rake spec # Run RSpec code examples
33-
# rake test # Run tests / run spec task with test task
36+
# rake test # Run tests
3437
# rake yard # Generate YARD Documentation
3538

3639
require "bundler/gem_tasks"
40+
require "rbconfig"
3741

3842
defaults = []
3943

@@ -198,4 +202,57 @@ rescue LoadError
198202
end
199203
end
200204

205+
# --- Benchmarks (dev-only) ---
206+
namespace :bench do
207+
desc "List available benchmark scripts"
208+
task :list do
209+
bench_files = Dir[File.join(__dir__, "benchmarks", "*.rb")].sort
210+
if bench_files.empty?
211+
puts "No benchmark scripts found under benchmarks/."
212+
else
213+
bench_files.each { |f| puts File.basename(f) }
214+
end
215+
end
216+
217+
desc "Run all benchmark scripts (skips on CI)"
218+
task :run do
219+
if ENV.fetch("CI", "false").casecmp("true").zero?
220+
puts "Benchmarks are disabled on CI. Skipping."
221+
next
222+
end
223+
224+
ruby = RbConfig.ruby
225+
bundle = Gem.bindir ? File.join(Gem.bindir, "bundle") : "bundle"
226+
bench_files = Dir[File.join(__dir__, "benchmarks", "*.rb")].sort
227+
if bench_files.empty?
228+
puts "No benchmark scripts found under benchmarks/."
229+
next
230+
end
231+
232+
use_bundler = ENV.fetch("BENCH_BUNDLER", "0") == "1"
233+
234+
bench_files.each do |script|
235+
puts "\n=== Running: #{File.basename(script)} ==="
236+
if use_bundler
237+
cmd = [bundle, "exec", ruby, "-Ilib", script]
238+
system(*cmd) || abort("Benchmark failed: #{script}")
239+
else
240+
# Run benchmarks without Bundler to reduce overhead and better reflect plain ruby -Ilib
241+
begin
242+
require "bundler"
243+
Bundler.with_unbundled_env do
244+
system(ruby, "-Ilib", script) || abort("Benchmark failed: #{script}")
245+
end
246+
rescue LoadError
247+
# If Bundler isn't available, just run directly
248+
system(ruby, "-Ilib", script) || abort("Benchmark failed: #{script}")
249+
end
250+
end
251+
end
252+
end
253+
end
254+
255+
desc "Run all benchmarks (alias for bench:run)"
256+
task bench: "bench:run"
257+
201258
task default: defaults

docs/LibraryTree.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ <h3 class="signature " id="roots-class_method">
429429
</div>
430430

431431
<div id="footer">
432-
Generated on Tue Aug 12 04:10:00 2025 by
432+
Generated on Thu Aug 14 01:44:55 2025 by
433433
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
434434
0.9.37 (ruby-3.4.5).
435435
</div>

docs/LibraryTree/Error.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ <h2>Overview</h2><div class="docstring">
139139
</div>
140140

141141
<div id="footer">
142-
Generated on Tue Aug 12 04:10:00 2025 by
142+
Generated on Thu Aug 14 01:44:55 2025 by
143143
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
144144
0.9.37 (ruby-3.4.5).
145145
</div>

docs/LibraryTree/Node.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ <h3 class="signature " id="to_h-instance_method">
10601060
</div>
10611061

10621062
<div id="footer">
1063-
Generated on Tue Aug 12 04:10:00 2025 by
1063+
Generated on Thu Aug 14 01:44:55 2025 by
10641064
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
10651065
0.9.37 (ruby-3.4.5).
10661066
</div>

docs/LibraryTree/Registry.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ <h3 class="signature " id="tracked?-class_method">
873873
</div>
874874

875875
<div id="footer">
876-
Generated on Tue Aug 12 04:10:00 2025 by
876+
Generated on Thu Aug 14 01:44:55 2025 by
877877
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
878878
0.9.37 (ruby-3.4.5).
879879
</div>

docs/LibraryTree/Version.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ <h2>
131131
</div>
132132

133133
<div id="footer">
134-
Generated on Tue Aug 12 04:10:00 2025 by
134+
Generated on Thu Aug 14 01:44:55 2025 by
135135
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
136136
0.9.37 (ruby-3.4.5).
137137
</div>

docs/LibraryTree/Watcher.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ <h3 class="signature first" id="included-class_method">
217217
</div>
218218

219219
<div id="footer">
220-
Generated on Tue Aug 12 04:10:00 2025 by
220+
Generated on Thu Aug 14 01:44:55 2025 by
221221
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
222222
0.9.37 (ruby-3.4.5).
223223
</div>

docs/LibraryTree/Watcher/ClassMethods.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ <h3 class="signature first" id="included-instance_method">
202202
</div>
203203

204204
<div id="footer">
205-
Generated on Tue Aug 12 04:10:00 2025 by
205+
Generated on Thu Aug 14 01:44:55 2025 by
206206
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
207207
0.9.37 (ruby-3.4.5).
208208
</div>

docs/_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ <h2>Namespace Listing A-Z</h2>
211211
</div>
212212

213213
<div id="footer">
214-
Generated on Tue Aug 12 04:10:00 2025 by
214+
Generated on Thu Aug 14 01:44:55 2025 by
215215
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
216216
0.9.37 (ruby-3.4.5).
217217
</div>

0 commit comments

Comments
 (0)