sass-globbing 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +6 -0
- data/Gemfile +1 -1
- data/lib/sass/globbing/importer.rb +29 -19
- data/lib/sass/globbing/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 865d10a42fbe093a517f11ea886c98c8fcd150f4
|
4
|
+
data.tar.gz: aa7655463f75ff566929a97a9ef4ad2655cc501a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd3eca7d7dcd91c986078afdecbced4ceea735f4b0d7a76bdae136783db2680aeb2351535fb3a456b9879bcbd055974e76c19f96e93524d08ff7048baa9c25f1
|
7
|
+
data.tar.gz: 894d0bd2a62d6c1344e01fa03b34684f9a1b4e7f11506dee982b5741027060232b7d94f906d6a566362adaf0a1563e39b2ed42842f59ccd91ce7de922bcfbdd6
|
data/CHANGELOG.markdown
CHANGED
data/Gemfile
CHANGED
@@ -24,23 +24,9 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
|
|
24
24
|
SASS_EXTENSIONS[File.extname(filename.to_s)]
|
25
25
|
end
|
26
26
|
|
27
|
-
def find_relative(name, base, options
|
27
|
+
def find_relative(name, base, options)
|
28
28
|
if name =~ GLOB
|
29
|
-
|
30
|
-
base = base.gsub(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
31
|
-
base_pathname = Pathname.new(base)
|
32
|
-
each_globbed_file(name, base_pathname, options) do |filename|
|
33
|
-
contents << "@import #{Pathname.new(filename).relative_path_from(base_pathname.dirname).to_s.inspect};\n"
|
34
|
-
end
|
35
|
-
if contents.empty? && !absolute
|
36
|
-
return nil
|
37
|
-
end
|
38
|
-
contents = "/* No files to import found in #{comment_safe(name)} */" if contents.empty?
|
39
|
-
Sass::Engine.new(contents, options.merge(
|
40
|
-
:filename => base_pathname.to_s,
|
41
|
-
:importer => self,
|
42
|
-
:syntax => :scss
|
43
|
-
))
|
29
|
+
find_glob(name, base, options) { nil }
|
44
30
|
else
|
45
31
|
super(name, base, options)
|
46
32
|
end
|
@@ -48,7 +34,11 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
|
|
48
34
|
|
49
35
|
def find(name, options)
|
50
36
|
if options[:filename] # globs must be relative
|
51
|
-
|
37
|
+
if name =~ GLOB
|
38
|
+
find_glob(name, options[:filename], options) { "/* No files to import found in #{comment_safe(name)} */" }
|
39
|
+
else
|
40
|
+
super(name, options)
|
41
|
+
end
|
52
42
|
else
|
53
43
|
nil
|
54
44
|
end
|
@@ -64,7 +54,12 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
|
|
64
54
|
def mtime(name, options)
|
65
55
|
if name =~ GLOB && options[:filename]
|
66
56
|
mtime = nil
|
67
|
-
|
57
|
+
base_pathname = Pathname.new(options[:filename])
|
58
|
+
name_pathname = Pathname.new(name)
|
59
|
+
if name_pathname.absolute?
|
60
|
+
name = name_pathname.relative_path_from(base_pathname.dirname).to_s
|
61
|
+
end
|
62
|
+
each_globbed_file(name, base_pathname, options) do |p|
|
68
63
|
if mtime.nil?
|
69
64
|
mtime = File.mtime(p)
|
70
65
|
else
|
@@ -85,8 +80,23 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
|
|
85
80
|
|
86
81
|
protected
|
87
82
|
|
83
|
+
def find_glob(name, base, options)
|
84
|
+
contents = ""
|
85
|
+
base = base.gsub(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
86
|
+
base_pathname = Pathname.new(base)
|
87
|
+
each_globbed_file(name, base_pathname, options) do |filename|
|
88
|
+
contents << "@import #{Pathname.new(filename).relative_path_from(base_pathname.dirname).to_s.inspect};\n"
|
89
|
+
end
|
90
|
+
contents = yield if contents.empty?
|
91
|
+
return nil if contents.nil? || contents.empty?
|
92
|
+
Sass::Engine.new(contents, options.merge(
|
93
|
+
:filename => base_pathname.dirname.join(Pathname.new(name)).to_s,
|
94
|
+
:importer => self,
|
95
|
+
:syntax => :scss
|
96
|
+
))
|
97
|
+
end
|
98
|
+
|
88
99
|
def comment_safe(string)
|
89
100
|
string.gsub(%r{\*/}, "*\\/")
|
90
101
|
end
|
91
|
-
|
92
102
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.1
|
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: 2014-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
69
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.0.
|
70
|
+
rubygems_version: 2.0.3
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: Allows use of globs in Sass @import directives.
|