code_stats icon indicating copy to clipboard operation
code_stats copied to clipboard

Failing specs: report.html.haml:10: unknown regexp options - had

Open lastobelus opened this issue 13 years ago • 3 comments

I get the following when running the code_stats specs. I get the same error when trying to run code_stats on a project:

    02:37:34lasto1.9.2 ~/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.7  rsp
    rspec spec -- using /Users/lasto/.rvm/gems/ruby-1.9.2-p290/bin/rspec
    Run options: include {focus: true}

    All examples were filtered out; ignoring {focus: true}
    FFF.FFFFF...FFF..

    Failures:

      1) Project analyze
         Failure/Error: report = CodeStats::Report.new(*projects).render
         SyntaxError:
           /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.7/lib/code_stats/report.html.haml:10: unknown regexp options - had
           /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.7/lib/code_stats/report.html.haml:10: syntax error, unexpected $undefined
           ));}\n    </script>\n  </head>\n  <body>\n", -1, false);
                                          ^
           /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.7/lib/code_stats/report.html.haml:10: syntax error, unexpected $undefined
           ));}\n    </script>\n  </head>\n  <body>\n", -1, false);
                                                    ^
           /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.7/lib/code_stats/report.html.haml:20: syntax error, unexpected tLAMBEG
           ...projects_js = projects.collect{|p| "['#{p.name}', #{p.charac...
           ...                               ^
           /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.7/lib/code_stats/report.html.haml:20: syntax error, unexpected '}', expecting keyword_end
           ... #{p.specs.characters_count}]"}.join(",\n")
           ...                               ^
           /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.7/lib/code_stats/report.html.haml:42: syntax error, unexpected keyword_do_block, expecting keyword_end
            projects.each do |p|
                            ^
           /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.7/lib/code_stats/report.html.haml:60: syntax error, unexpected keyword_ensure, expecting $end
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:209:in `instance_eval'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:209:in `evaluate_source'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:144:in `cached_evaluate'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:127:in `evaluate'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/haml.rb:24:in `evaluate'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/vfs-0.4.8/lib/vfs/entries/file.rb:142:in `render'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/vfs-0.4.8/lib/vfs/entry_proxy.rb:39:in `method_missing'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.7/lib/code_stats/report.rb:40:in `render'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.7/spec/code_stats_spec.rb:6:in `block (2 levels) in <top (required)>'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:80:in `instance_eval'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:80:in `block in run'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:173:in `with_around_hooks'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:77:in `run'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:355:in `block in run_examples'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `map'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `run_examples'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:337:in `run'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `map'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block in run'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:34:in `report'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:25:in `run'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
         # /Users/lasto/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'

lastobelus avatar Feb 21 '12 10:02 lastobelus

Hello, thanks for the report, I fixed errors in specs, but not sure about the problem with YAML syntax error. There's no such error with HAML syntax on my machine, don't know what causes this error on Your's machine and how to fix it, sorry.

al6x avatar Mar 03 '12 17:03 al6x

I get a similar error due to YAML whenever I run it, with the latest 0.1.8 code_stats2 gem:

> code_stats lib/services
please wait, analyzing following projects:
  lib/services
/Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:209:in `instance_eval': /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.8/lib/code_stats/report.html.haml:10: unknown regexp options - had (SyntaxError)
/Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.8/lib/code_stats/report.html.haml:10: syntax error, unexpected $undefined
));}\n    </script>\n  </head>\n  <body>\n", -1, false);
                               ^
/Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.8/lib/code_stats/report.html.haml:10: syntax error, unexpected $undefined
));}\n    </script>\n  </head>\n  <body>\n", -1, false);
                                         ^
/Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.8/lib/code_stats/report.html.haml:20: syntax error, unexpected tLAMBEG
...projects_js = projects.collect{|p| "['#{p.name}', #{p.charac...
...                               ^
/Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.8/lib/code_stats/report.html.haml:20: syntax error, unexpected '}', expecting keyword_end
... #{p.specs.characters_count}]"}.join(",\n")
...                               ^
/Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.8/lib/code_stats/report.html.haml:42: syntax error, unexpected keyword_do_block, expecting keyword_end
 projects.each do |p|
                 ^
/Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.8/lib/code_stats/report.html.haml:60: syntax error, unexpected keyword_ensure, expecting $end
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:209:in `evaluate_source'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:144:in `cached_evaluate'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:127:in `evaluate'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/haml.rb:24:in `evaluate'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/vfs-0.4.8/lib/vfs/entries/file.rb:142:in `render'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/vfs-0.4.8/lib/vfs/entry_proxy.rb:39:in `method_missing'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.8/lib/code_stats/report.rb:40:in `render'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.8/lib/code_stats/code_stats.rb:41:in `analyze_and_report'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/gems/code_stats2-0.1.8/bin/code_stats:48:in `<top (required)>'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/bin/code_stats:19:in `load'
    from /Users/zdennis/.rvm/gems/ruby-1.9.2-p290/bin/code_stats:19:in `<main>'

zdennis avatar Apr 08 '12 22:04 zdennis

Hi guys, I get similar error. I'm using Ruby 1.9.3 with RVM. Please fix it.

zolzaya avatar Apr 15 '12 08:04 zolzaya