Sha256: 99987bf8a5cd8a27a4181f4a5786a1e5b0976b53132e6400dd1b46f923b621e6
Contents?: true
Size: 1001 Bytes
Versions: 11
Compression:
Stored size: 1001 Bytes
Contents
# frozen_string_literal: true module Nanoc module Assertions class AssertionFailure < Nanoc::Int::Errors::InternalInconsistency end module Mixin def assert(assertion) return unless Nanoc::Int::ContractsSupport.enabled? unless assertion.call raise AssertionFailure, "assertion failed: #{assertion.class}" end end end class Base def call raise NotImplementedError end end class AllItemRepsHaveCompiledContent < Nanoc::Assertions::Base def initialize(compiled_content_cache:, item_reps:) @compiled_content_cache = compiled_content_cache @item_reps = item_reps end def call @item_reps.all? do |rep| @compiled_content_cache[rep] end end end class PathIsAbsolute < Nanoc::Assertions::Base def initialize(path:) @path = path end def call Pathname.new(@path).absolute? end end end end
Version data entries
11 entries across 11 versions & 1 rubygems