module Tennpipes::Module

Attributes

root[RW]

Public Instance Methods

dependency_paths() click to toggle source

Returns the list of path globs to load as dependencies. Appends custom dependency patterns to the be loaded for Tennpipes.

@return [Array<String>]

The dependency paths.

@example

module MyModule
  extend Tennpipes::Module
  gem! 'my_gem'
end

Module.dependency_paths << "#{MyModule.root}/uploaders/*.rb"
# File lib/tennpipes-base/module.rb, line 51
def dependency_paths
  [
    "#{root}/lib/**/*.rb", "#{root}/shared/lib/**/*.rb",
    "#{root}/models/**/*.rb", "#{root}/shared/models/**/*.rb"
  ]
end
gem!(name) click to toggle source

Register this module as being loaded from a gem. This automatically sets the root and therefore the dependency paths correctly.

@param [String] name

The name of the gem. Has to be the name as stated in the gemspec.

@returns the gems root.

# File lib/tennpipes-base/module.rb, line 13
def gem!(name)
  self.root = Tennpipes.gem(name, self)
end