jekyll-assets 2.2.1 → 2.2.2
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/lib/jekyll/assets/processors/less.rb +50 -50
- data/lib/jekyll/assets/version.rb +1 -1
- metadata +1 -2
- data/lib/jekyll/assets/addons/less.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b48bcbe756753d18e5daab5826fd0d2e5e1c129
|
4
|
+
data.tar.gz: 3291bf13013e12384be82f76ac4f6ff4c37562f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2881e933bea8ac977bca0cb95e51f7b09d028c681f1333ef5a8e055594dc35e860887cc70c9c5e10038c5c6bcd21787685b72ad554f8d5577c41ec0e999a9ba4
|
7
|
+
data.tar.gz: bee841e2c8a1be65d76b05bf56949cc57b559bcd3f4c4d1ce75b420ebd66c94c40ea3c54b32d3668a42d45cb74005bf9798c11def68c55428ae39cce6590608a
|
@@ -1,49 +1,49 @@
|
|
1
|
-
|
1
|
+
try_require_if_javascript "less" do
|
2
|
+
module Jekyll
|
3
|
+
module Assets
|
4
|
+
module Processors
|
5
|
+
class LESS
|
2
6
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
class LESS
|
7
|
+
# --------------------------------------------------------------------
|
8
|
+
# Setup and pull out the context and update the data, shipping it.
|
9
|
+
# --------------------------------------------------------------------
|
7
10
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
+
def self.call(input)
|
12
|
+
data = input[:data]; paths = [input[:load_path]]
|
13
|
+
tree = Less.instance_variable_get(:@loader).require("less/tree")
|
14
|
+
context = input[:environment].context_class.new(input)
|
15
|
+
patch_tree(tree, context)
|
11
16
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
context = input[:environment].context_class.new(input)
|
16
|
-
patch_tree(tree, context)
|
17
|
+
paths |= input[:environment].paths
|
18
|
+
paths |= Dir.glob(input[:load_path] + '/*').select(&File.method(:directory?))
|
19
|
+
parser = Less::Parser.new(:paths => paths)
|
17
20
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
:data => Less::Parser.new(:paths => paths) \
|
24
|
-
.parse(data).to_css
|
25
|
-
})
|
26
|
-
end
|
21
|
+
context.metadata.merge({
|
22
|
+
:data => Less::Parser.new(:paths => paths) \
|
23
|
+
.parse(data).to_css
|
24
|
+
})
|
25
|
+
end
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
27
|
+
# --------------------------------------------------------------------
|
28
|
+
# Add the sprockets helpers into the Less environment so people can
|
29
|
+
# use assets from within Less... as they see fit.
|
30
|
+
# --------------------------------------------------------------------
|
31
|
+
# We also make sure to disable their quotes so that we can quote
|
32
|
+
# ourselves if we need to, otherwise we simply just take the values.
|
33
|
+
# --------------------------------------------------------------------
|
35
34
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
35
|
+
def self.patch_tree(tree, context)
|
36
|
+
Helpers.instance_methods.each do |m|
|
37
|
+
tree.functions[m.to_s.tr("_", "-")] = tree.functions[m.to_s] = lambda do |*args|
|
38
|
+
args.last.tap do |o|
|
39
|
+
o[:quote] = ""
|
40
|
+
o[:value] = context.send(m, args.last.toCSS().gsub(
|
41
|
+
/^"|"$/, ""
|
42
|
+
))
|
44
43
|
|
45
|
-
|
46
|
-
|
44
|
+
if m.to_s.end_with?("_path")
|
45
|
+
o[:value] = o[:value].inspect
|
46
|
+
end
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -52,17 +52,17 @@ module Jekyll
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
55
|
-
end
|
56
55
|
|
57
|
-
# ----------------------------------------------------------------------------
|
56
|
+
# ----------------------------------------------------------------------------
|
58
57
|
|
59
|
-
if Gem::Version.new(Sprockets::VERSION) >= Gem::Version.new(4.0)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
else
|
65
|
-
|
66
|
-
|
67
|
-
|
58
|
+
if Gem::Version.new(Sprockets::VERSION) >= Gem::Version.new(4.0)
|
59
|
+
Sprockets.register_mime_type "text/less", :extensions => [".less", ".css.less"]
|
60
|
+
Sprockets.register_transformer("text/less", "test/css",
|
61
|
+
Jekyll::Assets::Processors::LESS
|
62
|
+
)
|
63
|
+
else
|
64
|
+
Sprockets.register_engine(
|
65
|
+
".less", Jekyll::Assets::Processors::LESS
|
66
|
+
)
|
67
|
+
end
|
68
68
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordon Bedwell
|
@@ -158,7 +158,6 @@ files:
|
|
158
158
|
- lib/jekyll/assets/addons/bootstrap.rb
|
159
159
|
- lib/jekyll/assets/addons/fontawesome.rb
|
160
160
|
- lib/jekyll/assets/addons/javascript.rb
|
161
|
-
- lib/jekyll/assets/addons/less.rb
|
162
161
|
- lib/jekyll/assets/cached.rb
|
163
162
|
- lib/jekyll/assets/config.rb
|
164
163
|
- lib/jekyll/assets/env.rb
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# ----------------------------------------------------------------------------
|
2
|
-
# Frozen-string-literal: true
|
3
|
-
# Copyright: 2012 - 2016 - MIT License
|
4
|
-
# Encoding: utf-8
|
5
|
-
# ----------------------------------------------------------------------------
|
6
|
-
|
7
|
-
try_require_if_javascript(
|
8
|
-
"jekyll/assets/processors/less"
|
9
|
-
)
|