|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -require "bundler/gem_tasks" |
4 | | - |
5 | | -defaults = [] |
6 | | - |
7 | | -is_ci = ENV.fetch("CI", "false").casecmp("true") == 0 |
8 | | - |
9 | | -### DEVELOPMENT TASKS |
10 | | -# Setup Kettle Soup Cover |
11 | | -begin |
12 | | - require "kettle-soup-cover" |
13 | | - |
14 | | - Kettle::Soup::Cover.install_tasks |
15 | | - # NOTE: Coverage on CI is configured independent of this task. |
16 | | - # This task is for local development, as it opens results in browser |
17 | | - defaults << "coverage" unless Kettle::Soup::Cover::IS_CI |
18 | | -rescue LoadError |
19 | | - desc("(stub) coverage is unavailable") |
20 | | - task("coverage") do |
21 | | - warn("NOTE: kettle-soup-cover isn't installed, or is disabled for #{RUBY_VERSION} in the current environment") |
22 | | - end |
23 | | -end |
24 | | - |
25 | | -# Setup Bundle Audit |
26 | | -begin |
27 | | - require "bundler/audit/task" |
28 | | - |
29 | | - Bundler::Audit::Task.new |
30 | | - defaults.push("bundle:audit:update", "bundle:audit") |
31 | | -rescue LoadError |
32 | | - desc("(stub) bundle:audit is unavailable") |
33 | | - task("bundle:audit") do |
34 | | - warn("NOTE: bundler-audit isn't installed, or is disabled for #{RUBY_VERSION} in the current environment") |
35 | | - end |
36 | | - desc("(stub) bundle:audit:update is unavailable") |
37 | | - task("bundle:audit:update") do |
38 | | - warn("NOTE: bundler-audit isn't installed, or is disabled for #{RUBY_VERSION} in the current environment") |
39 | | - end |
40 | | -end |
41 | | - |
42 | | -begin |
43 | | - require "rspec/core/rake_task" |
44 | | - |
45 | | - RSpec::Core::RakeTask.new(:spec) |
46 | | - # This takes the place of `coverage` task when running as CI=true |
47 | | - defaults << "spec" if !defined?(Kettle::Soup::Cover) || Kettle::Soup::Cover::IS_CI |
48 | | -rescue LoadError |
49 | | - desc("spec task stub") |
50 | | - task(:spec) do |
51 | | - warn("NOTE: rspec isn't installed, or is disabled for #{RUBY_VERSION} in the current environment") |
52 | | - end |
53 | | -end |
54 | | - |
55 | | -desc "run spec task with test task" |
56 | | -task test: :spec |
| 3 | +# kettle-dev Rakefile v1.0.18 - 2025-08-29 |
| 4 | +# Ruby 2.3 (Safe Navigation) or higher required |
| 5 | +# |
| 6 | +# MIT License (see License.txt) |
| 7 | +# |
| 8 | +# Copyright (c) 2025 Peter H. Boling (galtzo.com) |
| 9 | +# |
| 10 | +# Expected to work in any project that uses Bundler. |
| 11 | +# |
| 12 | +# Sets up tasks for appraisal, floss_funding, rspec, minitest, rubocop, reek, yard, and stone_checksums. |
| 13 | +# |
| 14 | +# rake appraisal:update # Update Appraisal gemfiles and run RuboCop... |
| 15 | +# rake bench # Run all benchmarks (alias for bench:run) |
| 16 | +# rake bench:list # List available benchmark scripts |
| 17 | +# rake bench:run # Run all benchmark scripts (skips on CI) |
| 18 | +# rake build # Build kettle-dev-1.0.0.gem into the pkg d... |
| 19 | +# rake build:checksum # Generate SHA512 checksum of kettle-dev-1.... |
| 20 | +# rake build:generate_checksums # Generate both SHA256 & SHA512 checksums i... |
| 21 | +# rake bundle:audit:check # Checks the Gemfile.lock for insecure depe... |
| 22 | +# rake bundle:audit:update # Updates the bundler-audit vulnerability d... |
| 23 | +# rake ci:act[opt] # Run 'act' with a selected workflow |
| 24 | +# rake clean # Remove any temporary products |
| 25 | +# rake clobber # Remove any generated files |
| 26 | +# rake coverage # Run specs w/ coverage and open results in... |
| 27 | +# rake default # Default tasks aggregator |
| 28 | +# rake install # Build and install kettle-dev-1.0.0.gem in... |
| 29 | +# rake install:local # Build and install kettle-dev-1.0.0.gem in... |
| 30 | +# rake kettle:dev:install # Install kettle-dev GitHub automation and ... |
| 31 | +# rake kettle:dev:template # Template kettle-dev files into the curren... |
| 32 | +# rake reek # Check for code smells |
| 33 | +# rake reek:update # Run reek and store the output into the RE... |
| 34 | +# rake release[remote] # Create tag v1.0.0 and build and push kett... |
| 35 | +# rake rubocop_gradual # Run RuboCop Gradual |
| 36 | +# rake rubocop_gradual:autocorrect # Run RuboCop Gradual with autocorrect (onl... |
| 37 | +# rake rubocop_gradual:autocorrect_all # Run RuboCop Gradual with autocorrect (saf... |
| 38 | +# rake rubocop_gradual:check # Run RuboCop Gradual to check the lock file |
| 39 | +# rake rubocop_gradual:force_update # Run RuboCop Gradual to force update the l... |
| 40 | +# rake rubocop_gradual_debug # Run RuboCop Gradual |
| 41 | +# rake rubocop_gradual_debug:autocorrect # Run RuboCop Gradual with autocorrect (onl... |
| 42 | +# rake rubocop_gradual_debug:autocorrect_all # Run RuboCop Gradual with autocorrect (saf... |
| 43 | +# rake rubocop_gradual_debug:check # Run RuboCop Gradual to check the lock file |
| 44 | +# rake rubocop_gradual_debug:force_update # Run RuboCop Gradual to force update the l... |
| 45 | +# rake spec # Run RSpec code examples |
| 46 | +# rake test # Run tests |
| 47 | +# rake yard # Generate YARD Documentation |
| 48 | +# |
57 | 49 |
|
58 | | -# Setup RuboCop-LTS |
59 | | -begin |
60 | | - require "rubocop/lts" |
| 50 | +require "bundler/gem_tasks" |
61 | 51 |
|
62 | | - Rubocop::Lts.install_tasks |
63 | | - # Make autocorrect the default rubocop task |
64 | | - defaults << "rubocop_gradual:autocorrect" |
65 | | -rescue LoadError |
66 | | - desc("(stub) rubocop_gradual is unavailable") |
67 | | - task(:rubocop_gradual) do |
68 | | - warn("NOTE: rubocop-lts isn't installed, or is disabled for #{RUBY_VERSION} in the current environment") |
69 | | - end |
| 52 | +# Define a base default task early so other files can enhance it. |
| 53 | +desc "Default tasks aggregator" |
| 54 | +task :default do |
| 55 | + puts "Default task complete." |
70 | 56 | end |
71 | 57 |
|
72 | | -# Setup Yard |
73 | | -begin |
74 | | - require "yard" |
75 | | - |
76 | | - YARD::Rake::YardocTask.new(:yard) do |t| |
77 | | - t.files = [ |
78 | | - # Source Splats (alphabetical) |
79 | | - "lib/**/*.rb", |
80 | | - "-", # source and extra docs are separated by "-" |
81 | | - # Extra Files (alphabetical) |
82 | | - "*.cff", |
83 | | - "*.md", |
84 | | - "*.txt", |
85 | | - ] |
86 | | - end |
87 | | - defaults << "yard" |
88 | | -rescue LoadError |
89 | | - desc("(stub) yard is unavailable") |
90 | | - task(:yard) do |
91 | | - warn("NOTE: yard isn't installed, or is disabled for #{RUBY_VERSION} in the current environment") |
92 | | - end |
93 | | -end |
94 | | - |
95 | | -# Setup Reek |
96 | | -begin |
97 | | - require "reek/rake/task" |
98 | | - |
99 | | - Reek::Rake::Task.new do |t| |
100 | | - t.fail_on_error = true |
101 | | - t.verbose = false |
102 | | - t.source_files = "{lib,spec}/**/*.rb" |
103 | | - end |
104 | | - defaults << "reek" unless is_ci |
105 | | -rescue LoadError |
106 | | - desc("(stub) reek is unavailable") |
107 | | - task(:reek) do |
108 | | - warn("NOTE: reek isn't installed, or is disabled for #{RUBY_VERSION} in the current environment") |
109 | | - end |
110 | | -end |
| 58 | +# External gems that define tasks - add here! |
| 59 | +require "kettle/dev" |
111 | 60 |
|
112 | 61 | ### RELEASE TASKS |
113 | 62 | # Setup stone_checksums |
114 | 63 | begin |
115 | 64 | require "stone_checksums" |
116 | | - |
117 | | - GemChecksums.install_tasks |
118 | 65 | rescue LoadError |
119 | 66 | desc("(stub) build:generate_checksums is unavailable") |
120 | 67 | task("build:generate_checksums") do |
121 | 68 | warn("NOTE: stone_checksums isn't installed, or is disabled for #{RUBY_VERSION} in the current environment") |
122 | 69 | end |
123 | 70 | end |
124 | | - |
125 | | -task default: defaults |
0 commit comments