doc: Database#busy_timeout= renders without its description (shadowed by alias_method in database.rb)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- ruby, sqlite
- Domínio
- documentation
Direção de pesquisa
Leia ext/sqlite3/database.c e lib/sqlite3/database.rb:387, onde a issue identifica o método e o alias. Confira como o RDoc renderiza o método C quando o alias Ruby está presente, depois aplique a alteração sugerida no alias e execute bundle exec rdoc. O trabalho estará concluído quando a entrada gerada para busy_timeout= incluir sua descrição e busy_timeout continuar documentado como seu alias.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Ruby
- Estrelas
- 845
- Forks
- 224
- Merge médio
- 2d 1h
- PRs com merge (30d)
- 17
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de 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 mutexTalvez já em andamento @mrhoribu assumiu há 2 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 42/100
sparklemotion/sqlite3-ruby#766 ·
Mantenedores costumam responder em até 1 dia
-
needs-more-info
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 42/100
sparklemotion/sqlite3-ruby#653 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
sparklemotion/sqlite3-ruby#639 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 42/100
sparklemotion/sqlite3-ruby#628 · 10 comentários · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
`Database#load_extensions` is not enabled on Windows when using native gems or compiling vendored source code (sqlite 3.48.0+)Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug help-wanted platform/windows
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
sparklemotion/sqlite3-ruby#618 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de sparklemotion/sqlite3-ruby
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
jdx/mise#15471 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
rubys/roundhouse#1950 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
Mantenedores costumam responder em até 1 dia
-
`Time.at(t, in: nil)` returns UTC instead of the local time (or the time zone of `t`), unlike CRubyAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
Mantenedores costumam responder em até 1 dia