File: engine.rb

package info (click to toggle)
ruby-bootstrap-sass 3.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,368 kB
  • sloc: javascript: 3,526; ruby: 1,211; sh: 57; makefile: 9
file content (17 lines) | stat: -rw-r--r-- 635 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Bootstrap
  module Rails
    class Engine < ::Rails::Engine
      initializer 'bootstrap-sass.assets.precompile' do |app|
        %w(stylesheets javascripts fonts images).each do |sub|
          app.config.assets.paths << root.join('assets', sub).to_s
        end

        # sprockets-rails 3 tracks down the calls to `font_path` and `image_path`
        # and automatically precompiles the referenced assets.
        unless Sprockets::Rails::VERSION.split('.', 2)[0].to_i >= 3
          app.config.assets.precompile << %r(bootstrap/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff2?)$)
        end
      end
    end
  end
end