Sha256: a8c47e5c0506d3e106cb0dda83684efb23957acd2eb86d330d07164d2e4c7e5e
Contents?: true
Size: 594 Bytes
Versions: 14
Compression:
Stored size: 594 Bytes
Contents
module Kubes::Compiler::Shared module CustomHelpers # Load custom helper methods from project @@custom_helpers_loaded = false def load_custom_helpers return if @@custom_helpers_loaded paths = Dir.glob("#{Kubes.root}/.kubes/helpers/**/*.rb") paths.sort_by! { |p| p.size } # so namespaces are loaded first paths.each do |path| filename = path.sub(%r{.*.kubes/helpers/},'').sub('.rb','') module_name = filename.camelize self.class.send :include, module_name.constantize end @@custom_helpers_loaded = true end end end
Version data entries
14 entries across 14 versions & 1 rubygems