added current-output-file()

This commit is contained in:
Scott Davis 2012-03-23 13:25:54 -04:00
parent 60ed9581e2
commit 81d2a44ef4
4 changed files with 16 additions and 2 deletions

View File

@ -16,4 +16,8 @@ module Compass::SassExtensions::Functions::Env
Sass::Script::String.new(options[:filename].to_s)
end
def current_output_file
Sass::Script::String.new(options[:css_filename].to_s)
end
end

View File

@ -6,3 +6,5 @@
date: "<%= Time.now.strftime("%F") %>"; }
.filename {
file: <%= filename.gsub(%r{/scss/}, '/sass/') %>; }
.output {
output: <%= output_file %>; }

View File

@ -13,3 +13,7 @@
.filename {
file: current-source-file();
}
.output {
output: current-output-file();
}

View File

@ -138,7 +138,7 @@ private
def assert_renders_correctly(*arguments)
options = arguments.last.is_a?(Hash) ? arguments.pop : {}
for name in arguments
actual_result_file = "#{tempfile_path(@current_project)}/#{name}.css"
@output_file = actual_result_file = "#{tempfile_path(@current_project)}/#{name}.css"
expected_result_file = "#{result_path(@current_project)}/#{name}.css"
@filename = expected_result_file.gsub('css', 'scss')
actual_lines = File.read(actual_result_file)
@ -226,4 +226,8 @@ private
@filename
end
def output_file
@output_file
end
end