mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Merge branch 'master' into yard
This commit is contained in:
commit
8396a7978f
1 changed files with 4 additions and 3 deletions
|
@ -21,8 +21,7 @@ module Sass
|
||||||
compiled_filename = sassc_filename(filename, options)
|
compiled_filename = sassc_filename(filename, options)
|
||||||
sha = Digest::SHA1.hexdigest(text)
|
sha = Digest::SHA1.hexdigest(text)
|
||||||
|
|
||||||
if dump = try_to_read_sassc(filename, compiled_filename, sha)
|
if root = try_to_read_sassc(filename, compiled_filename, sha)
|
||||||
root = Marshal.load(dump)
|
|
||||||
root.options = options.merge(:filename => filename)
|
root.options = options.merge(:filename => filename)
|
||||||
return root
|
return root
|
||||||
end
|
end
|
||||||
|
@ -94,8 +93,10 @@ module Sass
|
||||||
File.open(compiled_filename) do |f|
|
File.open(compiled_filename) do |f|
|
||||||
return unless f.readline("\n").strip == Sass::VERSION
|
return unless f.readline("\n").strip == Sass::VERSION
|
||||||
return unless f.readline("\n").strip == sha
|
return unless f.readline("\n").strip == sha
|
||||||
return f.read
|
return Marshal.load(f.read)
|
||||||
end
|
end
|
||||||
|
rescue TypeError => e, ArgumentError => e
|
||||||
|
warn "Warning. Error encountered while reading cache #{compiled_filename}: #{e}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def try_to_write_sassc(root, compiled_filename, sha, options)
|
def try_to_write_sassc(root, compiled_filename, sha, options)
|
||||||
|
|
Loading…
Add table
Reference in a new issue