class Capsium::Package::Validator
Validates a package directory or .cap file against the canonical schemas (ARCHITECTURE.md sections 2-6) and reports one result per check. Used by ‘capsium package validate`.
Constants
- CheckResult
- EXTERNAL_REFERENCE_PATTERN
- TEXT_CONTENT_MIME
Public Class Methods
(String package_path) → void
Source
# File lib/capsium/package/validator.rb, line 23 def initialize(package_path) @given_path = package_path end
Public Instance Methods
() → Array[CheckResult]
Source
# File lib/capsium/package/validator.rb, line 27 def run Dir.mktmpdir do |dir| @workdir = dir @package_path = prepare(dir) [metadata_check, manifest_check, routes_check, storage_check, security_check, content_check] end end
() → bool
Source
# File lib/capsium/package/validator.rb, line 36 def valid? run.all?(&:ok?) end