Method: Jax::Generators::MaterialGenerator.desc

Defined in:
lib/generators/jax/material/material_generator.rb

.desc(description = nil) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/generators/jax/material/material_generator.rb', line 11

def self.desc(description = nil)
  # TODO This can be removed under future versions of Rails, which use ERB for Usage out of the box.
  # TODO it would help if one could configure the location of USAGE
  return super if description
  usage = source_root && File.expand_path("USAGE", File.dirname(__FILE__))

  @desc ||= if usage && File.exist?(usage)
    ERB.new(File.read(usage)).result(binding)
  else
    super
  end
end