Class: PuppetGenerator::Middleware::CheckForEmptySource
- Inherits:
-
Object
- Object
- PuppetGenerator::Middleware::CheckForEmptySource
- Defined in:
- lib/puppet_generator/middleware/check_for_empty_source.rb
Instance Method Summary collapse
- #call(task) ⇒ Object
-
#initialize(app) ⇒ CheckForEmptySource
constructor
A new instance of CheckForEmptySource.
Constructor Details
#initialize(app) ⇒ CheckForEmptySource
Returns a new instance of CheckForEmptySource.
4 5 6 |
# File 'lib/puppet_generator/middleware/check_for_empty_source.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(task) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/puppet_generator/middleware/check_for_empty_source.rb', line 8 def call(task) PuppetGenerator.logger.debug(self.class.name){ "Checking if given source \"#{task.[:source]}\" is empty." } raise PuppetGenerator::Exceptions::EmptySource if task.body.empty? @app.call(task) end |