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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a9af72c69bf187c13262a1c40b58438cc756986
4
- data.tar.gz: 26f6fb75cbc6dd8f708dcbcee9e073a6537acd32
3
+ metadata.gz: 2b48bcbe756753d18e5daab5826fd0d2e5e1c129
4
+ data.tar.gz: 3291bf13013e12384be82f76ac4f6ff4c37562f5
5
5
  SHA512:
6
- metadata.gz: 7d890e1af9866a98ea85418e0a0ab9bb161f665f8a305d7cc940a837adaf4b29ff5b3beceb585abce36de678b4a38419ecb3c4461f964006e9f4ac70468402f7
7
- data.tar.gz: 6cde01d5b5df8579c015d88d874426e79a65c5e4ac12cb514558ddfaf41da975bd3619df93b65e67b399ec62477c981520f096422093418e41d48118102efb6a
6
+ metadata.gz: 2881e933bea8ac977bca0cb95e51f7b09d028c681f1333ef5a8e055594dc35e860887cc70c9c5e10038c5c6bcd21787685b72ad554f8d5577c41ec0e999a9ba4
7
+ data.tar.gz: bee841e2c8a1be65d76b05bf56949cc57b559bcd3f4c4d1ce75b420ebd66c94c40ea3c54b32d3668a42d45cb74005bf9798c11def68c55428ae39cce6590608a
@@ -1,49 +1,49 @@
1
- require "less"
1
+ try_require_if_javascript "less" do
2
+ module Jekyll
3
+ module Assets
4
+ module Processors
5
+ class LESS
2
6
 
3
- module Jekyll
4
- module Assets
5
- module Processors
6
- class LESS
7
+ # --------------------------------------------------------------------
8
+ # Setup and pull out the context and update the data, shipping it.
9
+ # --------------------------------------------------------------------
7
10
 
8
- # --------------------------------------------------------------------
9
- # Setup and pull out the context and update the data, shipping it.
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
- def self.call(input)
13
- data = input[:data]; paths = [input[:load_path]]
14
- tree = Less.instance_variable_get(:@loader).require("less/tree")
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
- paths |= input[:environment].paths
19
- paths |= Dir.glob(input[:load_path] + '/*').select(&File.method(:directory?))
20
- parser = Less::Parser.new(:paths => paths)
21
-
22
- context.metadata.merge({
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
- # Add the sprockets helpers into the Less environment so people can
30
- # use assets from within Less... as they see fit.
31
- # --------------------------------------------------------------------
32
- # We also make sure to disable their quotes so that we can quote
33
- # ourselves if we need to, otherwise we simply just take the values.
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
- def self.patch_tree(tree, context)
37
- Helpers.instance_methods.each do |m|
38
- tree.functions[m.to_s.tr("_", "-")] = tree.functions[m.to_s] = lambda do |*args|
39
- args.last.tap do |o|
40
- o[:quote] = ""
41
- o[:value] = context.send(m, args.last.toCSS().gsub(
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
- if m.to_s.end_with?("_path")
46
- o[:value] = o[:value].inspect
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
- Sprockets.register_mime_type "text/less", :extensions => [".less", ".css.less"]
61
- Sprockets.register_transformer("text/less", "test/css",
62
- Jekyll::Assets::Processors::LESS
63
- )
64
- else
65
- Sprockets.register_engine(
66
- ".less", Jekyll::Assets::Processors::LESS
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
@@ -6,6 +6,6 @@
6
6
 
7
7
  module Jekyll
8
8
  module Assets
9
- VERSION="2.2.1"
9
+ VERSION="2.2.2"
10
10
  end
11
11
  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.1
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
- )