doc: Database#busy_timeout= renders without its description (shadowed by alias_method in database.rb)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 78/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- ruby, sqlite
- Bereich
- documentation
Rechercherichtung
Lies ext/sqlite3/database.c und lib/sqlite3/database.rb:387, wo der Issue die Methode und den Alias nennt. Prüfe, wie RDoc die C-Methode darstellt, wenn der Ruby-Alias vorhanden ist, wende dann die vorgeschlagene Aliasänderung an und führe bundle exec rdoc aus. Fertig ist die Änderung, wenn der generierte Eintrag für busy_timeout= seine Beschreibung enthält und busy_timeout weiterhin als sein Alias dokumentiert ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
The generated docs show Database#busy_timeout= with no description. Its rdoc comment in ext/sqlite3/database.c ("Indicates that if a request for a resource terminates because that resource is busy, …") is never rendered, on main too, so anything added to that comment is invisible in the published docs. #771 adds text there about holding the GVL and deferring interrupts, which is how this came up.
Cause
lib/sqlite3/database.rb:387:
alias_method :busy_timeout, :busy_timeout=
When RDoc (8.1.0 here) parses this, it creates an undocumented busy_timeout= entry for SQLite3::Database, and that entry takes the place of the C method's documentation.
Checked by running rdoc on subsets of the files:
Files given to rdoc |
busy_timeout= description rendered |
|---|---|
ext/sqlite3/database.c alone |
yes |
ext/sqlite3/database.c + lib/sqlite3/pragmas.rb |
yes |
ext/sqlite3/database.c + lib/sqlite3/database.rb |
no |
the whole repo (bundle exec rdoc, as rdoc.yml runs it) |
no |
ext/sqlite3/database.c + lib/sqlite3/database.rb without the alias_method line |
yes |
Suggested fix
Define the alias in C, next to the method, and drop the Ruby alias_method:
rb_define_method(cSqlite3Database, "busy_timeout=", set_busy_timeout, 1);
rb_define_alias(cSqlite3Database, "busy_timeout", "busy_timeout=");
With that change, the busy_timeout= description renders, and busy_timeout still appears as "Alias for: busy_timeout=". Runtime behaviour is unchanged, since both define the same alias on SQLite3::Database.
I haven't included this in #771 to keep that PR focused. Happy to open a separate PR if you'd like.
- Vorherrschende Sprache
- Ruby
- Sterne
- 845
- Forks
- 224
- Ø Merge
- 2 T. 1 Std.
- Gemergte PRs (30 T.)
- 17
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus sparklemotion/sqlite3-ruby
-
Windows native gem: SQLite's Sleep() resolves to Ruby's rb_w32_Sleep, releasing the GVL (and delivering interrupts) while SQLite holds the connection mutexEvtl. vergeben @mrhoribu hat das vor 1 Tag übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
sparklemotion/sqlite3-ruby#766 ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs-more-info
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 42/100
sparklemotion/sqlite3-ruby#653 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
sparklemotion/sqlite3-ruby#639 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
sparklemotion/sqlite3-ruby#628 · 10 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug help-wanted platform/windows
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
sparklemotion/sqlite3-ruby#618 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in sparklemotion/sqlite3-ruby
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
rubys/roundhouse#1917 ·
-
Store credit application selects a payment method from another storeEvtl. vergeben @beobungbu hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
test_rescues_connection_reset_on_issue_comments_lookup fails on master and blocks every pull requestOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 91/100
zerocracy/judges-action#3142 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Malformed encoded_filters causes a 500, and keeps failing with session persistenceEvtl. vergeben @officialasishkumar hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
avo-hq/avo#4986 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag