Sha256: 8a23bc69bee6b29eb39cba7f1cb2efb0d058593e1a09f096718416800d742814

Contents?: true

Size: 1007 Bytes

Versions: 11

Compression:

Stored size: 1007 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/**.* icons.svg forms/*.svg)
    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

11 entries across 11 versions & 2 rubygems

Version Path
reustyle-2.0.9 lib/ustyle/engine.rb
reustyle-2.0.8 lib/ustyle/engine.rb
reustyle-2.0.7 lib/ustyle/engine.rb
ustyle-1.19.2 lib/ustyle/engine.rb
ustyle-1.16.2 lib/ustyle/engine.rb
ustyle-1.16.1 lib/ustyle/engine.rb
ustyle-1.15.3 lib/ustyle/engine.rb
ustyle-1.14.11 lib/ustyle/engine.rb
ustyle-1.14.10 lib/ustyle/engine.rb
ustyle-1.14.0 lib/ustyle/engine.rb
ustyle-1.12.6 lib/ustyle/engine.rb