autoprefixer-rails 10.0.0 → 10.0.1.2

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoprefixer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.0
4
+ version: 10.0.1.2
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-09-16 00:00:00.000000000 Z
11
+ date: 2020-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
@@ -127,28 +127,6 @@ files:
127
127
  - lib/autoprefixer-rails/sprockets.rb
128
128
  - lib/autoprefixer-rails/version.rb
129
129
  - lib/rake/autoprefixer_tasks.rb
130
- - spec/app/Rakefile
131
- - spec/app/app/assets/config/manifest.js
132
- - spec/app/app/assets/stylesheets/evaluate.css.erb
133
- - spec/app/app/assets/stylesheets/loaded.sass
134
- - spec/app/app/assets/stylesheets/sass.sass
135
- - spec/app/app/assets/stylesheets/test.css
136
- - spec/app/app/assets/stylesheets/wrong.css
137
- - spec/app/app/controllers/application_controller.rb
138
- - spec/app/app/controllers/css_controller.rb
139
- - spec/app/config.ru
140
- - spec/app/config/application.rb
141
- - spec/app/config/autoprefixer.yml
142
- - spec/app/config/boot.rb
143
- - spec/app/config/environment.rb
144
- - spec/app/config/environments/test.rb
145
- - spec/app/config/initializers/secret_token.rb
146
- - spec/app/config/routes.rb
147
- - spec/autoprefixer_spec.rb
148
- - spec/processor_spec.rb
149
- - spec/rails_spec.rb
150
- - spec/railtie_spec.rb
151
- - spec/spec_helper.rb
152
130
  - vendor/autoprefixer.js
153
131
  homepage: https://github.com/ai/autoprefixer-rails
154
132
  licenses:
@@ -172,31 +150,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
150
  - !ruby/object:Gem::Version
173
151
  version: '0'
174
152
  requirements: []
175
- rubygems_version: 3.1.2
153
+ rubygems_version: 3.0.3
176
154
  signing_key:
177
155
  specification_version: 4
178
156
  summary: Parse CSS and add vendor prefixes to CSS rules using values from the Can
179
157
  I Use website.
180
- test_files:
181
- - spec/spec_helper.rb
182
- - spec/processor_spec.rb
183
- - spec/app/config.ru
184
- - spec/app/app/assets/stylesheets/evaluate.css.erb
185
- - spec/app/app/assets/stylesheets/test.css
186
- - spec/app/app/assets/stylesheets/loaded.sass
187
- - spec/app/app/assets/stylesheets/sass.sass
188
- - spec/app/app/assets/stylesheets/wrong.css
189
- - spec/app/app/assets/config/manifest.js
190
- - spec/app/app/controllers/css_controller.rb
191
- - spec/app/app/controllers/application_controller.rb
192
- - spec/app/Rakefile
193
- - spec/app/config/environments/test.rb
194
- - spec/app/config/boot.rb
195
- - spec/app/config/initializers/secret_token.rb
196
- - spec/app/config/routes.rb
197
- - spec/app/config/autoprefixer.yml
198
- - spec/app/config/environment.rb
199
- - spec/app/config/application.rb
200
- - spec/railtie_spec.rb
201
- - spec/autoprefixer_spec.rb
202
- - spec/rails_spec.rb
158
+ test_files: []
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require File.expand_path("config/application", __dir__)
4
- 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,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ApplicationController < ActionController::Base
4
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class CssController < ApplicationController
4
- def test
5
- file = params[:exact_file] || params[:file] + ".css"
6
- render plain: Rails.application.assets[file].to_s.gsub(/;(\s})/, '\1')
7
- end
8
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require ::File.expand_path("config/environment", __dir__)
4
- run App::Application
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require File.expand_path("boot", __dir__)
4
-
5
- require "action_controller/railtie"
6
- require "sprockets/railtie"
7
-
8
- Bundler.require(*Rails.groups(assets: %w[development test])) if defined?(Bundler)
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,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
4
- require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "tzinfo"
4
- require File.expand_path("application", __dir__)
5
- App::Application.initialize!
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- App::Application.configure do
4
- config.cache_classes = true
5
- config.eager_load = false
6
- config.consider_all_requests_local = true
7
- config.action_controller.perform_caching = false
8
- config.action_dispatch.show_exceptions = false
9
- config.action_controller.allow_forgery_protection = false
10
- config.active_support.deprecation = :stderr
11
- end
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- App::Application.config.secret_key_base = "test"
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- App::Application.routes.draw do
4
- root to: "css#test"
5
- end
@@ -1,123 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "spec_helper"
4
-
5
- describe AutoprefixerRails do
6
- before :all do
7
- @dir = Pathname(__FILE__).dirname
8
- @css = @dir.join("app/app/assets/stylesheets/test.css").read
9
- end
10
-
11
- it "process CSS" do
12
- expect(AutoprefixerRails.process(@css)).to be_a(AutoprefixerRails::Result)
13
- end
14
-
15
- it "process CSS for selected browsers" do
16
- css = "a {\n tab-size: 2\n}"
17
- result = AutoprefixerRails.process(css, overrideBrowserslist: ["opera 12"])
18
- expect(result.css).to eq "a {\n" \
19
- " -o-tab-size: 2;\n" \
20
- " tab-size: 2\n" \
21
- "}"
22
- end
23
-
24
- it "has browsers option" do
25
- css = "a {\n tab-size: 2\n}"
26
- result = AutoprefixerRails.process(css, browsers: ["opera 12"])
27
- expect(result.css).to eq "a {\n" \
28
- " -o-tab-size: 2;\n" \
29
- " tab-size: 2\n" \
30
- "}"
31
- end
32
-
33
- it "process @supports" do
34
- css = "@supports (display: flex) { }"
35
- result = AutoprefixerRails.process(css, overrideBrowserslist: ["chrome 28"])
36
- expect(result.css).to eq(
37
- "@supports ((display: -webkit-flex) or (display: flex)) { }"
38
- )
39
- end
40
-
41
- it "generates source map" do
42
- result = AutoprefixerRails.process(@css, map: true)
43
- expect(result.css).to include("/*# sourceMappingURL=data:")
44
- end
45
-
46
- it "generates separated source map" do
47
- result = AutoprefixerRails.process(@css, map: { inline: false })
48
- expect(result.map).to be_a(String)
49
- end
50
-
51
- it "uses file name in syntax errors", not_jruby: true do
52
- expect do
53
- AutoprefixerRails.process("a {", from: "a.css")
54
- end.to raise_error(/a.css:/)
55
- end
56
-
57
- it "includes sourcesContent by default" do
58
- map = AutoprefixerRails.process("a{}", map: { inline: false }).map
59
- expect(map).to include("sourcesContent")
60
- end
61
-
62
- it "maps options from Ruby style" do
63
- map = AutoprefixerRails.process("a{}", map: {
64
- sources_content: false,
65
- inline: false
66
- }).map
67
-
68
- expect(map).not_to include("sourcesContent")
69
- end
70
-
71
- it "does not remove old prefixes on request" do
72
- css = "a { -moz-border-radius: 5px; border-radius: 5px }"
73
- result = AutoprefixerRails.process(css, remove: false)
74
- expect(result.css).to eq(css)
75
- end
76
-
77
- it "shows debug" do
78
- info = AutoprefixerRails.processor(overrideBrowserslist: ["chrome 25"]).info
79
- expect(info).to match(/Browsers:\n Chrome: 25\n\n/)
80
- expect(info).to match(/ transition: webkit/)
81
- end
82
-
83
- it "returns warnings" do
84
- css = "a{background:linear-gradient(top,white,black)}"
85
- result = AutoprefixerRails.process(css)
86
- expect(result.warnings).to eq(["<css input>:1:3: Gradient has outdated " \
87
- "direction syntax. New syntax is like `to left` instead of `right`."])
88
- end
89
-
90
- it "shows correct error on country statistics" do
91
- expect do
92
- AutoprefixerRails.process("", overrideBrowserslist: "> 1% in US")
93
- end.to raise_error(/Use Autoprefixer with webpack/)
94
- end
95
-
96
- context "Sprockets" do
97
- before :each do
98
- @assets = Sprockets::Environment.new
99
- @assets.append_path(@dir.join("app/app/assets/stylesheets"))
100
- AutoprefixerRails.install(@assets, overrideBrowserslist: ["chrome 25"])
101
- end
102
-
103
- it "integrates with Sprockets" do
104
- css = @assets["test.css"].to_s
105
- expect(css).to eq "a {\n" \
106
- " -webkit-mask: none;\n" \
107
- " mask: none\n" \
108
- "}\n"
109
- end
110
-
111
- it "shows file name from Sprockets", not_jruby: true do
112
- expect { @assets["wrong.css"] }.to raise_error(/wrong/)
113
- end
114
-
115
- it "supports disabling", not_jruby: true do
116
- AutoprefixerRails.uninstall(@assets)
117
- css = @assets["test.css"].to_s
118
- expect(css).to eq "a {\n" \
119
- " mask: none\n" \
120
- "}\n"
121
- end
122
- end
123
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "spec_helper"
4
-
5
- describe AutoprefixerRails::Processor do
6
- it "parses config" do
7
- config = "# Comment\n ie 11\n \nie 8 # sorry\n[test ]\nios 8"
8
- processor = AutoprefixerRails::Processor.new
9
- expect(processor.parse_config(config)).to eql({
10
- "defaults" => ["ie 11", "ie 8"],
11
- "test" => ["ios 8"]
12
- })
13
- end
14
-
15
- context "without Rails" do
16
- before do
17
- hide_const("Rails")
18
- end
19
-
20
- it "doesn't raise error during processing" do
21
- processor = AutoprefixerRails::Processor.new
22
- expect do
23
- processor.process("")
24
- end.not_to raise_error
25
- end
26
- end
27
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "spec_helper"
4
-
5
- describe CssController, type: :controller do
6
- before :all do
7
- cache = Rails.root.join("tmp/cache")
8
- cache.rmtree if cache.exist?
9
- end
10
-
11
- def test_file(file)
12
- if Rails.version.split(".").first.to_i >= 5
13
- get :test, params: { file: file }
14
- else
15
- get :test, file: file
16
- end
17
- end
18
-
19
- it "integrates with Rails and Sass" do
20
- test_file "sass"
21
- expect(response).to be_successful
22
- clear_css = response.body.tr("\n", " ").squeeze(" ").strip
23
- expect(clear_css).to eq "a{-webkit-mask:none;mask:none}"
24
- end
25
-
26
- if Sprockets::Context.instance_methods.include?(:evaluate)
27
- it "supports evaluate" do
28
- test_file "evaluate"
29
- expect(response).to be_successful
30
- clear_css = response.body.tr("\n", " ").squeeze(" ").strip
31
- expect(clear_css).to eq "a { -webkit-mask: none; mask: none }"
32
- end
33
- end
34
- end
35
-
36
- describe "Rake task" do
37
- it "shows debug" do
38
- info = `cd spec/app; bundle exec rake autoprefixer:info`
39
- expect(info).to match(/Browsers:\n Chrome: 25\n\n/)
40
- expect(info).to match(/ transition: webkit/)
41
- end
42
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "spec_helper"
4
-
5
- describe AutoprefixedRails::Railtie do
6
- before do
7
- @railtie = AutoprefixedRails::Railtie.instance
8
- end
9
-
10
- context "with config/autoprefixer.yml" do
11
- it "works" do
12
- expect(@railtie.config).to eq(cascade: false, supports: false, env: "test")
13
- end
14
- end
15
-
16
- context "with empty config/autoprefixer.yml" do
17
- before do
18
- file_path = File.join(Rails.application.root, "config/autoprefixer.yml")
19
- allow(File).to receive(:exists?).with(file_path) { true }
20
- allow(::YAML).to receive(:load_file).with(file_path) { false } # empty yaml
21
- end
22
-
23
- it "skips empty YAML" do
24
- expect { @railtie.config }.not_to raise_error
25
- end
26
-
27
- it "works" do
28
- expect(@railtie.config).to eq(env: "test")
29
- end
30
- end
31
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ENV["RAILS_ENV"] ||= "test"
4
-
5
- require_relative "app/config/environment"
6
- require "autoprefixer-rails"
7
-
8
- require "rspec/rails"
9
-
10
- warn "ExecJS runtime is #{ExecJS.runtime.class}"
11
-
12
- RSpec.configure do |c|
13
- c.filter_run_excluding not_jruby: RUBY_PLATFORM == "java"
14
- end
15
-
16
- def sprockets_4?
17
- Gem::Version.new(Sprockets::VERSION) > Gem::Version.new("4.0.x")
18
- end