Skip to content

Commit 16924d3

Browse files
committed
added missing descriptions, removed 'fallback dependencies', forced the list to be exhaustive
1 parent 2b8fff6 commit 16924d3

2 files changed

Lines changed: 14 additions & 21 deletions

File tree

docs/app/docs/supported-versions/page.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,18 @@ function getGemDescription(gemName: string): string {
156156
shrine: 'File attachment toolkit for Ruby applications',
157157
sidekiq: 'Simple, efficient background processing for Ruby',
158158
sorbet: 'A type checker for Ruby',
159+
semantic_logger: 'A flexible logging framework for Ruby',
160+
'dotenv-rails': 'Loads environment variables from `.env` files',
161+
active_model_serializers: 'A library for serializing Ruby objects to JSON',
162+
ahoy_matey: 'Analytics for Rails',
159163
};
160164

161-
return descriptions[gemName] || 'Integration supported by LogStruct';
165+
const description = descriptions[gemName];
166+
if (!description) {
167+
throw new Error(
168+
`No description found for gem: ${gemName}. Add it to docs/app/docs/supported-versions/page.tsx`,
169+
);
170+
}
171+
172+
return descriptions[gemName];
162173
}

docs/lib/gemspec-parser.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@ export interface GemDependency {
88
type: 'required' | 'optional';
99
}
1010

11-
// Fallback dependencies in case of parsing errors
12-
const fallbackDependencies: GemDependency[] = [
13-
{ name: 'rails', version: '>= 7.0', type: 'required' },
14-
{ name: 'lograge', version: '>= 0.11', type: 'required' },
15-
{ name: 'sorbet-runtime', version: '>= 0.5', type: 'required' },
16-
{ name: 'bugsnag', version: '~> 6.26', type: 'optional' },
17-
{ name: 'carrierwave', version: '~> 3.0', type: 'optional' },
18-
{ name: 'honeybadger', version: '~> 5.4', type: 'optional' },
19-
{ name: 'rollbar', version: '~> 3.4', type: 'optional' },
20-
{ name: 'sentry-ruby', version: '~> 5.15', type: 'optional' },
21-
{ name: 'shrine', version: '~> 3.5', type: 'optional' },
22-
{ name: 'sidekiq', version: '~> 7.2', type: 'optional' },
23-
{ name: 'sorbet', version: '~> 0.5', type: 'optional' },
24-
];
25-
2611
export function parseGemspec(): GemDependency[] {
2712
try {
2813
// Path to the gemspec file (relative to docs directory)
@@ -60,8 +45,7 @@ export function parseGemspec(): GemDependency[] {
6045

6146
// If no dependencies were found, use fallback data
6247
if (dependencies.length === 0) {
63-
console.warn('No dependencies found in gemspec, using fallback data');
64-
return fallbackDependencies;
48+
throw new Error('No dependencies could be parsed from gemspec!');
6549
}
6650

6751
// Sort dependencies alphabetically, but put required dependencies first
@@ -72,8 +56,6 @@ export function parseGemspec(): GemDependency[] {
7256
return a.name.localeCompare(b.name);
7357
});
7458
} catch (error) {
75-
console.error('Error parsing gemspec:', error);
76-
// Return the fallback data in case of error
77-
return fallbackDependencies;
59+
throw new Error('Error parsing gemspec! ' + error);
7860
}
7961
}

0 commit comments

Comments
 (0)