class Nanoc::Extra::Checking::DSL

@api private

Attributes

deploy_checks[R]

Public Class Methods

from_file(filename) click to toggle source
# File lib/nanoc/extra/checking/dsl.rb, line 6
def self.from_file(filename)
  dsl = new
  dsl.instance_eval(File.read(filename), filename)
  dsl
end
new() click to toggle source
# File lib/nanoc/extra/checking/dsl.rb, line 12
def initialize
  @deploy_checks = []
end

Public Instance Methods

check(identifier, &block) click to toggle source
# File lib/nanoc/extra/checking/dsl.rb, line 16
def check(identifier, &block)
  klass = Class.new(::Nanoc::Extra::Checking::Check)
  klass.send(:define_method, :run, &block)
  klass.send(:identifier, identifier)
end
deploy_check(*identifiers) click to toggle source
# File lib/nanoc/extra/checking/dsl.rb, line 22
def deploy_check(*identifiers)
  identifiers.each { |i| @deploy_checks << i }
end