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 `selectors' #64

Closed filipiz closed 11 years ago

filipiz commented 11 years ago

Hi!

I Just installed the gem and executed the command csscss -v asn_theme.css

and it throwed the following error:

/Users/filipi/.rvm/gems/ruby-1.9.2-p290/gems/csscss-1.3.1/lib/csscss/redundancy_analyzer.rb:18:in `block in redundancies': undefined method `selectors' for #<Hash:0x007ffe7b667070> (NoMethodError)
    from /Users/filipi/.rvm/gems/ruby-1.9.2-p290/gems/csscss-1.3.1/lib/csscss/redundancy_analyzer.rb:17:in `each'
    from /Users/filipi/.rvm/gems/ruby-1.9.2-p290/gems/csscss-1.3.1/lib/csscss/redundancy_analyzer.rb:17:in `redundancies'
    from /Users/filipi/.rvm/gems/ruby-1.9.2-p290/gems/csscss-1.3.1/lib/csscss/cli.rb:40:in `execute'
    from /Users/filipi/.rvm/gems/ruby-1.9.2-p290/gems/csscss-1.3.1/lib/csscss/cli.rb:17:in `run'
    from /Users/filipi/.rvm/gems/ruby-1.9.2-p290/gems/csscss-1.3.1/lib/csscss/cli.rb:203:in `run'
    from /Users/filipi/.rvm/gems/ruby-1.9.2-p290/gems/csscss-1.3.1/bin/csscss:4:in `<top (required)>'
    from /Users/filipi/.rvm/gems/ruby-1.9.2-p290/bin/csscss:19:in `load'
    from /Users/filipi/.rvm/gems/ruby-1.9.2-p290/bin/csscss:19:in `<main>'
    from /Users/filipi/.rvm/gems/ruby-1.9.2-p290/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/filipi/.rvm/gems/ruby-1.9.2-p290/bin/ruby_noexec_wrapper:14:in `<main>'

Anything related to ruby version?

zmoazeni commented 11 years ago

@filipiz Actually, looks like it's a slight bug in the parser. Is that css publicly available? Could I have access to it?

filipiz commented 11 years ago

We had some issues with less and we stayed with lots of dead and redundant code on it. It is not public yet, but I put it online on http://lab.nextt.com.br/asn_theme.css

Thanks!

zmoazeni commented 11 years ago

Thanks. I'll take a look and figure out what the parser is choking on.

zmoazeni commented 11 years ago

I just merged in @carsonmcdonald's fix #67 which will fix this. I'll release it the following release after v1.3.1.