class PuppetGenerator::Middleware::CheckForEmptySource

Public Class Methods

new(app) click to toggle source
# File lib/puppet_generator/middleware/check_for_empty_source.rb, line 4
def initialize(app)
  @app = app
end

Public Instance Methods

call(task) click to toggle source
# 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.meta[:source]}\" is empty." }
  raise PuppetGenerator::Exceptions::EmptySource if task.body.empty?

  @app.call(task)
end