sass-globbing 1.1.0.pre.0 → 1.1.0.pre.1

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: 191d169ded107c621388430015c6e73a9ec93a33
4
- data.tar.gz: 58093b03a0eb68b661e7acca78a3a333d03ddb4a
3
+ metadata.gz: 9429ec43bc287105c36943ec75077ee795979cd7
4
+ data.tar.gz: bd981b679ea8b1fd7de4ca3e4e49ddef62855f88
5
5
  SHA512:
6
- metadata.gz: 119d2347ac7dc0452a06580043a1479e48ced63a0bf1fdf3af31206b916b1796887e5736334ca607b1b70007b5e888bd3db8c54f90360933e382726c97794c7a
7
- data.tar.gz: 7ef9d07c819dbf8ee302617133f3ed6fdd9a63be230cfc107fa1ccd792e8f6f88668dedb397281804aa001089d88edde361dbb592905984e97d0fc6a40f23469
6
+ metadata.gz: 2f03ed3f1887516df597c42a58e742bda41e334889d95dab8ac472bac4c8a2ce10d38626235fccae21d7ec8e266e552628c9449650257990969fc68521dcd4c4
7
+ data.tar.gz: c7307b7835e5099b0bc6d5fd059350e59318dc5ced0492e560c1b69844854b225575c34dbca161efa44058df779925d8aaa06e14f54deaeb5e85514e9e3d1cc3
@@ -24,7 +24,7 @@ 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, absolute = false)
28
28
  if name =~ GLOB
29
29
  contents = ""
30
30
  base = base.gsub(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
@@ -32,6 +32,9 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
32
32
  each_globbed_file(name, base_pathname, options) do |filename|
33
33
  contents << "@import #{Pathname.new(filename).relative_path_from(base_pathname.dirname).to_s.inspect};\n"
34
34
  end
35
+ if contents.empty? && !absolute
36
+ return nil
37
+ end
35
38
  contents = "/* No files to import found in #{comment_safe(name)} */" if contents.empty?
36
39
  Sass::Engine.new(contents, options.merge(
37
40
  :filename => base_pathname.to_s,
@@ -39,13 +42,15 @@ class Sass::Globbing::Importer < Sass::Importers::Filesystem
39
42
  :syntax => :scss
40
43
  ))
41
44
  else
42
- super
45
+ super(name, base, options)
43
46
  end
44
47
  end
45
48
 
46
49
  def find(name, options)
47
50
  if options[:filename] # globs must be relative
48
- find_relative(name, options[:filename], options)
51
+ find_relative(name, options[:filename], options, true)
52
+ else
53
+ nil
49
54
  end
50
55
  end
51
56
 
@@ -5,8 +5,8 @@ class Sass::Engine
5
5
 
6
6
  def initialize(template, options={})
7
7
  old_initialize(template, options)
8
- unless self.options[:load_paths].include?(Sass::Globbing::Importer.instance)
9
- self.options[:load_paths].push Sass::Globbing::Importer.instance
10
- end
8
+ self.options[:load_paths].delete(Sass::Globbing::Importer.instance) # in case it's there
9
+ self.options[:load_paths] << Sass::Globbing::Importer.instance
11
10
  end
12
11
  end
12
+
@@ -1,5 +1,5 @@
1
1
  module Sass
2
2
  module Globbing
3
- VERSION = "1.1.0.pre.0"
3
+ VERSION = "1.1.0.pre.1"
4
4
  end
5
5
  end
@@ -12,12 +12,15 @@ class SassGlobbingTest < Test::Unit::TestCase
12
12
 
13
13
  private
14
14
  def render_file(filename)
15
- full_filename = File.expand_path("fixtures/#{filename}", File.dirname(__FILE__))
15
+ fixtures_dir = File.expand_path("fixtures", File.dirname(__FILE__))
16
+ full_filename = File.expand_path(filename, fixtures_dir)
16
17
  syntax = File.extname(full_filename)[1..-1].to_sym
17
- Sass::Engine.new(File.read(full_filename),
18
- :syntax => syntax,
19
- :filename => full_filename,
20
- :cache => false,
21
- :read_cache => false).render
18
+ engine = Sass::Engine.new(File.read(full_filename),
19
+ :syntax => syntax,
20
+ :filename => full_filename,
21
+ :cache => false,
22
+ :read_cache => false,
23
+ :load_paths => [fixtures_dir])
24
+ engine.render
22
25
  end
23
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-globbing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.pre.0
4
+ version: 1.1.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Eppstein