class RBT::ParseConfigureHelp

Constants

BE_VERBOSE
#

BE_VERBOSE

#
CONFIGURE_STRING
#

CONFIGURE_STRING

#
CYAN
DEFAULT_COLOUR
GREEN
RED
#

Some hardcoded-colour definitions.

#

Public Class Methods

new( run_already = false ) click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 40
def initialize(
    run_already = false
  )
  reset
  run if run_already
end

Public Instance Methods

cyan() click to toggle source
#

cyan

#
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 66
def cyan
  CYAN
end
include?(substring, be_verbose = @be_verbose) click to toggle source
#

include?

Will return true if our flag could be found.

#
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 91
def include?(substring, be_verbose = @be_verbose)
  substring = substring.dup if substring.frozen?
  substring.strip! # sanitize our input string
  substring.prepend '--' unless substring.start_with? '-'
  return false if @string.empty? # can never be true if @string is empty
  if @string.include? substring
    if be_verbose
      e '%-5s' % red+'  YES, the configure option `'+substring+'` is included.'+revert
    end
    return true 
  else
    if be_verbose
      e '%-5s' % cyan+'  No, the configure option `'+substring+'` is not included.'+revert
    end
    return false
  end
end
red() click to toggle source
#

red

#
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 73
def red
  RED
end
reset() click to toggle source
#

reset

#
Calls superclass method RBT::Base#reset
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 50
def reset
  super()
  @string = ''.dup # empty on default
  @be_verbose = BE_VERBOSE
end
return_terse_version() click to toggle source
#

return_terse_version

Return a terse version of the string, only if it contains two '-'.

#
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 121
def return_terse_version
  @string.split(N).reject {|x| ! x.include? '--' }
end
revert() click to toggle source
#

revert

#
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 112
def revert # Return to default colour.
  DEFAULT_COLOUR
end
run() click to toggle source
#

run

#
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 138
def run
  sanitize_string
end
sanitize_string( this_string = CONFIGURE_STRING ) click to toggle source
#

sanitize_string

#
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 80
def sanitize_string(
    this_string = CONFIGURE_STRING
  ) # should this be removed??
  @string = `#{this_string}`.to_s.strip if File.exist? 'configure'
end
string()
Alias for: string?
string?() click to toggle source
#

string?

#
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 59
def string?
  @string
end
Also aliased as: string
verbose_include?(s) click to toggle source
#

verbose_include?

Wrapper towards the method above.

#
# File lib/rbt/utility_scripts/parse_configure_help.rb, line 130
def verbose_include?(s)
  @be_verbose = true
  include?(s)
end
Also aliased as: vi?
vi?(s)
Alias for: verbose_include?