Class: Nanoc::Extra::Checking::DSL
- Inherits:
-
Object
- Object
- Nanoc::Extra::Checking::DSL
- Defined in:
- lib/nanoc/extra/checking/dsl.rb
Instance Attribute Summary (collapse)
-
- (Object) deploy_checks
readonly
Returns the value of attribute deploy_checks.
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (Object) check(identifier, &block)
-
- (Object) deploy_check(*identifiers)
-
- (DSL) initialize
constructor
A new instance of DSL.
Constructor Details
- (DSL) initialize
Returns a new instance of DSL
13 14 15 |
# File 'lib/nanoc/extra/checking/dsl.rb', line 13 def initialize @deploy_checks = [] end |
Instance Attribute Details
- (Object) deploy_checks (readonly)
Returns the value of attribute deploy_checks
5 6 7 |
# File 'lib/nanoc/extra/checking/dsl.rb', line 5 def deploy_checks @deploy_checks end |
Class Method Details
+ (Object) from_file(filename)
7 8 9 10 11 |
# File 'lib/nanoc/extra/checking/dsl.rb', line 7 def self.from_file(filename) dsl = new dsl.instance_eval File.read(filename) dsl end |
Instance Method Details
- (Object) check(identifier, &block)
17 18 19 20 21 |
# File 'lib/nanoc/extra/checking/dsl.rb', line 17 def check(identifier, &block) klass = Class.new(::Nanoc::Extra::Checking::Check) klass.send(:define_method, :run, &block) klass.send(:identifier, identifier) end |
- (Object) deploy_check(*identifiers)
23 24 25 |
# File 'lib/nanoc/extra/checking/dsl.rb', line 23 def deploy_check(*identifiers) identifiers.each { |i| @deploy_checks << i } end |