module Locomotive::Wagon::Generators::Site
Public Class Methods
empty?()
click to toggle source
Tell if the list of generators is empty or not .
@return [ Boolean ] True if empty
# File lib/locomotive/wagon/generators/site.rb, line 52 def self.empty? Locomotive::Wagon::Generators::Site::List.instance._list.empty? end
get(name)
click to toggle source
Return the information about a generator from its name.
@param [ String ] name The name of the generator
@return [ Object ] The information of the found generator or nil
# File lib/locomotive/wagon/generators/site.rb, line 28 def self.get(name) Locomotive::Wagon::Generators::Site::List.instance.get(name) end
list()
click to toggle source
List
all the generators
@return [ Array ] The filtered (or not) list of generators
# File lib/locomotive/wagon/generators/site.rb, line 36 def self.list Locomotive::Wagon::Generators::Site::List.instance._list end
list_to_json()
click to toggle source
JSON output of the generators list
@return [ String ] The JSON output
# File lib/locomotive/wagon/generators/site.rb, line 44 def self.list_to_json Locomotive::Wagon::Generators::Site::List.instance.to_json end
register(name, klass, description = nil)
click to toggle source
Register a generator by adding it to the list of existing generators.
@param [ String ] name The name of the generator @param [ Class ] klass The class of the generator @param [ String ] description The description of the generator (can be nil)
@return [ Boolean ] True if the registration has been successful, false otherwise.
# File lib/locomotive/wagon/generators/site.rb, line 18 def self.register(name, klass, description = nil) Locomotive::Wagon::Generators::Site::List.instance.register(name, klass, description) end