Method: Loquacious::Configuration::Help#print_node

Defined in:
lib/loquacious/configuration/help.rb

Format the attribute name, value, and description and print the results. The value can be printed or not by setting the show_value flag to either true or false. The description can be printed or not by setting the show_description flag to either true or false.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/loquacious/configuration/help.rb', line 179

def print_node( node, show_description, show_value )
  desc = node.desc.to_s.dup
  show_description = false if desc.empty?

  if show_description
    if colorize?
      desc = desc.gsub(%r/([^\n]+)/,
                       self.__send__(@colors[:description], '\1'))
    end
    @io.puts(desc.indent(@desc_leader))
  end

  @io.puts(format_name(node, show_value))
  @io.puts if show_description
end