class Bcome::Initialization::Factory

Public Class Methods

do() click to toggle source
# File lib/objects/initialization/factory.rb, line 9
def do
  new.do
end
new() click to toggle source
# File lib/objects/initialization/factory.rb, line 14
def initialize
  @created = []
  @exists = []
end

Public Instance Methods

do() click to toggle source
# File lib/objects/initialization/factory.rb, line 19
def do
  puts "\nInitialising Bcome".title.bold
  initialization_paths.each do |conf|
    create_file_utils(conf[:method], conf[:paths])
  end
  summarize(@created, "\nThe following paths were created")
  summarize(@exists, "\nThe following paths exist already, and were untouched")
  puts "\n"
end
summarize(paths, caption) click to toggle source
# File lib/objects/initialization/factory.rb, line 29
def summarize(paths, caption)
  return unless paths.any?

  puts "#{caption}:".informational
  paths.each { |path| puts path.resource_key }
end