An open API service indexing awesome lists of open source software.

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

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
```