https://github.com/puntorigen/ruby_parser
Pure JS Ruby file parser
https://github.com/puntorigen/ruby_parser
ast info parser ruby
Last synced: 7 months ago
JSON representation
Pure JS Ruby file parser
- Host: GitHub
- URL: https://github.com/puntorigen/ruby_parser
- Owner: puntorigen
- License: mit
- Created: 2022-08-24T03:14:58.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-02T22:56:42.000Z (over 2 years ago)
- Last Synced: 2024-10-14T02:49:36.837Z (8 months ago)
- Topics: ast, info, parser, ruby
- Language: JavaScript
- Homepage:
- Size: 192 KB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JS Ruby file parser
Simple class for parsing ruby files, getting their methods, arguments, comments and AST.```js
const ruby = require('ruby_parser');
const parserObj = new ruby();const parsed = parserObj.parse({
filePath: 'tests/test.rb',
// rubyString: `i = 7` // you can use filePath or rubyString
});const info = parserObj.getInfo();
const methods = parserObj.getMethods();
const comments = parserObj.getComments();
const ast = parserObj.getAst(); // also, parserObj.parse method returns the ast
```