Method: Amp::Help::ErbHelpEntry#text

Defined in:
lib/amp-front/help/help.rb

#text(options = {}) ⇒ String

Returns the help text to display for this entry.

For an ERB entry, we run ERB on the text in the entry, while also exposing the options variable as local, so the ERB can access the user’s runtime options.

Parameters:

  • options (Hash) (defaults to: {})

    the options for the process - that way the help commands can access the user’s run-time options and global configuration. For example, if the user passes in –verbose or –quiet, each help entry could handle that differently. Who are we to judge?

Returns:

  • (String)

    the help text for the entry.



205
206
207
208
209
210
# File 'lib/amp-front/help/help.rb', line 205

def text(options = {})
  full_text = super(options)
  
  erb = ERB.new(full_text, 0, "-")
  erb.result binding
end