Skip to content

[ruby] Could not parse file Error #83

Open
@seoanezonjic

Description

@seoanezonjic

I'm using this great package to analyse a ruby code but it gives me this error:

  File "/mnt/home/soft/soft_bio_267/programs/x86_64/pyenv/.pyenv/versions/3.10.8/lib/python3.10/site-packages/code2flow/ruby.py", line 218, in get_tree
    raise AssertionError(
AssertionError: Ruby-parse could not parse file 'bin/coPatReporter.rb'. You may have a syntax error. For more detail, try running the command `ruby-parse bin/coPatReporter.rb`.

The error is because the gem parser adds the message "Resolving dependencies..." to the json ouput and this output is corrupted. I made a quick fix in method get_tree in ruby.py adding the following before try command:

import re
output = re.sub(rb'Resolving dependencies...', rb'', output)

This patch fix the problem I describe it here to be added o to be replaced for a proper way to handle this problem in an official release.
Thank you in advance.
Pedro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions