zmoazeni / csscss

A CSS redundancy analyzer that analyzes redundancy.
http://zmoazeni.github.io/csscss/
MIT License
2.92k stars 151 forks source link

undefined method `add_import_path` #63

Closed Melindrea closed 11 years ago

Melindrea commented 11 years ago

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.

zmoazeni commented 11 years ago

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.

Melindrea commented 11 years ago

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.)

zmoazeni commented 11 years ago

Does this fail with the add_import_path config?

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

zmoazeni commented 11 years ago

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

Melindrea commented 11 years ago

It succeeds with both of those, it appears.

zmoazeni commented 11 years ago

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

zmoazeni commented 11 years ago

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.