Module: Kernel

Defined in:
lib/agilibox/engine_file.rb

Instance Method Summary collapse

Instance Method Details

#engine_file(engine) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/agilibox/engine_file.rb', line 2

def engine_file(engine)
  app_file      = caller(1..1).first.split(":").first
  app_root      = ::Rails.application.root.to_s
  relative_file = app_file.sub(app_root, "")
  engine_root   = engine::Engine.root.to_s

  ::File.join(engine_root, relative_file)
end