sass 3.1.0.alpha.246 → 3.1.0.alpha.249

Sign up to get free protection for your applications and to get access to all the features.
data/REVISION CHANGED
@@ -1 +1 @@
1
- 7dc3a7bda300a9a18b37b58776ebe02915b49e82
1
+ dfd6e2202bd9689c960fe89f45d0246b442c1207
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.0.alpha.246
1
+ 3.1.0.alpha.249
@@ -44,6 +44,16 @@ module Sass
44
44
 
45
45
  protected
46
46
 
47
+ # If a full uri is passed, this removes the root from it
48
+ # otherwise returns the name unchanged
49
+ def remove_root(name)
50
+ if name.index(@root) == 0
51
+ name[@root.length..-1]
52
+ else
53
+ name
54
+ end
55
+ end
56
+
47
57
  # A hash from file extensions to the syntaxes for those extensions.
48
58
  # The syntaxes must be `:sass` or `:scss`.
49
59
  #
@@ -80,7 +90,7 @@ module Sass
80
90
  # @param name [String] The filename to search for.
81
91
  # @return [(String, Symbol)] A filename-syntax pair.
82
92
  def find_real_file(dir, name)
83
- for (f,s) in possible_files(name)
93
+ for (f,s) in possible_files(remove_root(name))
84
94
  path = (dir == ".") ? f : "#{dir}/#{f}"
85
95
  if full_path = Dir[path].first
86
96
  full_path.gsub!(REDUNDANT_DIRECTORY,File::SEPARATOR)
@@ -23,7 +23,6 @@ module Sass
23
23
  # *WARNING*: It is important not to retain the instance for too long,
24
24
  # as its instance-level caches are never explicitly expired.
25
25
  class StalenessChecker
26
- DELETED = 1.0/0.0 # positive Infinity
27
26
  @dependencies_cache = {}
28
27
 
29
28
  class << self
@@ -54,15 +53,13 @@ module Sass
54
53
  # @param template_file [String] The location of the Sass or SCSS template
55
54
  # that is compiled to `css_file`.
56
55
  # @return [Boolean] Whether the stylesheet needs to be updated.
57
- def stylesheet_needs_update?(css_file, template_file)
58
- template_file = File.expand_path(template_file)
56
+ def stylesheet_needs_update?(css_file, template_file, importer = nil)
59
57
  begin
60
- css_mtime = File.mtime(css_file).to_i
58
+ css_mtime = File.mtime(css_file)
61
59
  rescue Errno::ENOENT
62
60
  return true
63
61
  end
64
-
65
- stylesheet_modified_since?(template_file, css_mtime)
62
+ stylesheet_modified_since?(template_file, css_mtime, importer)
66
63
  end
67
64
 
68
65
  # Returns whether a Sass or SCSS stylesheet has been modified since a given time.
@@ -130,9 +127,9 @@ module Sass
130
127
  mtime = importer.mtime(uri, @options)
131
128
  if mtime.nil?
132
129
  @dependencies.delete([uri, importer])
133
- DELETED
130
+ nil
134
131
  else
135
- mtime.to_i
132
+ mtime
136
133
  end
137
134
  end
138
135
  end
@@ -150,7 +147,9 @@ module Sass
150
147
 
151
148
  def dependency_updated?(css_mtime)
152
149
  Proc.new do |uri, importer|
153
- mtime(uri, importer) > css_mtime ||
150
+ sass_mtime = mtime(uri, importer)
151
+ !sass_mtime ||
152
+ sass_mtime > css_mtime ||
154
153
  dependencies_stale?(uri, importer, css_mtime)
155
154
  end
156
155
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.alpha.246
4
+ version: 3.1.0.alpha.249
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-03-14 00:00:00 -04:00
14
+ date: 2011-03-15 00:00:00 -04:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -90,8 +90,8 @@ files:
90
90
  - lib/sass/script/operation.rb
91
91
  - lib/sass/script/parser.rb
92
92
  - lib/sass/script/string.rb
93
- - lib/sass/script/list.rb
94
93
  - lib/sass/script/string_interpolation.rb
94
+ - lib/sass/script/list.rb
95
95
  - lib/sass/script/unary_operation.rb
96
96
  - lib/sass/script/variable.rb
97
97
  - lib/sass/scss.rb