Sha256: 0b4fdc82150484555df554ef23f01b5569e7fa8b77184896a7b061b91cd45909

Contents?: true

Size: 767 Bytes

Versions: 6

Compression:

Stored size: 767 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(@@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
      load "tasks/bower.rake"
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
bower-rails-0.7.1 lib/bower-rails/railtie.rb
bower-rails-0.7.0 lib/bower-rails/railtie.rb
bower-rails-0.6.1 lib/bower-rails/railtie.rb
bower-rails-0.6.0 lib/bower-rails/railtie.rb
bower-rails-pt-0.5.0 lib/bower-rails/railtie.rb
bower-rails-0.5.0 lib/bower-rails/railtie.rb