Sha256: f05a5ab62701e532e40bb2b8a6cab0fe567b0e5a3ab58e9df09a791585aacbb3

Contents?: true

Size: 986 Bytes

Versions: 9

Compression:

Stored size: 986 Bytes

Contents

require 'autoprefixer-rails'

module Ustyle
  class Engine < ::Rails::Engine
    add_paths_block = lambda { |app|
      Ustyle.asset_directories.each do |asset_directory|
        app.config.assets.paths << File.join(Ustyle.assets_path, asset_directory)
      end
    }

    initializer "ustyle.assets.precompile" do |app|
      app.config.assets.precompile += %w( icons/**.* )
    end

    initializer "ustyle.update_asset_paths", &add_paths_block
    initializer "ustyle.update_asset_paths", group: :assets, &add_paths_block
  end

  class Railtie < ::Rails::Railtie
    if config.respond_to?(:assets) and not config.assets.nil?
      config.assets.configure do |env|
        AutoprefixerRails.install(env, Ustyle.autoprefixer_config)
      end
    else
      initializer :setup_autoprefixer, group: :all do |app|
        if defined? app.assets and not app.assets.nil?
          AutoprefixerRails.install(app.assets, Ustyle.autoprefixer_config)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ustyle-1.12.1 lib/ustyle/engine.rb
ustyle-1.12.0 lib/ustyle/engine.rb
ustyle-1.11.1 lib/ustyle/engine.rb
ustyle-1.10.0 lib/ustyle/engine.rb
ustyle-1.8.7 lib/ustyle/engine.rb
ustyle-1.8.1 lib/ustyle/engine.rb
ustyle-1.8.0 lib/ustyle/engine.rb
ustyle-1.7.0 lib/ustyle/engine.rb
ustyle-1.6.1 lib/ustyle/engine.rb