Sha256: 296f7e80783a04ef0b649cd1da7f595db59365427eb5aadbe7b5f6811db2a118

Contents?: true

Size: 833 Bytes

Versions: 4

Compression:

Stored size: 833 Bytes

Contents

require 'bower-rails'
require 'bower-rails/dsl'
require 'rails'

module BowerRails
  class Railtie < Rails::Railtie
    railtie_name :bower
    @@bowerfile = File.join("Bowerfile")

    if File.exist?(@@bowerfile)
      config.before_initialize do |app|
        @dsl = BowerRails::Dsl.evalute(BowerRails.root_path, @@bowerfile)
        @dsl.final_assets_path.map do |assets_root, assets_path|
          app.config.assets.paths << Rails.root.join(assets_root, assets_path, "bower_components")
        end
      end
    else
      config.before_initialize do |app|
        ["lib", "vendor"].each do |dir|
          app.config.assets.paths << Rails.root.join(dir, 'assets', 'bower_components')
        end
      end
    end

    rake_tasks do
      require "tasks/helpers/before_hook.rb"
      load "tasks/bower.rake"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bower-rails-0.8.3 lib/bower-rails/railtie.rb
bower-rails-0.8.2 lib/bower-rails/railtie.rb
bower-rails-0.8.1 lib/bower-rails/railtie.rb
bower-rails-0.8.0 lib/bower-rails/railtie.rb