Sha256: 595a5ab9690691b88f601178e6885abbfc77777852b41c8e90d16541f22f1ed6

Contents?: true

Size: 550 Bytes

Versions: 12

Compression:

Stored size: 550 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)
      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

12 entries across 12 versions & 1 rubygems

Version Path
nanoc-4.1.0rc2 lib/nanoc/extra/checking/dsl.rb
nanoc-4.1.0rc1 lib/nanoc/extra/checking/dsl.rb
nanoc-4.1.0b1 lib/nanoc/extra/checking/dsl.rb
nanoc-4.1.0a1 lib/nanoc/extra/checking/dsl.rb
nanoc-4.0.2 lib/nanoc/extra/checking/dsl.rb
nanoc-4.0.1 lib/nanoc/extra/checking/dsl.rb
nanoc-4.0.0 lib/nanoc/extra/checking/dsl.rb
nanoc-4.0.0rc3 lib/nanoc/extra/checking/dsl.rb
nanoc-4.0.0rc2 lib/nanoc/extra/checking/dsl.rb
nanoc-4.0.0rc1 lib/nanoc/extra/checking/dsl.rb
nanoc-4.0.0b4 lib/nanoc/extra/checking/dsl.rb
nanoc-4.0.0b3 lib/nanoc/extra/checking/dsl.rb