zmoazeni/csscss

undefined method `selectors'

filipiz opened this issue · 4 comments

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?

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

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!

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

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