autoprefixer-rails 9.8.5 → 10.4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +95 -0
  3. data/README.md +9 -8
  4. data/lib/autoprefixer-rails/processor.rb +43 -72
  5. data/lib/autoprefixer-rails/railtie.rb +15 -10
  6. data/lib/autoprefixer-rails/result.rb +2 -0
  7. data/lib/autoprefixer-rails/sprockets.rb +7 -5
  8. data/lib/autoprefixer-rails/version.rb +4 -2
  9. data/lib/autoprefixer-rails.rb +3 -3
  10. data/lib/rake/autoprefixer_tasks.rb +2 -0
  11. data/vendor/autoprefixer.js +72678 -65743
  12. metadata +40 -38
  13. data/Rakefile +0 -53
  14. data/autoprefixer-rails.gemspec +0 -33
  15. data/spec/app/.browserslistrc +0 -4
  16. data/spec/app/.gitignore +0 -2
  17. data/spec/app/Rakefile +0 -2
  18. data/spec/app/app/assets/config/manifest.js +0 -0
  19. data/spec/app/app/assets/stylesheets/evaluate.css.erb +0 -1
  20. data/spec/app/app/assets/stylesheets/loaded.sass +0 -2
  21. data/spec/app/app/assets/stylesheets/sass.sass +0 -1
  22. data/spec/app/app/assets/stylesheets/test.css +0 -3
  23. data/spec/app/app/assets/stylesheets/wrong.css +0 -2
  24. data/spec/app/app/controllers/application_controller.rb +0 -2
  25. data/spec/app/app/controllers/css_controller.rb +0 -6
  26. data/spec/app/config/application.rb +0 -16
  27. data/spec/app/config/autoprefixer.yml +0 -2
  28. data/spec/app/config/boot.rb +0 -2
  29. data/spec/app/config/environment.rb +0 -3
  30. data/spec/app/config/environments/test.rb +0 -9
  31. data/spec/app/config/initializers/secret_token.rb +0 -1
  32. data/spec/app/config/routes.rb +0 -3
  33. data/spec/app/config.ru +0 -2
  34. data/spec/autoprefixer_spec.rb +0 -121
  35. data/spec/processor_spec.rb +0 -25
  36. data/spec/rails_spec.rb +0 -40
  37. data/spec/railtie_spec.rb +0 -29
  38. data/spec/spec_helper.rb +0 -16
metadata CHANGED
@@ -1,31 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoprefixer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.8.5
4
+ version: 10.4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Sitnik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-11 00:00:00.000000000 Z
11
+ date: 2022-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rails
42
+ name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.85.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.85.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-packaging
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.1.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.1.1
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: standard
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -92,8 +120,6 @@ files:
92
120
  - CHANGELOG.md
93
121
  - LICENSE
94
122
  - README.md
95
- - Rakefile
96
- - autoprefixer-rails.gemspec
97
123
  - lib/autoprefixer-rails.rb
98
124
  - lib/autoprefixer-rails/processor.rb
99
125
  - lib/autoprefixer-rails/railtie.rb
@@ -101,30 +127,6 @@ files:
101
127
  - lib/autoprefixer-rails/sprockets.rb
102
128
  - lib/autoprefixer-rails/version.rb
103
129
  - lib/rake/autoprefixer_tasks.rb
104
- - spec/app/.browserslistrc
105
- - spec/app/.gitignore
106
- - spec/app/Rakefile
107
- - spec/app/app/assets/config/manifest.js
108
- - spec/app/app/assets/stylesheets/evaluate.css.erb
109
- - spec/app/app/assets/stylesheets/loaded.sass
110
- - spec/app/app/assets/stylesheets/sass.sass
111
- - spec/app/app/assets/stylesheets/test.css
112
- - spec/app/app/assets/stylesheets/wrong.css
113
- - spec/app/app/controllers/application_controller.rb
114
- - spec/app/app/controllers/css_controller.rb
115
- - spec/app/config.ru
116
- - spec/app/config/application.rb
117
- - spec/app/config/autoprefixer.yml
118
- - spec/app/config/boot.rb
119
- - spec/app/config/environment.rb
120
- - spec/app/config/environments/test.rb
121
- - spec/app/config/initializers/secret_token.rb
122
- - spec/app/config/routes.rb
123
- - spec/autoprefixer_spec.rb
124
- - spec/processor_spec.rb
125
- - spec/rails_spec.rb
126
- - spec/railtie_spec.rb
127
- - spec/spec_helper.rb
128
130
  - vendor/autoprefixer.js
129
131
  homepage: https://github.com/ai/autoprefixer-rails
130
132
  licenses:
@@ -141,16 +143,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
143
  requirements:
142
144
  - - ">="
143
145
  - !ruby/object:Gem::Version
144
- version: '2.0'
146
+ version: '2.4'
145
147
  required_rubygems_version: !ruby/object:Gem::Requirement
146
148
  requirements:
147
149
  - - ">="
148
150
  - !ruby/object:Gem::Version
149
151
  version: '0'
150
152
  requirements: []
151
- rubygems_version: 3.1.2
153
+ rubygems_version: 3.0.3
152
154
  signing_key:
153
155
  specification_version: 4
154
- summary: Parse CSS and add vendor prefixes to CSS rules usingvalues from the Can I
155
- Use website.
156
+ summary: Parse CSS and add vendor prefixes to CSS rules using values from the Can
157
+ I Use website.
156
158
  test_files: []
data/Rakefile DELETED
@@ -1,53 +0,0 @@
1
- require "rubygems"
2
-
3
- require "bundler/setup"
4
- Bundler::GemHelper.install_tasks
5
-
6
- require "standard/rake"
7
-
8
- require "rspec/core/rake_task"
9
- RSpec::Core::RakeTask.new
10
- task default: [:spec, "standard:fix"]
11
-
12
- task :clobber_package do
13
- begin
14
- rm_r "pkg"
15
- rescue
16
- nil
17
- end
18
- end
19
-
20
- desc "Delete all generated files"
21
- task clobber: [:clobber_package]
22
-
23
- desc "Test all Gemfiles from spec/*.gemfile"
24
- task :test_all do
25
- require "pty"
26
- require "shellwords"
27
- cmd = "bundle update && bundle exec rake --trace"
28
- statuses = Dir.glob("./sprockets*.gemfile").map { |gemfile|
29
- Bundler.with_clean_env do
30
- env = {"BUNDLE_GEMFILE" => gemfile}
31
- warn "Testing #{File.basename(gemfile)}:"
32
- warn " export BUNDLE_GEMFILE=#{gemfile}"
33
- warn " #{cmd}"
34
- PTY.spawn(env, cmd) do |r, _w, pid|
35
- begin
36
- r.each_line { |l| puts l }
37
- rescue Errno::EIO
38
- # Errno:EIO error means that the process has finished giving output.
39
- ensure
40
- ::Process.wait pid
41
- end
42
- end
43
- [$? && $?.exitstatus == 0, gemfile]
44
- end
45
- }
46
- failed = statuses.reject(&:first).map(&:last)
47
- if failed.empty?
48
- warn "✓ Tests pass with all #{statuses.size} gemfiles"
49
- else
50
- warn "❌ FAILING #{failed * "\n"}"
51
- exit 1
52
- end
53
- end
@@ -1,33 +0,0 @@
1
- require File.expand_path("../lib/autoprefixer-rails/version", __FILE__)
2
-
3
- Gem::Specification.new do |s|
4
- s.platform = Gem::Platform::RUBY
5
- s.name = "autoprefixer-rails"
6
- s.version = AutoprefixerRails::VERSION.dup
7
- s.date = Time.now.strftime("%Y-%m-%d")
8
- s.summary = "Parse CSS and add vendor prefixes to CSS rules using" \
9
- "values from the Can I Use website."
10
-
11
- s.files = `git ls-files`.split("\n")
12
- s.files.reject! { |i| i =~ /^\.|build.sh|Dockerfile|Gemfile/ }
13
- s.test_files = `git ls-files -- {spec}/*`.split("\n")
14
- s.extra_rdoc_files = ["README.md", "LICENSE", "CHANGELOG.md"]
15
- s.require_path = "lib"
16
- s.required_ruby_version = ">= 2.0"
17
-
18
- s.author = "Andrey Sitnik"
19
- s.email = "andrey@sitnik.ru"
20
- s.homepage = "https://github.com/ai/autoprefixer-rails"
21
- s.license = "MIT"
22
-
23
- s.add_dependency "execjs", ">= 0"
24
-
25
- s.add_development_dependency "rake"
26
- s.add_development_dependency "rails"
27
- s.add_development_dependency "rspec-rails"
28
- s.add_development_dependency "standard"
29
-
30
- s.metadata["changelog_uri"] = "https://github.com/ai/autoprefixer-rails/blob/master/CHANGELOG.md"
31
- s.metadata["source_code_uri"] = "https://github.com/ai/autoprefixer-rails"
32
- s.metadata["bug_tracker_uri"] = "https://github.com/ai/autoprefixer-rails/issues"
33
- end
@@ -1,4 +0,0 @@
1
- ie 11
2
-
3
- [test]
4
- chrome 25
data/spec/app/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- /log
2
- /tmp
data/spec/app/Rakefile DELETED
@@ -1,2 +0,0 @@
1
- require File.expand_path("../config/application", __FILE__)
2
- App::Application.load_tasks
File without changes
@@ -1 +0,0 @@
1
- <%= evaluate 'test.css' %>
@@ -1,2 +0,0 @@
1
- a
2
- mask: none
@@ -1 +0,0 @@
1
- @import "loaded"
@@ -1,3 +0,0 @@
1
- a {
2
- mask: none
3
- }
@@ -1,2 +0,0 @@
1
- a {
2
- background: linear-gradient(top, white, black)
@@ -1,2 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- end
@@ -1,6 +0,0 @@
1
- class CssController < ApplicationController
2
- def test
3
- file = params[:exact_file] || params[:file] + ".css"
4
- render plain: Rails.application.assets[file].to_s.gsub(/;(\s})/, '\1')
5
- end
6
- end
@@ -1,16 +0,0 @@
1
- require File.expand_path("../boot", __FILE__)
2
-
3
- require "action_controller/railtie"
4
- require "sprockets/railtie"
5
-
6
- if defined?(Bundler)
7
- Bundler.require(*Rails.groups(assets: %w[development test]))
8
- end
9
-
10
- module App
11
- class Application < Rails::Application
12
- config.assets.enabled = true
13
- config.sass.line_comments = false
14
- config.sass.inline_source_maps = true
15
- end
16
- end
@@ -1,2 +0,0 @@
1
- supports: false
2
- cascade: false
@@ -1,2 +0,0 @@
1
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../../Gemfile", __FILE__)
2
- require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
@@ -1,3 +0,0 @@
1
- require "tzinfo"
2
- require File.expand_path("../application", __FILE__)
3
- App::Application.initialize!
@@ -1,9 +0,0 @@
1
- App::Application.configure do
2
- config.cache_classes = true
3
- config.eager_load = false
4
- config.consider_all_requests_local = true
5
- config.action_controller.perform_caching = false
6
- config.action_dispatch.show_exceptions = false
7
- config.action_controller.allow_forgery_protection = false
8
- config.active_support.deprecation = :stderr
9
- end
@@ -1 +0,0 @@
1
- App::Application.config.secret_key_base = "test"
@@ -1,3 +0,0 @@
1
- App::Application.routes.draw do
2
- root to: "css#test"
3
- end
data/spec/app/config.ru DELETED
@@ -1,2 +0,0 @@
1
- require ::File.expand_path("../config/environment", __FILE__)
2
- run App::Application
@@ -1,121 +0,0 @@
1
- require_relative "spec_helper"
2
-
3
- describe AutoprefixerRails do
4
- before :all do
5
- @dir = Pathname(__FILE__).dirname
6
- @css = @dir.join("app/app/assets/stylesheets/test.css").read
7
- end
8
-
9
- it "process CSS" do
10
- expect(AutoprefixerRails.process(@css)).to be_a(AutoprefixerRails::Result)
11
- end
12
-
13
- it "process CSS for selected browsers" do
14
- css = "a {\n tab-size: 2\n}"
15
- result = AutoprefixerRails.process(css, overrideBrowserslist: ["opera 12"])
16
- expect(result.css).to eq "a {\n" \
17
- " -o-tab-size: 2;\n" \
18
- " tab-size: 2\n" \
19
- "}"
20
- end
21
-
22
- it "has browsers option" do
23
- css = "a {\n tab-size: 2\n}"
24
- result = AutoprefixerRails.process(css, browsers: ["opera 12"])
25
- expect(result.css).to eq "a {\n" \
26
- " -o-tab-size: 2;\n" \
27
- " tab-size: 2\n" \
28
- "}"
29
- end
30
-
31
- it "process @supports" do
32
- css = "@supports (display: flex) { }"
33
- result = AutoprefixerRails.process(css, overrideBrowserslist: ["chrome 28"])
34
- expect(result.css).to eq(
35
- "@supports ((display: -webkit-flex) or (display: flex)) { }"
36
- )
37
- end
38
-
39
- it "generates source map" do
40
- result = AutoprefixerRails.process(@css, map: true)
41
- expect(result.css).to include("/*# sourceMappingURL=data:")
42
- end
43
-
44
- it "generates separated source map" do
45
- result = AutoprefixerRails.process(@css, map: {inline: false})
46
- expect(result.map).to be_a(String)
47
- end
48
-
49
- it "uses file name in syntax errors", not_jruby: true do
50
- expect {
51
- AutoprefixerRails.process("a {", from: "a.css")
52
- }.to raise_error(/a.css:/)
53
- end
54
-
55
- it "includes sourcesContent by default" do
56
- map = AutoprefixerRails.process("a{}", map: {inline: false}).map
57
- expect(map).to include("sourcesContent")
58
- end
59
-
60
- it "maps options from Ruby style" do
61
- map = AutoprefixerRails.process("a{}", map: {
62
- sources_content: false,
63
- inline: false,
64
- }).map
65
-
66
- expect(map).not_to include("sourcesContent")
67
- end
68
-
69
- it "does not remove old prefixes on request" do
70
- css = "a { -moz-border-radius: 5px; border-radius: 5px }"
71
- result = AutoprefixerRails.process(css, remove: false)
72
- expect(result.css).to eq(css)
73
- end
74
-
75
- it "shows debug" do
76
- info = AutoprefixerRails.processor(overrideBrowserslist: ["chrome 25"]).info
77
- expect(info).to match(/Browsers:\n Chrome: 25\n\n/)
78
- expect(info).to match(/ transition: webkit/)
79
- end
80
-
81
- it "returns warnings" do
82
- css = "a{background:linear-gradient(top,white,black)}"
83
- result = AutoprefixerRails.process(css)
84
- expect(result.warnings).to eq(["<css input>:1:3: Gradient has outdated " \
85
- "direction syntax. New syntax is like `to left` instead of `right`."])
86
- end
87
-
88
- it "shows correct error on country statistics" do
89
- expect {
90
- AutoprefixerRails.process("", overrideBrowserslist: "> 1% in US")
91
- }.to raise_error(/Use Autoprefixer with webpack/)
92
- end
93
-
94
- context "Sprockets" do
95
- before :each do
96
- @assets = Sprockets::Environment.new
97
- @assets.append_path(@dir.join("app/app/assets/stylesheets"))
98
- AutoprefixerRails.install(@assets, overrideBrowserslist: ["chrome 25"])
99
- end
100
-
101
- it "integrates with Sprockets" do
102
- css = @assets["test.css"].to_s
103
- expect(css).to eq "a {\n" \
104
- " -webkit-mask: none;\n" \
105
- " mask: none\n" \
106
- "}\n"
107
- end
108
-
109
- it "shows file name from Sprockets", not_jruby: true do
110
- expect { @assets["wrong.css"] }.to raise_error(/wrong/)
111
- end
112
-
113
- it "supports disabling", not_jruby: true do
114
- AutoprefixerRails.uninstall(@assets)
115
- css = @assets["test.css"].to_s
116
- expect(css).to eq "a {\n" \
117
- " mask: none\n" \
118
- "}\n"
119
- end
120
- end
121
- end
@@ -1,25 +0,0 @@
1
- require_relative "spec_helper"
2
-
3
- describe AutoprefixerRails::Processor do
4
- it "parses config" do
5
- config = "# Comment\n ie 11\n \nie 8 # sorry\n[test ]\nios 8"
6
- processor = AutoprefixerRails::Processor.new
7
- expect(processor.parse_config(config)).to eql({
8
- "defaults" => ["ie 11", "ie 8"],
9
- "test" => ["ios 8"],
10
- })
11
- end
12
-
13
- context "without Rails" do
14
- before do
15
- hide_const("Rails")
16
- end
17
-
18
- it "doesn't raise error during processing" do
19
- processor = AutoprefixerRails::Processor.new
20
- expect {
21
- processor.process("")
22
- }.not_to raise_error
23
- end
24
- end
25
- end
data/spec/rails_spec.rb DELETED
@@ -1,40 +0,0 @@
1
- require_relative "spec_helper"
2
-
3
- describe CssController, type: :controller do
4
- before :all do
5
- cache = Rails.root.join("tmp/cache")
6
- cache.rmtree if cache.exist?
7
- end
8
-
9
- def test_file(file)
10
- if Rails.version.split(".").first.to_i >= 5
11
- get :test, params: {file: file}
12
- else
13
- get :test, file: file
14
- end
15
- end
16
-
17
- it "integrates with Rails and Sass" do
18
- test_file "sass"
19
- expect(response).to be_successful
20
- clear_css = response.body.tr("\n", " ").squeeze(" ").strip
21
- expect(clear_css).to eq "a{-webkit-mask:none;mask:none}"
22
- end
23
-
24
- if Sprockets::Context.instance_methods.include?(:evaluate)
25
- it "supports evaluate" do
26
- test_file "evaluate"
27
- expect(response).to be_successful
28
- clear_css = response.body.tr("\n", " ").squeeze(" ").strip
29
- expect(clear_css).to eq "a { -webkit-mask: none; mask: none }"
30
- end
31
- end
32
- end
33
-
34
- describe "Rake task" do
35
- it "shows debug" do
36
- info = `cd spec/app; bundle exec rake autoprefixer:info`
37
- expect(info).to match(/Browsers:\n Chrome: 25\n\n/)
38
- expect(info).to match(/ transition: webkit/)
39
- end
40
- end
data/spec/railtie_spec.rb DELETED
@@ -1,29 +0,0 @@
1
- require_relative "spec_helper"
2
-
3
- describe AutoprefixedRails::Railtie do
4
- before do
5
- @railtie = AutoprefixedRails::Railtie.instance
6
- end
7
-
8
- context "with config/autoprefixer.yml" do
9
- it "works" do
10
- expect(@railtie.config).to eq(cascade: false, supports: false, env: "test")
11
- end
12
- end
13
-
14
- context "with empty config/autoprefixer.yml" do
15
- before do
16
- file_path = File.join(Rails.application.root, "config/autoprefixer.yml")
17
- allow(File).to receive(:exists?).with(file_path) { true }
18
- allow(::YAML).to receive(:load_file).with(file_path) { false } # empty yaml
19
- end
20
-
21
- it "skips empty YAML" do
22
- expect { @railtie.config }.not_to raise_error
23
- end
24
-
25
- it "works" do
26
- expect(@railtie.config).to eq(env: "test")
27
- end
28
- end
29
- end
data/spec/spec_helper.rb DELETED
@@ -1,16 +0,0 @@
1
- ENV["RAILS_ENV"] ||= "test"
2
-
3
- require_relative "app/config/environment"
4
- require_relative "../lib/autoprefixer-rails"
5
-
6
- require "rspec/rails"
7
-
8
- STDERR.puts "ExecJS runtime is #{ExecJS.runtime.class}"
9
-
10
- RSpec.configure do |c|
11
- c.filter_run_excluding not_jruby: RUBY_PLATFORM == "java"
12
- end
13
-
14
- def sprockets_4?
15
- Gem::Version.new(Sprockets::VERSION) > Gem::Version.new("4.0.x")
16
- end