zmoazeni / csscss

A CSS redundancy analyzer that analyzes redundancy.

Home Page:http://zmoazeni.github.io/csscss/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined method `add_import_path`

Melindrea opened this issue · comments

When trying to use CSSCSS on a .scss file that has an additional import path, it exits with a NoMethodError:

config.rb:14:in `<top (required)>': undefined method `add_import_path' for main:Object (NoMethodError)
from /home/marie/.rvm/gems/ruby-1.9.3-p194/gems/csscss-1.3.1/lib/csscss/cli.rb:110:in `load'
from /home/marie/.rvm/gems/ruby-1.9.3-p194/gems/csscss-1.3.1/lib/csscss/cli.rb:110:in `block (2 levels) in parse'

My config.rb looks like the following:

require "breakpoint"

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = ".tmp"
sass_dir = "app/styles"
images_dir = "app/styles/images"
javascripts_dir = "app/scripts"
fonts_dir = "app/styles/fonts"
add_import_path "app/components"

These are part of the Compass Configuration. In particular, I'm using it to import files from the folder bower installs in.

One work-around I just found is that if I instead of add_import_path use additional_import_paths = ["app/components"] it works, or at least appears to.

undefined methodadd_import_path' for main:Object`

This makes it sound like possibly a compass version issue? I'm not sure, but that's my gut. Especially considering it is fine with all the other directives.

I'm assuming you're running this as csscss --compass or csscss -compass-with-config?

I'm going to close this as not-a-csscss-issue.

How do you mean by compass version issue? I can use that file and compile using compass fine.

I'm using the command csscss --compass --require config.rb app/styles/style.scss

(Might still be a compass issue, and I have the way to do it, I just like to be thorough.)

Does this fail with the add_import_path config?

csscss --compass-with-config config.rb app/styles/style.scss (Ignore deprecation warning)

Oh. One other test please. csscss --compass app/styles/style.scss

It succeeds with both of those, it appears.

Doh. Then it is a legitimate csscss bug. Thanks.

I went ahead and removed the deprecation for --with-compass-config. It's not a great fix, but at least the deprecation warnings won't be contradictory. This will go out in the version following v1.3.1.