How can I call compass in my ruby code to compile a project without calling the shell command?
I tried to adapt the solution from Using Compass from Ruby (not shell) but without success. My project structure looks like
assets/scss (location of uncompiled project files)
assets/css (location for compiled css)
assets/compass/config.cfg (the compass config file)
I have tried something like this
fixed_options = {
:project_path => '/path/to/assets,
:sass_path => 'scss',
:css_path => 'css'
}
Compass.add_project_configuration '/path/to/assets/compass/config.rb'
Compass.add_configuration fixed_options, 'custom'
Compass.compiler.run
This works, but ONLY if i do by running irb
while inside the project root /path/to/assets
.
It seems like anything set in fixed_options
overrides options in config.rb
as desired (or they are merged, or there are two sets of options: it's a bit hard for me to tell), however the :project_path
doesn't seem do do anything as compass only seems to care about the directory I run irb
from.
Note: I have been trying use the output of Compass.compiler
in irb
to try and understand what is happening.