Class: EacRailsBase0::XEngine

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/eac_rails_base0/x_engine.rb

Overview

A extended version of [Rails::Engine].

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.local_rootObject



20
21
22
# File 'lib/eac_rails_base0/x_engine.rb', line 20

def local_root
  ::Rails.root.join(::EacRailsBase0::Paths.engines_subpath)
end

.require_localObject



14
15
16
17
18
# File 'lib/eac_rails_base0/x_engine.rb', line 14

def require_local
  local_roots.each do |root|
    require_dependency "#{root.basename.to_path.gsub('-', '/')}/engine"
  end
end

Instance Method Details

#local?Boolean

Returns:

  • (Boolean)


39
40
41
42
43
# File 'lib/eac_rails_base0/x_engine.rb', line 39

def local?
  return false unless self.class.local_root.directory?

  ::Find.find(self.class.local_root.to_path).include?(config.root.to_path)
end

#namespace_module_nameObject



45
46
47
# File 'lib/eac_rails_base0/x_engine.rb', line 45

def namespace_module_name
  __getobj__.class.name.deconstantize
end