Class: Packs::Rails::Stim

Inherits:
Module
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/packs/rails/stim.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Constructor Details

#initialize(pack, namespace) ⇒ Stim

Returns a new instance of Stim.



9
10
11
12
13
# File 'lib/packs/rails/stim.rb', line 9

def initialize(pack, namespace)
  @pack = pack
  @namespace = namespace
  super()
end

Instance Method Details

#included(engine) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/packs/rails/stim.rb', line 15

def included(engine)
  engine.called_from = @pack.relative_path
  engine.extend(ClassMethods)
  engine.isolate_namespace(@namespace)

  # Set all of these paths to nil because we want the Rails integration to take
  # care of them. The purpose of this Engine is really just for the namespace
  # isolation.
  (Packs::Rails.config.paths +
    # In addition to the paths we've delegated to the main app, we don't allow
    # Engine Packs to have various capabilities.
    %w(
      config/environments
      db/migrate
    )
  ).uniq.each do |path|
    engine.paths[path] = nil
  end
end