Sha256: d7d7f20f064bed7e9fd10f70a863a80f793ade9166162d021820523548642cc1

Contents?: true

Size: 561 Bytes

Versions: 11

Compression:

Stored size: 561 Bytes

Contents

# encoding: utf-8

module Nanoc::Extra::Checking

  class DSL

    attr_reader :deploy_checks

    def self.from_file(filename)
      dsl = self.new
      dsl.instance_eval File.read(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

11 entries across 11 versions & 1 rubygems

Version Path
nanoc-3.6.7 lib/nanoc/extra/checking/dsl.rb
nanoc-3.6.6 lib/nanoc/extra/checking/dsl.rb
nanoc-3.6.5 lib/nanoc/extra/checking/dsl.rb
nanoc-3.6.4 lib/nanoc/extra/checking/dsl.rb
nanoc-3.6.3 lib/nanoc/extra/checking/dsl.rb
nanoc-3.6.2 lib/nanoc/extra/checking/dsl.rb
nanoc-3.6.1 lib/nanoc/extra/checking/dsl.rb
nanoc-3.6.0 lib/nanoc/extra/checking/dsl.rb
nanoc-3.5.0 lib/nanoc/extra/checking/dsl.rb
nanoc-3.5.0b2 lib/nanoc/extra/checking/dsl.rb
nanoc-3.5.0b1 lib/nanoc/extra/checking/dsl.rb