class Cog::GeneratorSandbox
Generators files are executed as instances of this type. Plugins make themselves available to generators via a call to {DSL::Cogfile#autoload_plugin}
Public Class Methods
autoload_plugin(name, path)
click to toggle source
Register an autoload variable. @api developer @return [nil]
# File lib/cog/generator_sandbox.rb, line 26 def self.autoload_plugin(name, path) autoload name, path nil end
new(path)
click to toggle source
@api developer @param path [String] path to the generator ruby file
# File lib/cog/generator_sandbox.rb, line 11 def initialize(path) @path = path end
Public Instance Methods
interpret()
click to toggle source
Interpret the generator ruby file as this instance @api developer @return [nil]
# File lib/cog/generator_sandbox.rb, line 18 def interpret eval File.read(@path), binding nil end