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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c378b666e5d54cced56b405bd79948a6d70b4ae
4
- data.tar.gz: 34c8c623a7e574f97423c4d6fa0ace8b8300c8f0
3
+ metadata.gz: 865d10a42fbe093a517f11ea886c98c8fcd150f4
4
+ data.tar.gz: aa7655463f75ff566929a97a9ef4ad2655cc501a
5
5
  SHA512:
6
- metadata.gz: 7d1902277f44ff1d7956bb150c5a44e6cfa847f65e47ec6f651172ea5de12daf8ca60c08ee6209ea73b75643c40162767171c06e46126131e3240e8d6a04d717
7
- data.tar.gz: 9a6d2369524d29dc41c46d4ab1b1498d1a9672133d35386ec89f7e6196249c27ba1ecf91f42935523688d9b0946462e2e0436b67e719fb2c12e1d2258b5ff57b
6
+ metadata.gz: fd3eca7d7dcd91c986078afdecbced4ceea735f4b0d7a76bdae136783db2680aeb2351535fb3a456b9879bcbd055974e76c19f96e93524d08ff7048baa9c25f1
7
+ data.tar.gz: 894d0bd2a62d6c1344e01fa03b34684f9a1b4e7f11506dee982b5741027060232b7d94f906d6a566362adaf0a1563e39b2ed42842f59ccd91ce7de922bcfbdd6
@@ -1,3 +1,9 @@
1
+ # 1.1.1
2
+
3
+ * Fix importing issues when using import-once with sass-globbing
4
+ * Fix mtime checks so that globs don't force recompiles of unchanged
5
+ sass files.
6
+
1
7
  # 1.1.0
2
8
 
3
9
  * Add the ability for a glob to not match any files. Instead a css
data/Gemfile CHANGED
@@ -4,4 +4,4 @@ source "http://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  gem 'rake'
7
- gem 'sass', :path => "/Users/chris/Projects/sass"
7
+ gem 'sass'
@@ -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, absolute = false)
27
+ def find_relative(name, base, options)
28
28
  if name =~ GLOB
29
- contents = ""
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
- find_relative(name, options[:filename], options, true)
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
- each_globbed_file(name, Pathname.new(options[:filename]), options) do |p|
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
@@ -1,5 +1,5 @@
1
1
  module Sass
2
2
  module Globbing
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  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.0
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: 2013-05-29 00:00:00.000000000 Z
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.0.rc.2
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.