Sha256: 9ca9eb5c69b56a21ae3ea406d185255f135adf9cb6c7e7d8d51e68d8b3e979b1

Contents?: true

Size: 896 Bytes

Versions: 14

Compression:

Stored size: 896 Bytes

Contents

# frozen_string_literal: true
module UiComponents
  class Engine < ::Rails::Engine
    initializer 'ui_components.assets.add_load_paths' do |app|
      app.config.assets.paths += self.class.components_paths
      app.config.assets.paths << root.join('vendor/assets/bower_components')
    end

    initializer 'ui_components.assets.precompile' do |app|
      app.config.assets.precompile += %w(styleguide.js
                                         styleguide.css)
      app.config.assets.precompile +=
        self.class.components_paths
          .map(&:basename)
          .map { |p| ["#{p}.js", "#{p}.css"] }
          .flatten

      app.config.assets.precompile += %w(chosen/chosen-sprite.png
                                         chosen/chosen-sprite@2x.png)
    end

    def self.components_paths
      Dir[root.join('app/cells/*/')].map { |path| Pathname.new(path) }
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ad2games-ui_components-2.1.0 lib/ui_components/engine.rb
ad2games-ui_components-2.0.14 lib/ui_components/engine.rb
ad2games-ui_components-2.0.12 lib/ui_components/engine.rb
ad2games-ui_components-2.0.11 lib/ui_components/engine.rb
ad2games-ui_components-2.0.10 lib/ui_components/engine.rb
ad2games-ui_components-2.0.9 lib/ui_components/engine.rb
ad2games-ui_components-2.0.8 lib/ui_components/engine.rb
ad2games-ui_components-2.0.7 lib/ui_components/engine.rb
ad2games-ui_components-2.0.5 lib/ui_components/engine.rb
ad2games-ui_components-2.0.4 lib/ui_components/engine.rb
ad2games-ui_components-2.0.3 lib/ui_components/engine.rb
ad2games-ui_components-2.0.2 lib/ui_components/engine.rb
ad2games-ui_components-2.0.1 lib/ui_components/engine.rb
ad2games-ui_components-2.0.0 lib/ui_components/engine.rb