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



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

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

.require_localObject



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

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)


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

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



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

def namespace_module_name
  __getobj__.class.name.deconstantize
end