Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ruby] Could not parse file Error #83

Open
seoanezonjic opened this issue May 2, 2023 · 0 comments
Open

[ruby] Could not parse file Error #83

seoanezonjic opened this issue May 2, 2023 · 0 comments

Comments

@seoanezonjic
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant