({
major,
minor,
rubyPath,
gemPath,
}: {
major: number;
minor: number;
rubyPath: string;
gemPath: string;
})
| 69 | } |
| 70 | |
| 71 | function makeLocalRubyEnv({ |
| 72 | major, |
| 73 | minor, |
| 74 | rubyPath, |
| 75 | gemPath, |
| 76 | }: { |
| 77 | major: number; |
| 78 | minor: number; |
| 79 | rubyPath: string; |
| 80 | gemPath: string; |
| 81 | }) { |
| 82 | const gemHome = join(tmpdir(), `vercel-ruby-${major}${minor}-${process.pid}`); |
| 83 | |
| 84 | const matchedOption = allOptions.find( |
| 85 | o => o.major === major && o.minor === minor && o.state !== 'discontinued' |
| 86 | ); |
| 87 | |
| 88 | if (!matchedOption) { |
| 89 | throw new NowBuildError({ |
| 90 | code: 'RUBY_INVALID_VERSION', |
| 91 | link: 'http://vercel.link/ruby-version', |
| 92 | message: `Local Ruby ${major}.${minor} does not match any supported Vercel runtime. Supported: ${allOptions |
| 93 | .filter(o => o.state !== 'discontinued') |
| 94 | .map(o => `${o.major}.${o.minor}`) |
| 95 | .join(', ')}`, |
| 96 | }); |
| 97 | } |
| 98 | |
| 99 | return { |
| 100 | major, |
| 101 | gemHome, |
| 102 | runtime: matchedOption.runtime, |
| 103 | rubyPath, |
| 104 | gemPath, |
| 105 | vendorPath: `vendor/bundle/ruby/${major}.${minor}.0`, |
| 106 | }; |
| 107 | } |
| 108 | |
| 109 | function getRubyPath(meta: Meta, gemfileContents: string) { |
| 110 | let selection: RubyVersion | null = null; |
no test coverage detected