Sha256: f0a50010a28d5371dde04b1a9dcdcf42e18b2ce0c16dfaa6a9a1b977c0920f8a

Contents?: true

Size: 609 Bytes

Versions: 29

Compression:

Stored size: 609 Bytes

Contents

module Nanoc::Checking
  # @api private
  class DSL
    attr_reader :deploy_checks

    def self.from_file(filename)
      dsl = new
      absolute_filename = File.expand_path(filename)
      dsl.instance_eval(File.read(filename), absolute_filename)
      dsl
    end

    def initialize
      @deploy_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| @deploy_checks << i }
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
nanoc-4.7.9 lib/nanoc/checking/dsl.rb
nanoc-4.7.8 lib/nanoc/checking/dsl.rb
nanoc-4.7.7 lib/nanoc/checking/dsl.rb
nanoc-4.7.6 lib/nanoc/checking/dsl.rb
nanoc-4.7.5 lib/nanoc/checking/dsl.rb
nanoc-4.7.4 lib/nanoc/checking/dsl.rb
nanoc-4.7.3 lib/nanoc/checking/dsl.rb
nanoc-4.7.2 lib/nanoc/checking/dsl.rb
nanoc-4.7.1 lib/nanoc/checking/dsl.rb
nanoc-4.7.0 lib/nanoc/checking/dsl.rb
nanoc-4.6.4 lib/nanoc/checking/dsl.rb
nanoc-4.6.3 lib/nanoc/checking/dsl.rb
nanoc-4.6.2 lib/nanoc/checking/dsl.rb
nanoc-4.6.1 lib/nanoc/checking/dsl.rb
nanoc-4.6.0 lib/nanoc/checking/dsl.rb
nanoc-4.5.4 lib/nanoc/checking/dsl.rb
nanoc-4.5.3 lib/nanoc/checking/dsl.rb
nanoc-4.5.2 lib/nanoc/checking/dsl.rb
nanoc-4.5.1 lib/nanoc/checking/dsl.rb
nanoc-4.5.0 lib/nanoc/checking/dsl.rb