module UniverseCompiler::Package::Bootstrap

Constants

DEFAULT_BOOTSTRAP_FILE

Attributes

path[R]

Public Instance Methods

bootstrap_file() click to toggle source
# File lib/universe_compiler/package/bootstrap.rb, line 20
def bootstrap_file
  return nil unless path_valid?
  if File.file? path
    path
  else
    default_bootstrap_file
  end
end
load() click to toggle source
# File lib/universe_compiler/package/bootstrap.rb, line 29
def load
  require bootstrap_file
rescue ScriptError => e
  msg = "Invalid package: '#{bootstrap_file}': #{e.message}"
  UniverseCompiler.logger.error msg
  raise UniverseCompiler::Error.from(e, msg)
end
path=(path) click to toggle source
# File lib/universe_compiler/package/bootstrap.rb, line 10
def path=(path)
  @path = path if path_valid? path
end
path_valid?(path = self.path) click to toggle source
# File lib/universe_compiler/package/bootstrap.rb, line 14
def path_valid?(path = self.path)
  return false unless path.is_a?(String) && File.readable?(path)
  return true if File.file? path
  File.exist? default_bootstrap_file(path)
end

Private Instance Methods

default_bootstrap_file(path = self.path) click to toggle source
# File lib/universe_compiler/package/bootstrap.rb, line 39
def default_bootstrap_file(path = self.path)
  File.join(path, DEFAULT_BOOTSTRAP_FILE)
end