Sha256: 1b2d4a0b6c007e5ec0c297c7eb8a01b560221dc8c7acb0639d0c3f93e320b615
Contents?: true
Size: 1.06 KB
Versions: 34
Compression:
Stored size: 1.06 KB
Contents
require "terraspace/bundle" Terraspace::Bundle.setup require "zeitwerk" module Terraspace # These modules are namespaces for user-defined custom helpers module Module; end module Project; end module Stack; end class Autoloader class Inflector < Zeitwerk::Inflector def camelize(basename, _abspath) map = { cli: "CLI", version: "VERSION" } map[basename.to_sym] || super end end class << self def setup loader = Zeitwerk::Loader.new loader.inflector = Inflector.new loader.push_dir(File.dirname(__dir__)) # lib loader.push_dir(project_helpers, namespace: Terraspace::Project) if File.exist?(project_helpers) loader.log! if ENV["TS_AUTOLOAD_LOG"] loader.ignore("#{__dir__}/ext.rb") loader.setup end def project_helpers "#{ts_root}/config/helpers" end # Duplicate definition because autoloader logic runs very early and doesnt have access to core methods yet def ts_root ENV['TS_ROOT'] || Dir.pwd end end end end
Version data entries
34 entries across 34 versions & 1 rubygems