sass-globbing 1.1.1 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +6 -0
- data/CHANGELOG.markdown +9 -1
- data/README.markdown +1 -1
- data/lib/sass/globbing/importer.rb +16 -9
- data/lib/sass/globbing/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 716947e6a3f5388e1f9ffe9aa048edda6b92f91f
|
4
|
+
data.tar.gz: f78821bf5ec7439d00562a6c40e855d0dd0fad7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dffcab28c807fc9b199400971e700d47193af56cd76c5a59369a03de806f61ecd955fb8c5e39838a90c5627da8ecc5b0379f0b1a5ac36f49358cf8e7ce06917a
|
7
|
+
data.tar.gz: 62539cc84b63f290f1a48dafdf284f3b7043b5a59e5ef88807101b7c316f30fa4508973eb46b07389935f3158f7cd945761d7fdecf76c01a1387b344c891df40
|
data/.travis.yml
ADDED
data/CHANGELOG.markdown
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 1.1.3
|
2
|
+
|
3
|
+
* Fix globbing importing path correctly.
|
4
|
+
|
5
|
+
# 1.1.2
|
6
|
+
|
7
|
+
* Fix globbing importing path
|
8
|
+
|
1
9
|
# 1.1.1
|
2
10
|
|
3
11
|
* Fix importing issues when using import-once with sass-globbing
|
@@ -9,7 +17,7 @@
|
|
9
17
|
* Add the ability for a glob to not match any files. Instead a css
|
10
18
|
comment is generated that explains that nothing was found (to enable
|
11
19
|
debugging).
|
12
|
-
|
20
|
+
|
13
21
|
Because of this behavior, it is imperitive that the globbing importer
|
14
22
|
come after the compass sprite importer in the sass load path. This is
|
15
23
|
done for you automatically, but it is something to keep in mind.
|
data/README.markdown
CHANGED
@@ -39,4 +39,4 @@ Ruby on Rails has this capability out of the box starting in Rails 3.1. Do not i
|
|
39
39
|
CSS is order dependent, as such, using this approach within your stylesheets to import styles that depend on the stylesheet's cascade creates an opportunity for styles to change more unpredictably than a manually asserted order. It is recommended that you only use globbing where order is unimportant; E.g. importing of library files.
|
40
40
|
|
41
41
|
|
42
|
-
[globbing_docs]: http://ruby-doc.org/core/classes/Dir.html#
|
42
|
+
[globbing_docs]: http://ruby-doc.org/core/classes/Dir.html#method-c-glob
|
@@ -19,11 +19,11 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
|
|
19
19
|
def sass_file?(filename)
|
20
20
|
SASS_EXTENSIONS.has_key?(File.extname(filename.to_s))
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def syntax(filename)
|
24
24
|
SASS_EXTENSIONS[File.extname(filename.to_s)]
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
def find_relative(name, base, options)
|
28
28
|
if name =~ GLOB
|
29
29
|
find_glob(name, base, options) { nil }
|
@@ -31,7 +31,7 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
|
|
31
31
|
super(name, base, options)
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
def find(name, options)
|
36
36
|
if options[:filename] # globs must be relative
|
37
37
|
if name =~ GLOB
|
@@ -43,14 +43,14 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
|
|
43
43
|
nil
|
44
44
|
end
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
def each_globbed_file(glob, base_pathname, options)
|
48
48
|
Dir["#{base_pathname.dirname}/#{glob}"].sort.each do |filename|
|
49
49
|
next if filename == options[:filename]
|
50
50
|
yield filename if sass_file?(filename)
|
51
51
|
end
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
def mtime(name, options)
|
55
55
|
if name =~ GLOB && options[:filename]
|
56
56
|
mtime = nil
|
@@ -69,11 +69,11 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
|
|
69
69
|
mtime
|
70
70
|
end
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
def key(name, options)
|
74
74
|
["Glob:" + File.dirname(File.expand_path(name)), File.basename(name)]
|
75
75
|
end
|
76
|
-
|
76
|
+
|
77
77
|
def to_s
|
78
78
|
"Sass::Globbing::Importer"
|
79
79
|
end
|
@@ -85,12 +85,19 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
|
|
85
85
|
base = base.gsub(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
86
86
|
base_pathname = Pathname.new(base)
|
87
87
|
each_globbed_file(name, base_pathname, options) do |filename|
|
88
|
-
|
88
|
+
pathname = Pathname.new(filename).relative_path_from(base_pathname.dirname).to_s
|
89
|
+
contents << "@import #{pathname.inspect};\n"
|
89
90
|
end
|
90
91
|
contents = yield if contents.empty?
|
91
92
|
return nil if contents.nil? || contents.empty?
|
93
|
+
cleaned_glob_name = name.
|
94
|
+
gsub("*", "-star-").
|
95
|
+
gsub("/", "-slash-").
|
96
|
+
gsub(".", "-dot-").
|
97
|
+
gsub("--", "-").
|
98
|
+
gsub(/-$/,"")
|
92
99
|
Sass::Engine.new(contents, options.merge(
|
93
|
-
:filename => base_pathname.dirname.join(Pathname.new(
|
100
|
+
:filename => base_pathname.dirname.join(Pathname.new(cleaned_glob_name)).to_s,
|
94
101
|
:importer => self,
|
95
102
|
:syntax => :scss
|
96
103
|
))
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass-globbing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Eppstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.1'
|
27
27
|
description: Allows use of globs in Sass @import directives.
|
@@ -31,7 +31,8 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
- .gitignore
|
34
|
+
- ".gitignore"
|
35
|
+
- ".travis.yml"
|
35
36
|
- CHANGELOG.markdown
|
36
37
|
- Gemfile
|
37
38
|
- README.markdown
|
@@ -57,17 +58,17 @@ require_paths:
|
|
57
58
|
- lib
|
58
59
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
60
|
requirements:
|
60
|
-
- -
|
61
|
+
- - ">="
|
61
62
|
- !ruby/object:Gem::Version
|
62
63
|
version: '0'
|
63
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
65
|
requirements:
|
65
|
-
- -
|
66
|
+
- - ">="
|
66
67
|
- !ruby/object:Gem::Version
|
67
68
|
version: '0'
|
68
69
|
requirements: []
|
69
70
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.
|
71
|
+
rubygems_version: 2.5.1
|
71
72
|
signing_key:
|
72
73
|
specification_version: 4
|
73
74
|
summary: Allows use of globs in Sass @import directives.
|
@@ -78,4 +79,3 @@ test_files:
|
|
78
79
|
- test/fixtures/partials/nested/_nested_2.sass
|
79
80
|
- test/fixtures/partials/nested/deeply_nested/_deeply.scss
|
80
81
|
- test/sass_globbing_test.rb
|
81
|
-
has_rdoc:
|