jekyll-sass-converter 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71288fcd81a667822653dc71bd95ccedd9be0428
4
- data.tar.gz: 71e8375de0f5aa7795850292b905c079a33054ba
3
+ metadata.gz: 645b96822c506f0d86f27cce5dc09793c4842982
4
+ data.tar.gz: 9eff7d0b5b3f471bc4d898edeb447aae620f3601
5
5
  SHA512:
6
- metadata.gz: 0cc730a8eac61db90a74430bf0c0d865b580262bd19e2d0697fb66b0edb2bc704c10ec2996dbb7db826e1485223e5cda882434e92ad564a02bbee3ef252ea060
7
- data.tar.gz: fee08ad83bd90778f43e144e48775ea00594d820c8e78f435f9f14eed19fb9584f9d41497e5217d4184cc51d1c05501b42ab07dc8a14131c077ceca975371163
6
+ metadata.gz: d06aefb9977c5861b8871db35659fc9b0e50b7870f329f83eeef738f3a5ef74ccba66c48ea989aed5f16152fc808fe0fe375c209c7938e96f9f9d16e2e4e8ee5
7
+ data.tar.gz: 2bf05d542e7e713970b2b5b3e7f4c25c95ba2b5d6f05fdaf6d1c217aa93527b911191dbe969fed816885dbeecfd1ccbd9700ed695b7ab0ff40a61e0f147e0712
@@ -1,3 +1,3 @@
1
1
  module JekyllSassConverter
2
- VERSION = "1.4.0"
2
+ VERSION = "1.5.0"
3
3
  end
@@ -71,15 +71,32 @@ module Jekyll
71
71
  end
72
72
 
73
73
  def sass_dir_relative_to_site_source
74
- Jekyll.sanitized_path(@config["source"], sass_dir)
74
+ Jekyll.sanitized_path(site_source, sass_dir)
75
75
  end
76
76
 
77
77
  def sass_load_paths
78
+ paths = user_sass_load_paths + [sass_dir_relative_to_site_source]
79
+
78
80
  if safe?
79
- [sass_dir_relative_to_site_source]
80
- else
81
- (user_sass_load_paths + [sass_dir_relative_to_site_source]).uniq
82
- end.select { |load_path| File.directory?(load_path) }
81
+ # Sanitize paths to prevent any attack vectors (.e.g. `/**/*`)
82
+ paths.map! { |path| Jekyll.sanitized_path(site_source, path) }
83
+ end
84
+
85
+ # Expand file globs (e.g. `node_modules/*/node_modules` )
86
+ Dir.chdir(site_source) do
87
+ paths = paths.map { |path| Dir.glob(path) }.flatten.uniq
88
+
89
+ paths.map! do |path|
90
+ if safe?
91
+ # Sanitize again in case globbing was able to do something crazy.
92
+ Jekyll.sanitized_path(site_source, path)
93
+ else
94
+ File.expand_path(path)
95
+ end
96
+ end
97
+ end
98
+
99
+ paths.select { |path| File.directory?(path) }
83
100
  end
84
101
 
85
102
  def allow_caching?
@@ -105,6 +122,11 @@ module Jekyll
105
122
  rescue ::Sass::SyntaxError => e
106
123
  raise SyntaxError.new("#{e.to_s} on line #{e.sass_line}")
107
124
  end
125
+
126
+ private
127
+ def site_source
128
+ @site_source ||= File.expand_path(@config["source"]).freeze
129
+ end
108
130
  end
109
131
  end
110
132
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-sass-converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-26 00:00:00.000000000 Z
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.2.5
114
+ rubygems_version: 2.5.1
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: A basic Sass converter for Jekyll.