Sha256: 94143017e73b857c3eddcc4cdac085ae3d78f81def95ca3a7b2d04037e9ddd1e

Contents?: true

Size: 887 Bytes

Versions: 9

Compression:

Stored size: 887 Bytes

Contents

require 'yaml'

begin
  require 'sprockets/railtie'

  module AutoprefixedRails
    class Railtie < ::Rails::Railtie
      rake_tasks do |app|
        require 'rake/autoprefixer_tasks'
        Rake::AutoprefixerTasks.new( config(app.root) )
      end

      if config.respond_to?(:assets)
        config.assets.configure do |env|
          AutoprefixerRails.install(env, config(env.root))
        end
      else
        initializer :setup_autoprefixer, group: :all do |app|
          AutoprefixerRails.install(app.assets, config(app.root))
        end
      end

      # Read browsers requirements from application config
      def config(root)
        file   = File.join(root, 'config/autoprefixer.yml')
        params = ::YAML.load_file(file) if File.exist?(file)
        params ||= {}
        params = params.symbolize_keys
        params
      end
    end
  end
rescue LoadError
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
autoprefixer-rails-6.1.2 lib/autoprefixer-rails/railtie.rb
autoprefixer-rails-6.1.1 lib/autoprefixer-rails/railtie.rb
autoprefixer-rails-6.1.0.1 lib/autoprefixer-rails/railtie.rb
autoprefixer-rails-6.1.0 lib/autoprefixer-rails/railtie.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/autoprefixer-rails-6.0.3/lib/autoprefixer-rails/railtie.rb
autoprefixer-rails-6.0.3 lib/autoprefixer-rails/railtie.rb
autoprefixer-rails-6.0.2 lib/autoprefixer-rails/railtie.rb
autoprefixer-rails-6.0.1 lib/autoprefixer-rails/railtie.rb
autoprefixer-rails-6.0.0 lib/autoprefixer-rails/railtie.rb