Class: Nanoc::Extra::Checking::DSL Private
- Inherits:
-
Object
- Object
- Nanoc::Extra::Checking::DSL
- 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
- #deploy_checks ⇒ Object readonly private
Class Method Summary collapse
- .from_file(filename) ⇒ Object private
Instance Method Summary collapse
- #check(identifier, &block) ⇒ Object private
- #deploy_check(*identifiers) ⇒ Object private
-
#initialize ⇒ DSL
constructor
private
A new instance of DSL.
Constructor Details
#initialize ⇒ DSL
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_checks ⇒ Object (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 |