Sha256: 4b9b9ee7c2115aaaf1f29fa0ce3a99659e28c629a5be37af93defbb96ad96fbd

Contents?: true

Size: 561 Bytes

Versions: 19

Compression:

Stored size: 561 Bytes

Contents

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

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

    def initialize
      @deploy_checks = []
    end

    def check(identifier, &block)
      klass = Class.new(::Nanoc::Extra::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

19 entries across 19 versions & 1 rubygems

Version Path
nanoc-4.3.5 lib/nanoc/extra/checking/dsl.rb
nanoc-4.3.4 lib/nanoc/extra/checking/dsl.rb
nanoc-4.3.3 lib/nanoc/extra/checking/dsl.rb
nanoc-4.3.2 lib/nanoc/extra/checking/dsl.rb
nanoc-4.3.1 lib/nanoc/extra/checking/dsl.rb
nanoc-4.3.0 lib/nanoc/extra/checking/dsl.rb
nanoc-4.2.4 lib/nanoc/extra/checking/dsl.rb
nanoc-4.2.3 lib/nanoc/extra/checking/dsl.rb
nanoc-4.2.2 lib/nanoc/extra/checking/dsl.rb
nanoc-4.2.1 lib/nanoc/extra/checking/dsl.rb
nanoc-4.2.0 lib/nanoc/extra/checking/dsl.rb
nanoc-4.1.6 lib/nanoc/extra/checking/dsl.rb
nanoc-4.2.0b1 lib/nanoc/extra/checking/dsl.rb
nanoc-4.1.5 lib/nanoc/extra/checking/dsl.rb
nanoc-4.1.4 lib/nanoc/extra/checking/dsl.rb
nanoc-4.1.3 lib/nanoc/extra/checking/dsl.rb
nanoc-4.1.2 lib/nanoc/extra/checking/dsl.rb
nanoc-4.1.1 lib/nanoc/extra/checking/dsl.rb
nanoc-4.1.0 lib/nanoc/extra/checking/dsl.rb