@ast-grep/lang-ruby
Advanced tools
+24
-2
| const path = require('node:path') | ||
| const libPath = path.join(__dirname, 'parser.so') | ||
| const fs = require('node:fs') | ||
| const { resolvePrebuild } = require('@ast-grep/setup-lang') | ||
| function getLibPath() { | ||
| const prebuild = resolvePrebuild(__dirname) | ||
| if (prebuild) { | ||
| return prebuild | ||
| } | ||
| const native = path.join(__dirname, 'parser.so') | ||
| if (fs.existsSync(native)) { | ||
| return native | ||
| } | ||
| throw new Error('No parser found. Please ensure the parser is built or a prebuild is available.') | ||
| } | ||
| let libPath | ||
| module.exports = { | ||
| libraryPath: libPath, | ||
| get libraryPath() { | ||
| if (!libPath) { | ||
| libPath = getLibPath() | ||
| } | ||
| return libPath | ||
| }, | ||
| extensions: ['rb', 'rbw', 'gemspec'], | ||
@@ -7,0 +29,0 @@ languageSymbol: 'tree_sitter_ruby', |
+5
-5
| { | ||
| "name": "@ast-grep/lang-ruby", | ||
| "version": "0.0.3", | ||
| "version": "0.0.4", | ||
| "description": "", | ||
@@ -21,6 +21,6 @@ "main": "index.js", | ||
| "dependencies": { | ||
| "@ast-grep/setup-lang": "0.0.3" | ||
| "@ast-grep/setup-lang": "0.0.4" | ||
| }, | ||
| "peerDependencies": { | ||
| "tree-sitter-cli": "0.25.6" | ||
| "tree-sitter-cli": "0.25.8" | ||
| }, | ||
@@ -33,4 +33,4 @@ "peerDependenciesMeta": { | ||
| "devDependencies": { | ||
| "@ast-grep/nursery": "0.0.5", | ||
| "tree-sitter-cli": "0.25.6", | ||
| "@ast-grep/nursery": "0.0.7", | ||
| "tree-sitter-cli": "0.25.8", | ||
| "tree-sitter-ruby": "0.23.1" | ||
@@ -37,0 +37,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
22040323
016002
0.11%3
50%+ Added
+ Added
- Removed
- Removed
Updated