class Cookbooks::AllowedCookbookEntries

Constants

COLOURIZE_THE_FIRST_CHARACTER
#

Cookbooks::AllowedCookbookEntries::COLOURIZE_THE_FIRST_CHARACTER

#
NAMESPACE
#

NAMESPACE

#

Public Class Methods

[](i = '') click to toggle source
#

AllowedCookbookEntries[]

#
# File lib/cookbooks/utility_scripts/allowed_cookbook_entries.rb, line 80
def self.[](i = '')
  self.new
end
e(i = '') click to toggle source
#

::e

#
# File lib/cookbooks/utility_scripts/allowed_cookbook_entries.rb, line 49
def self.e(i = '')
  ::Cookbooks.e(i)
end
new(run_already = true) click to toggle source
#

initialize

#
Calls superclass method
# File lib/cookbooks/utility_scripts/allowed_cookbook_entries.rb, line 40
def initialize(run_already = true)
  super()
  reset
  run if run_already
end
opnn() click to toggle source
#

::opnn

#
# File lib/cookbooks/utility_scripts/allowed_cookbook_entries.rb, line 73
def self.opnn
  Opn.opn(use_this_as_namespace: NAMESPACE)
end
report_allowed_entries() click to toggle source
#

::report_allowed_entries

#
# File lib/cookbooks/utility_scripts/allowed_cookbook_entries.rb, line 56
def self.report_allowed_entries
  e; opnn; e 'The following entries are registered in the file '
  opnn; e ::Cookbooks.sfile('registered_cookbook_entries.rb')+', in the '
  opnn; e 'constant '+::Cookbooks.simp('REGISTERED_COOKBOOK_ENTRIES')+', and thus '\
          'valid:'; e
  REGISTERED_COOKBOOK_ENTRIES.each_with_index {|entry, index|
    index += 1
    if COLOURIZE_THE_FIRST_CHARACTER
      entry[0,1] = ::Cookbooks.swarn(entry[0,1]) # Make the first character red.
    end
    e ::Cookbooks.sfancy(index.to_s.rjust(3))+') '+entry
  }; e # Need to output a terminating-newline here for consistency with the above.
end

Public Instance Methods

run() click to toggle source
#

run

We redirect to a class method here.

#
# File lib/cookbooks/utility_scripts/allowed_cookbook_entries.rb, line 89
def run
  AllowedCookbookEntries.report_allowed_entries # Call the class method here.
end