autoprefixer-rails 9.8.6.3 → 10.4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +82 -0
- data/README.md +2 -5
- data/lib/autoprefixer-rails/processor.rb +30 -74
- data/lib/autoprefixer-rails/railtie.rb +4 -0
- data/lib/autoprefixer-rails/sprockets.rb +1 -1
- data/lib/autoprefixer-rails/version.rb +1 -1
- data/vendor/autoprefixer.js +72678 -65987
- metadata +9 -55
- data/spec/app/Rakefile +0 -4
- data/spec/app/app/assets/config/manifest.js +0 -0
- data/spec/app/app/assets/stylesheets/evaluate.css.erb +0 -1
- data/spec/app/app/assets/stylesheets/loaded.sass +0 -2
- data/spec/app/app/assets/stylesheets/sass.sass +0 -1
- data/spec/app/app/assets/stylesheets/test.css +0 -3
- data/spec/app/app/assets/stylesheets/wrong.css +0 -2
- data/spec/app/app/controllers/application_controller.rb +0 -4
- data/spec/app/app/controllers/css_controller.rb +0 -8
- data/spec/app/config/application.rb +0 -16
- data/spec/app/config/autoprefixer.yml +0 -2
- data/spec/app/config/boot.rb +0 -4
- data/spec/app/config/environment.rb +0 -5
- data/spec/app/config/environments/test.rb +0 -11
- data/spec/app/config/initializers/secret_token.rb +0 -3
- data/spec/app/config/routes.rb +0 -5
- data/spec/app/config.ru +0 -4
- data/spec/autoprefixer_spec.rb +0 -123
- data/spec/processor_spec.rb +0 -27
- data/spec/rails_spec.rb +0 -42
- data/spec/railtie_spec.rb +0 -31
- data/spec/spec_helper.rb +0 -18
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autoprefixer-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
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:
|
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: '
|
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: '
|
26
|
+
version: '2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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:
|
@@ -157,9 +135,7 @@ metadata:
|
|
157
135
|
changelog_uri: https://github.com/ai/autoprefixer-rails/blob/master/CHANGELOG.md
|
158
136
|
source_code_uri: https://github.com/ai/autoprefixer-rails
|
159
137
|
bug_tracker_uri: https://github.com/ai/autoprefixer-rails/issues
|
160
|
-
post_install_message:
|
161
|
-
autoprefixer-rails was deprected. Migration guide:
|
162
|
-
https://github.com/ai/autoprefixer-rails/wiki/Deprecated
|
138
|
+
post_install_message:
|
163
139
|
rdoc_options: []
|
164
140
|
require_paths:
|
165
141
|
- lib
|
@@ -174,31 +150,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
150
|
- !ruby/object:Gem::Version
|
175
151
|
version: '0'
|
176
152
|
requirements: []
|
177
|
-
rubygems_version: 3.
|
153
|
+
rubygems_version: 3.0.3
|
178
154
|
signing_key:
|
179
155
|
specification_version: 4
|
180
156
|
summary: Parse CSS and add vendor prefixes to CSS rules using values from the Can
|
181
157
|
I Use website.
|
182
|
-
test_files:
|
183
|
-
- spec/spec_helper.rb
|
184
|
-
- spec/processor_spec.rb
|
185
|
-
- spec/app/config.ru
|
186
|
-
- spec/app/app/assets/stylesheets/evaluate.css.erb
|
187
|
-
- spec/app/app/assets/stylesheets/test.css
|
188
|
-
- spec/app/app/assets/stylesheets/loaded.sass
|
189
|
-
- spec/app/app/assets/stylesheets/sass.sass
|
190
|
-
- spec/app/app/assets/stylesheets/wrong.css
|
191
|
-
- spec/app/app/assets/config/manifest.js
|
192
|
-
- spec/app/app/controllers/css_controller.rb
|
193
|
-
- spec/app/app/controllers/application_controller.rb
|
194
|
-
- spec/app/Rakefile
|
195
|
-
- spec/app/config/environments/test.rb
|
196
|
-
- spec/app/config/boot.rb
|
197
|
-
- spec/app/config/initializers/secret_token.rb
|
198
|
-
- spec/app/config/routes.rb
|
199
|
-
- spec/app/config/autoprefixer.yml
|
200
|
-
- spec/app/config/environment.rb
|
201
|
-
- spec/app/config/application.rb
|
202
|
-
- spec/railtie_spec.rb
|
203
|
-
- spec/autoprefixer_spec.rb
|
204
|
-
- spec/rails_spec.rb
|
158
|
+
test_files: []
|
data/spec/app/Rakefile
DELETED
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= evaluate 'test.css' %>
|
@@ -1 +0,0 @@
|
|
1
|
-
@import "loaded"
|
@@ -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
|
data/spec/app/config/boot.rb
DELETED
@@ -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
|
data/spec/app/config/routes.rb
DELETED
data/spec/app/config.ru
DELETED
data/spec/autoprefixer_spec.rb
DELETED
@@ -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
|
data/spec/processor_spec.rb
DELETED
@@ -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
|
data/spec/rails_spec.rb
DELETED
@@ -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
|
data/spec/railtie_spec.rb
DELETED
@@ -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
|
data/spec/spec_helper.rb
DELETED
@@ -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
|