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

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

View File

@ -12,4 +12,8 @@
.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