Skip to content

Commit

Permalink
added current-output-file()
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdavis committed Mar 23, 2012
1 parent 60ed958 commit 81d2a44
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/compass/sass_extensions/functions/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ def current_source_file
Sass::Script::String.new(options[:filename].to_s)
end

def current_output_file
Sass::Script::String.new(options[:css_filename].to_s)
end

end
4 changes: 3 additions & 1 deletion test/fixtures/stylesheets/envtest/css/env.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>; }
4 changes: 4 additions & 0 deletions test/fixtures/stylesheets/envtest/sass/env.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@

.filename {
file: current-source-file();
}

.output {
output: current-output-file();
}
6 changes: 5 additions & 1 deletion test/integrations/compass_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def assert_no_errors(css_file, project_name)
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)
Expand Down Expand Up @@ -226,4 +226,8 @@ def filename
@filename
end

def output_file
@output_file
end

end

0 comments on commit 81d2a44

Please sign in to comment.