class Cookbooks::CreateBigYamlCookbook

Constants

NAMESPACE
#

NAMESPACE

#
STORE_INTO_THIS_FILE
#

STORE_INTO_THIS_FILE

#

Public Class Methods

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

[]

#
# File lib/cookbooks/misc/create_big_yaml_cookbook.rb, line 105
def self.[](i = '')
  self.new
end
new( i = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/cookbooks/misc/create_big_yaml_cookbook.rb, line 36
def initialize(
    i           = nil,
    run_already = true
  )
  reset
  set_input(i)
  run if run_already
end

Public Instance Methods

create_big_yaml_file() click to toggle source
#

#create_big_yaml_file

#
# File lib/cookbooks/misc/create_big_yaml_cookbook.rb, line 72
def create_big_yaml_file
  _ = ::Cookbooks::AvailableCookbooks[].programs?
  _.each {|program|
    opnn; e simp(program)
    hash = {}
    dataset = Cookbooks::Cookbook.return_array(program) { :bypass_menu }
    hash[program] = dataset
    @hash.update(hash)
  }
  what = YAML.dump(@hash)
  into = STORE_INTO_THIS_FILE
  write_what_into(what, into)
  opnn; e 'Storing into `'+sfile(into)+'`.'
end
input?() click to toggle source
#

input?

#
# File lib/cookbooks/misc/create_big_yaml_cookbook.rb, line 65
def input?
  @input
end
opnn() click to toggle source
#

opnn

#
Calls superclass method Cookbooks::Base#opnn
# File lib/cookbooks/misc/create_big_yaml_cookbook.rb, line 90
def opnn
  super(NAMESPACE)
end
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method Cookbooks::Base#reset
# File lib/cookbooks/misc/create_big_yaml_cookbook.rb, line 48
def reset
  super()
  @hash = {} # This is the main Hash.
end
run() click to toggle source
#

run (run tag)

#
# File lib/cookbooks/misc/create_big_yaml_cookbook.rb, line 97
def run
  opnn; e 'Now creating a big yaml file. This will take some time.'
  create_big_yaml_file
end
set_input(i = '') click to toggle source
#

#set_input

#
# File lib/cookbooks/misc/create_big_yaml_cookbook.rb, line 56
def set_input(i = '')
  i = i.first if i.is_a? Array
  i = i.to_s.dup
  @input = i
end