Class: Nanoc::Extra::Checking::DSL Private

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/extra/checking/dsl.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDSL

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of DSL.



12
13
14
# File 'lib/nanoc/extra/checking/dsl.rb', line 12

def initialize
  @deploy_checks = []
end

Instance Attribute Details

#deploy_checksObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



4
5
6
# File 'lib/nanoc/extra/checking/dsl.rb', line 4

def deploy_checks
  @deploy_checks
end

Class Method Details

.from_file(filename) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



6
7
8
9
10
# 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

Instance Method Details

#check(identifier, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
19
20
# 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) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
# File 'lib/nanoc/extra/checking/dsl.rb', line 22

def deploy_check(*identifiers)
  identifiers.each { |i| @deploy_checks << i }
end