autoprefixer-rails 9.4.8 → 10.4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +185 -0
  3. data/README.md +25 -33
  4. data/lib/autoprefixer-rails/processor.rb +73 -109
  5. data/lib/autoprefixer-rails/railtie.rb +20 -15
  6. data/lib/autoprefixer-rails/result.rb +2 -0
  7. data/lib/autoprefixer-rails/sprockets.rb +16 -14
  8. data/lib/autoprefixer-rails/version.rb +4 -2
  9. data/lib/autoprefixer-rails.rb +16 -13
  10. data/lib/rake/autoprefixer_tasks.rb +6 -4
  11. data/vendor/autoprefixer.js +72694 -58965
  12. metadata +44 -49
  13. data/.gitignore +0 -7
  14. data/.rspec +0 -1
  15. data/.travis.yml +0 -25
  16. data/Gemfile +0 -9
  17. data/Rakefile +0 -48
  18. data/autoprefixer-rails.gemspec +0 -28
  19. data/spec/app/.browserslistrc +0 -4
  20. data/spec/app/.gitignore +0 -2
  21. data/spec/app/Rakefile +0 -2
  22. data/spec/app/app/assets/config/manifest.js +0 -0
  23. data/spec/app/app/assets/stylesheets/evaluate.css.erb +0 -1
  24. data/spec/app/app/assets/stylesheets/loaded.sass +0 -2
  25. data/spec/app/app/assets/stylesheets/sass.sass +0 -1
  26. data/spec/app/app/assets/stylesheets/test.css +0 -3
  27. data/spec/app/app/assets/stylesheets/wrong.css +0 -2
  28. data/spec/app/app/controllers/application_controller.rb +0 -2
  29. data/spec/app/app/controllers/css_controller.rb +0 -6
  30. data/spec/app/config/application.rb +0 -14
  31. data/spec/app/config/autoprefixer.yml +0 -2
  32. data/spec/app/config/boot.rb +0 -2
  33. data/spec/app/config/environment.rb +0 -3
  34. data/spec/app/config/environments/test.rb +0 -9
  35. data/spec/app/config/initializers/compress.rb +0 -1
  36. data/spec/app/config/initializers/secret_token.rb +0 -1
  37. data/spec/app/config/routes.rb +0 -3
  38. data/spec/app/config.ru +0 -2
  39. data/spec/autoprefixer_spec.rb +0 -112
  40. data/spec/compass/config.rb +0 -34
  41. data/spec/compass/sass/screen.scss +0 -3
  42. data/spec/compass_spec.rb +0 -21
  43. data/spec/processor_spec.rb +0 -14
  44. data/spec/rails_spec.rb +0 -50
  45. data/spec/railtie_spec.rb +0 -29
  46. data/spec/spec_helper.rb +0 -16
  47. data/sprockets4.gemfile +0 -9
@@ -1,4 +1,6 @@
1
- require 'pathname'
1
+ # frozen_string_literal: true
2
+
3
+ require "pathname"
2
4
 
3
5
  module AutoprefixerRails
4
6
  # Register autoprefixer postprocessor in Sprockets and fix common issues
@@ -16,11 +18,11 @@ module AutoprefixerRails
16
18
 
17
19
  # Add prefixes to `css`
18
20
  def self.run(filename, css)
19
- output = filename.chomp(File.extname(filename)) + '.css'
21
+ output = filename.chomp(File.extname(filename)) + ".css"
20
22
  result = @processor.process(css, from: filename, to: output)
21
23
 
22
24
  result.warnings.each do |warning|
23
- $stderr.puts "autoprefixer: #{ warning }"
25
+ warn "autoprefixer: #{warning}"
24
26
  end
25
27
 
26
28
  result.css
@@ -29,33 +31,33 @@ module AutoprefixerRails
29
31
  # Register postprocessor in Sprockets depend on issues with other gems
30
32
  def self.install(env)
31
33
  if ::Sprockets::VERSION.to_f < 4
32
- env.register_postprocessor('text/css',
33
- ::AutoprefixerRails::Sprockets)
34
+ env.register_postprocessor("text/css",
35
+ ::AutoprefixerRails::Sprockets)
34
36
  else
35
- env.register_bundle_processor('text/css',
36
- ::AutoprefixerRails::Sprockets)
37
+ env.register_bundle_processor("text/css",
38
+ ::AutoprefixerRails::Sprockets)
37
39
  end
38
40
  end
39
41
 
40
42
  # Register postprocessor in Sprockets depend on issues with other gems
41
43
  def self.uninstall(env)
42
44
  if ::Sprockets::VERSION.to_f < 4
43
- env.unregister_postprocessor('text/css',
44
- ::AutoprefixerRails::Sprockets)
45
+ env.unregister_postprocessor("text/css",
46
+ ::AutoprefixerRails::Sprockets)
45
47
  else
46
- env.unregister_bundle_processor('text/css',
47
- ::AutoprefixerRails::Sprockets)
48
+ env.unregister_bundle_processor("text/css",
49
+ ::AutoprefixerRails::Sprockets)
48
50
  end
49
51
  end
50
52
 
51
53
  # Sprockets 2 API new and render
52
- def initialize(filename, &block)
54
+ def initialize(filename)
53
55
  @filename = filename
54
- @source = block.call
56
+ @source = yield
55
57
  end
56
58
 
57
59
  # Sprockets 2 API new and render
58
- def render(_, _)
60
+ def render(*)
59
61
  self.class.run(@filename, @source)
60
62
  end
61
63
  end
@@ -1,3 +1,5 @@
1
- module AutoprefixerRails
2
- VERSION = '9.4.8'.freeze unless defined? AutoprefixerRails::VERSION
1
+ # frozen_string_literal: true
2
+
3
+ module AutoprefixerRails # :nodoc:
4
+ VERSION = "10.4.2.0" unless defined? AutoprefixerRails::VERSION
3
5
  end
@@ -1,21 +1,24 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Ruby integration with Autoprefixer JS library, which parse CSS and adds
2
4
  # only actual prefixed
3
5
  module AutoprefixerRails
4
- autoload :Sprockets, 'autoprefixer-rails/sprockets'
6
+ autoload :Sprockets, "autoprefixer-rails/sprockets"
5
7
 
6
8
  # Add prefixes to `css`. See `Processor#process` for options.
7
- def self.process(css, opts = { })
8
- params = { }
9
- params[:browsers] = opts.delete(:browsers) if opts.has_key?(:browsers)
10
- params[:cascade] = opts.delete(:cascade) if opts.has_key?(:cascade)
11
- params[:remove] = opts.delete(:remove) if opts.has_key?(:remove)
12
- params[:env] = opts.delete(:env) if opts.has_key?(:env)
9
+ def self.process(css, opts = {})
10
+ params = {}
11
+ params[:overrideBrowserslist] = opts.delete(:overrideBrowserslist) if opts.key?(:overrideBrowserslist)
12
+ params[:browsers] = opts.delete(:browsers) if opts.key?(:browsers)
13
+ params[:cascade] = opts.delete(:cascade) if opts.key?(:cascade)
14
+ params[:remove] = opts.delete(:remove) if opts.key?(:remove)
15
+ params[:env] = opts.delete(:env) if opts.key?(:env)
13
16
  processor(params).process(css, opts)
14
17
  end
15
18
 
16
19
  # Add Autoprefixer for Sprockets environment in `assets`.
17
20
  # You can specify `browsers` actual in your project.
18
- def self.install(assets, params = { })
21
+ def self.install(assets, params = {})
19
22
  Sprockets.register_processor(processor(params))
20
23
  Sprockets.install(assets)
21
24
  end
@@ -26,13 +29,13 @@ module AutoprefixerRails
26
29
  end
27
30
 
28
31
  # Cache processor instances
29
- def self.processor(params = { })
32
+ def self.processor(params = {})
30
33
  Processor.new(params)
31
34
  end
32
35
  end
33
36
 
34
- require_relative 'autoprefixer-rails/result'
35
- require_relative 'autoprefixer-rails/version'
36
- require_relative 'autoprefixer-rails/processor'
37
+ require_relative "autoprefixer-rails/result"
38
+ require_relative "autoprefixer-rails/version"
39
+ require_relative "autoprefixer-rails/processor"
37
40
 
38
- require_relative 'autoprefixer-rails/railtie' if defined?(Rails)
41
+ require_relative "autoprefixer-rails/railtie" if defined?(Rails)
@@ -1,6 +1,8 @@
1
- require 'rake'
2
- require 'rake/tasklib'
3
- require 'autoprefixer-rails'
1
+ # frozen_string_literal: true
2
+
3
+ require "rake"
4
+ require "rake/tasklib"
5
+ require "autoprefixer-rails"
4
6
 
5
7
  module Rake
6
8
  # Define task to inspect Autoprefixer browsers, properties and values.
@@ -18,7 +20,7 @@ module Rake
18
20
 
19
21
  def define
20
22
  namespace :autoprefixer do
21
- desc 'Show selected browsers and prefixed CSS properties and values'
23
+ desc "Show selected browsers and prefixed CSS properties and values"
22
24
  task :info do
23
25
  puts @processor.info
24
26
  end