Sha256: c29af1c5c5e5e976e2b62f4d9f16e3fd641484126d96b5b93cd5ec73b532e05e
Contents?: true
Size: 688 Bytes
Versions: 30
Compression:
Stored size: 688 Bytes
Contents
# frozen_string_literal: true module Nanoc::Checking # @api private class DSL def self.from_file(filename, enabled_checks:) dsl = new(enabled_checks: enabled_checks) absolute_filename = File.expand_path(filename) dsl.instance_eval(File.read(filename), absolute_filename) dsl end def initialize(enabled_checks:) @enabled_checks = enabled_checks end def check(identifier, &block) klass = Class.new(::Nanoc::Checking::Check) klass.send(:define_method, :run, &block) klass.send(:identifier, identifier) end def deploy_check(*identifiers) identifiers.each { |i| @enabled_checks << i } end end end
Version data entries
30 entries across 30 versions & 1 rubygems