Class: Stimpack::Integrations::Rails

Inherits:
Object
  • Object
show all
Defined in:
lib/stimpack/integrations/rails.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Rails

Returns a new instance of Rails.



9
10
11
12
13
14
15
16
17
# File 'lib/stimpack/integrations/rails.rb', line 9

def initialize(app)
  @app = app

  Stimpack.config.paths.freeze
  Stimpack.configure_packs

  create_engines
  inject_paths
end

Instance Method Details

#create_enginesObject



19
20
21
22
23
24
25
# File 'lib/stimpack/integrations/rails.rb', line 19

def create_engines
  Packs.all.reject(&:is_gem?).each do |pack|
    next unless pack.['engine']

    create_engine(pack)
  end
end

#inject_pathsObject



27
28
29
30
31
32
33
# File 'lib/stimpack/integrations/rails.rb', line 27

def inject_paths
  Packs.all.reject(&:is_gem?).each do |pack|
    Stimpack.config.paths.each do |path|
      @app.paths[path] << pack.relative_path.join(path)
    end
  end
end