Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><em>update</em> as of 2013.03.20, this works. but it may not be the cleanest way to get Susy / compass on 'rubyless' machines. does anyone have anything cleaner? </p> <p>found it. compass is not in the sass load path, nor is susy actually while running under a 'gems in a jar' jruby solution. Thank you Henning Petersen, and <a href="http://henningpetersen.com/post/7/integrating-compass-style-sass-into-tapestry" rel="nofollow">your post</a><br> specifically: </p> <blockquote> <p>JRuby has quite a brilliant abstraction from the file-based way of all things Ruby, so most things keep working when packaged into a JAR. A file inside a JAR has a path roughly like this: /path/to/jar/gems.jar!file/in/jar/script.rb. JRuby keeps relative files and everything working when using JARs, with one great BUT: There is no way to do such a thing as a directory listing inside a JAR file. That's right, everything that reads directory listings is now broken.</p> </blockquote> <p>I altered compass's frameworks.rb (not a fan) so it's directory listing call failure does not stop compass from loading itself into the sass load path:</p> <pre><code>Compass::Frameworks.discover(:defaults) Compass::Frameworks.register_directory(File.join(Compass.base_directory, 'frameworks/compass')) Compass::Frameworks.register_directory(File.join(Compass.base_directory, 'frameworks/blueprint')) </code></pre> <p>which changes a *.scss auto-compile request to:</p> <pre><code>Syntax error: File to import not found or unreadable: susy. Load paths: &lt;removed&gt;/Web Content/common/sass file:&lt;removed&gt;/release/lib/arch/jruby/jruby-complete.jar!/gems/compass-0.12.2/frameworks/compass/stylesheets file:&lt;removed&gt;/release/lib/arch/jruby/jruby-complete.jar!/gems/compass-0.12.2/frameworks/blueprint/stylesheets </code></pre> <p>ok, now we need to get susy into the load path. adding this line to compass's <code>config.rb</code> does not work, though I wish it did: <code>add_import_path "../../../release/lib/arch/jruby/jruby-complete.jar!gems/susy-1.0.7/sass"</code></p> <p><a href="http://henningpetersen.com/post/7/integrating-compass-style-sass-into-tapestry" rel="nofollow">Henning Petersen also caught this, and it was again because of directory listing calls withing the jruby jar</a> altered compass's <code>configuration/adapters.rb</code> and Sass's <code>importers/filesystem.rb</code>. Altering all those files is dirtier to maintain than I am comfortable with, and already the posting is out of date regarding compass &amp;&amp; sass.</p> <p>So I pulled the sass directory out of the jar, which let the compass's <code>add_import_path</code> work as intended. The cleanest solution I have so far is manually appending to the <code>gem/compass-0.12.2/lib/frameworks.rb</code>:</p> <pre><code>Compass::Frameworks.register_directory(File.join(Compass.base_directory, 'frameworks/compass')) Compass::Frameworks.register_directory(File.join(Compass.base_directory, 'frameworks/blueprint')) </code></pre> <p>and then adding this line to the compass project's config.rb (whole file provided):</p> <pre><code> # Require any additional compass plugins here. # Set this to the root of your project when deployed: require 'susy' http_path = "./Web Content/" css_dir = "./Web Content/common/sass-output-css/" sass_dir = "./Web Content/common/sass/" add_import_path "./Web Content/susy-1.0.7-read-only" images_dir = "./Web Content/common/images/" javascripts_dir = "./Web Content/common/js/widgets" # To enable relative paths to assets via compass helper functions. Uncomment: #relative_assets = true </code></pre> <p>which led to the RAD / eclipse builder scss auto-compile ant target to spit out:</p> <pre><code>compass.dev: BUILD SUCCESSFUL Total time: 16 seconds </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload