mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-06-24 04:49:08 +00:00
Pull the pure, testable logic out of the bake tasks into Pressa modules: - Pressa::Drafts — slugs, ordinal dates, draft paths, and the new-draft template - Pressa::Coverage — the coverage measurement script, output parsing, and baseline-ref resolution - Pressa::Publish — the rsync command builder Each gets its own tests, so this logic now sits under the lib/ coverage gate instead of being untested glue inside the task files. With the logic extracted, the namespaced bake/ split no longer earns its keep — those files were mostly thin task declarations. Collapse build/draft/publish/quality back into a single bake.rb with the original flat task names (new_draft, coverage, publish_beta, and so on) and update CI and AGENTS.md to match.
16 lines
522 B
Ruby
16 lines
522 B
Ruby
module Pressa
|
|
# Builds the rsync invocation used to deploy generated output to a host.
|
|
# The bake publish tasks own the actual process spawn; this just assembles argv.
|
|
module Publish
|
|
module_function
|
|
|
|
def rsync_command(local_paths:, host:, publish_dir:, dry_run:, delete:)
|
|
command = ["rsync", "-aKv", "-e", "ssh -4"]
|
|
command << "--dry-run" if dry_run
|
|
command << "--delete" if delete
|
|
command.concat(local_paths)
|
|
command << "#{host}:#{publish_dir}"
|
|
command
|
|
end
|
|
end
|
|
end
|