lib/autoprefixer-rails/railtie.rb in autoprefixer-rails-9.8.6 vs lib/autoprefixer-rails/railtie.rb in autoprefixer-rails-9.8.6.1
- old
+ new
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
require "yaml"
begin
module AutoprefixedRails
- class Railtie < ::Rails::Railtie
+ class Railtie < ::Rails::Railtie # :nodoc:
rake_tasks do |app|
require "rake/autoprefixer_tasks"
Rake::AutoprefixerTasks.new(config) if defined? app.assets
end
@@ -12,29 +14,28 @@
config.assets.configure do |env|
AutoprefixerRails.install(env, config)
end
else
initializer :setup_autoprefixer, group: :all do |app|
- if defined?(app.assets) && !app.assets.nil?
- AutoprefixerRails.install(app.assets, config)
- end
+ AutoprefixerRails.install(app.assets, config) if defined?(app.assets) && !app.assets.nil?
end
end
# Read browsers requirements from application or engine config
def config
params = {}
roots.each do |root|
file = File.join(root, "config/autoprefixer.yml")
- if File.exist?(file)
- parsed = ::YAML.load_file(file)
- next unless parsed
- params = parsed
+ next unless File.exist?(file)
- break
- end
+ parsed = ::YAML.load_file(file)
+ next unless parsed
+
+ params = parsed
+
+ break
end
params = params.symbolize_keys
params[:env] ||= Rails.env.to_s
params