jekyll-autoprefixer-v2 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: da1b4fad75ae11ba13ce7dc667f84a406413647804571d4134dc67832a6117ed
4
+ data.tar.gz: 0bc7ee3c2817941c75e86187bb85936ae32eab528b70a9a5d52fd9a30b8a8a7c
5
+ SHA512:
6
+ metadata.gz: 2a6eb059a96e364ef02ce2118e2030270b4666158f4663c06a526a7c1ebba9276e303fc6cac5556ed7635f964d7209d6c717b21a26e86d6e4f3f5df896329a8e
7
+ data.tar.gz: 0bcf02ff45c16afac65b2e02c40e8d3bd207b66072d280039cc58a3fa69b4f075d259b7e483b66e786584ed43056585dca0d8ef9bf0a25592cc8f1296624f484
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Vincent Wochnik
4
+ Copyright (c) 2024 Alberto Strappazzon
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,33 @@
1
+ require 'autoprefixer-rails'
2
+
3
+ module Jekyll
4
+ module Autoprefixer
5
+ class Autoprefixer
6
+ attr_reader :site, :batch
7
+
8
+ def initialize(site)
9
+ @site = site
10
+ @batch = []
11
+ end
12
+
13
+ def process()
14
+ options = @site.config['autoprefixer'] || {}
15
+
16
+ if !options['only_production'] || Jekyll.env == 'production'
17
+ @batch.each do |item|
18
+ path = item.destination(@site.dest)
19
+
20
+ File.open(path, 'r+') do |file|
21
+ content = file.read
22
+ file.truncate(0)
23
+ file.rewind
24
+ file.write(AutoprefixerRails.process(content, options))
25
+ end
26
+ end
27
+ end
28
+
29
+ @batch.clear
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,5 @@
1
+ module Jekyll
2
+ module Autoprefixer
3
+ VERSION = '2.0.0'.freeze
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module Jekyll
2
+ module Autoprefixer
3
+ require_relative 'autoprefixer/autoprefixer'
4
+ require_relative 'autoprefixer/version'
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Jekyll
2
+ class Site
3
+ attr_accessor :autoprefixer
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ require_relative 'patches/jekyll/site'
@@ -0,0 +1,22 @@
1
+ require 'jekyll'
2
+
3
+ require_relative 'jekyll/patches'
4
+ require_relative 'jekyll/autoprefixer'
5
+
6
+ Jekyll::Hooks.register :site, :after_reset do |site|
7
+ # create new autoprefixer instance
8
+ site.autoprefixer = Jekyll::Autoprefixer::Autoprefixer.new(site)
9
+ end
10
+
11
+ Jekyll::Hooks.register :site, :post_render do |site|
12
+ site.each_site_file do |item|
13
+ if site.regenerator.regenerate?(item)
14
+ ext = File.extname(item.destination(site.dest))
15
+ site.autoprefixer.batch.push(item) if ext == '.css'
16
+ end
17
+ end
18
+ end
19
+
20
+ Jekyll::Hooks.register :site, :post_write do |site|
21
+ site.autoprefixer.process
22
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-autoprefixer-v2
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Vincent Wochnik
8
+ - Alberto Strappazzon
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2024-04-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: autoprefixer-rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '10.4'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '10.4'
28
+ description: This plugin provides simple autoprefixer support for Jekyll.
29
+ email:
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - LICENSE.txt
35
+ - lib/jekyll-autoprefixer.rb
36
+ - lib/jekyll/autoprefixer.rb
37
+ - lib/jekyll/autoprefixer/autoprefixer.rb
38
+ - lib/jekyll/autoprefixer/version.rb
39
+ - lib/jekyll/patches.rb
40
+ - lib/jekyll/patches/jekyll/site.rb
41
+ homepage: https://github.com/Strappzzzon/jekyll-autoprefixer-v2
42
+ licenses:
43
+ - MIT
44
+ metadata: {}
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 3.2.2
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ requirements: []
60
+ rubygems_version: 3.4.10
61
+ signing_key:
62
+ specification_version: 4
63
+ summary: Autoprefixer integration for Jekyll
64
+ test_files: []