8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/roger_autoprefixer/processor.rb', line 8
def call(release, options = {})
options = {
match: ["stylesheets/**/*.css"],
skip: [],
browsers: nil
}.update(options)
match = options.delete(:match)
skip = options.delete(:skip)
prefixer_options = {}
if options[:browsers]
prefixer_options[:browsers] = options[:browsers]
end
files = release.get_files(match)
files.each do |f|
if !skip.detect { |r| r.match(f) }
release.log(self, "Processing: #{f}")
content = File.read(f)
File.open(f, "w") do |fh|
fh.write AutoprefixerRails.process(content, prefixer_options.dup.update(from: f)).css
end
end
end
end
|