Module: Locomotive::Wagon::Generators::Site

Defined in:
lib/locomotive/wagon/generators/site.rb,
lib/locomotive/wagon/generators/site/base.rb,
lib/locomotive/wagon/generators/site/blank.rb,
lib/locomotive/wagon/generators/site/cloned.rb

Defined Under Namespace

Classes: Base, Blank, Cloned, List

Class Method Summary collapse

Class Method Details

.empty?Boolean

Tell if the list of generators is empty or not .

Returns:

  • (Boolean)

    True if empty



52
53
54
# File 'lib/locomotive/wagon/generators/site.rb', line 52

def self.empty?
  Locomotive::Wagon::Generators::Site::List.instance._list.empty?
end

.get(name) ⇒ Object

Return the information about a generator from its name.

Parameters:

  • name (String)

    The name of the generator

Returns:

  • (Object)

    The information of the found generator or nil



28
29
30
# File 'lib/locomotive/wagon/generators/site.rb', line 28

def self.get(name)
  Locomotive::Wagon::Generators::Site::List.instance.get(name)
end

.listArray

List all the generators

Returns:

  • (Array)

    The filtered (or not) list of generators



36
37
38
# File 'lib/locomotive/wagon/generators/site.rb', line 36

def self.list
  Locomotive::Wagon::Generators::Site::List.instance._list
end

.list_to_jsonString

JSON output of the generators list

Returns:

  • (String)

    The JSON output



44
45
46
# 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) ⇒ Boolean

Register a generator by adding it to the list of existing generators.

Parameters:

  • name (String)

    The name of the generator

  • klass (Class)

    The class of the generator

  • description (String) (defaults to: nil)

    The description of the generator (can be nil)

Returns:

  • (Boolean)

    True if the registration has been successful, false otherwise.



18
19
20
# 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