diff --git a/lib/compass/configuration.rb b/lib/compass/configuration.rb index 920893aa..642cb4ac 100644 --- a/lib/compass/configuration.rb +++ b/lib/compass/configuration.rb @@ -7,6 +7,7 @@ module Compass ATTRIBUTES = [ :project_type, :project_path, + :http_path, :css_dir, :sass_dir, :images_dir, @@ -15,6 +16,8 @@ module Compass :environment, :relative_assets, :http_images_path, + :http_stylesheets_path, + :http_javascripts_path, :additional_import_paths, :sass_options ] @@ -93,12 +96,12 @@ module Compass "images" end - def default_http_images_path - "/#{images_dir}" + def default_http_path + "/" end - def comment_for_http_images_path - "# To enable relative image paths using the images_url() function:\n# http_images_path = :relative\n" + def comment_for_http_path + "# Set this to the root of your project when deployed:\n" end def relative_assets? @@ -140,6 +143,11 @@ module Compass end end + def mk_http_path(path) + hp = http_path[0..-2] if http_path[-1..-1] == "/" + "#{hp}/#{path}" + end + def add_import_path(*paths) # The @added_import_paths variable works around an issue where # the additional_import_paths gets overwritten during parse diff --git a/test/configuration_test.rb b/test/configuration_test.rb index 5ce3a350..0191d9a6 100644 --- a/test/configuration_test.rb +++ b/test/configuration_test.rb @@ -13,6 +13,8 @@ class ConfigurationTest < Test::Unit::TestCase # Require any additional compass plugins here. project_type = :stand_alone + # Set this to the root of your project when deployed: + http_path = "/" css_dir = "css" sass_dir = "sass" images_dir = "img" @@ -64,6 +66,7 @@ class ConfigurationTest < Test::Unit::TestCase def test_additional_import_paths contents = <<-CONFIG + http_path = "/" project_path = "/home/chris/my_compass_project" css_dir = "css" additional_import_paths = ["../foo"] @@ -80,11 +83,14 @@ class ConfigurationTest < Test::Unit::TestCase expected_serialization = <