Created
March 27, 2013 16:55
-
-
Save jlong/5255978 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extension in my Rails lib dir | |
require 'lib/extensions/sass_widget_image_url' | |
# This configuration file works with both the Compass command line tool and within Rails. | |
project_type = :rails | |
# Require any additional compass plugins here. | |
require 'susy' | |
# HTTP paths | |
http_path = "/" | |
http_stylesheets_path = "/stylesheets" | |
http_images_path = "/images" | |
http_javascripts_path = "/javascripts" | |
# File system locations | |
sass_dir = "app/assets/stylesheets" | |
css_dir = "public/stylesheets" | |
images_dir = "public/images" | |
javascripts_dir = "public/javascripts" | |
# Set to true for easier debugging | |
line_comments = false | |
# CSS output style - :nested, :expanded, :compact, or :compressed | |
output_style = :nested | |
# To enable relative paths to assets via compass helper functions. Uncomment: | |
relative_assets = true | |
# If you prefer the indented syntax, you might want to regenerate this | |
# project again passing --syntax sass, or you can uncomment this: | |
preferred_syntax = :sass | |
# Disable the asset cache buster: | |
asset_cache_buster :none | |
# Learn more: | |
# http://compass-style.org/help/tutorials/configuration-reference/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Running compass compile generates this: | |
$ compass compile | |
Nothing to compile. If you're trying to start a new project, you have left off the directory argument. | |
Run "compass -h" to get help. | |
# If I remove the line from the config file and just try it on the command line I get this: | |
$ compass compile -r lib/extensions/sass_widget_image_url.rb | |
LoadError on line ["161"] of /Users/jlong/.rvm/gems/ruby-1.9.3-p286-perf@uservoice/gems/compass-0.12.2/lib/compass/configuration/data.rb: cannot load such file -- lib/extensions/sass_widget_image_url.rb | |
Run with --trace to see the full backtrace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SassWidgetImageUrl | |
def widget_image_url(path) | |
Sass::Script::String.new("url(//#{WIDGET2_DOMAIN}/images/#{path.value})") | |
end | |
end | |
module Sass::Script::Functions | |
include SassWidgetImageUrl | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment