Commit graph

14659 commits

Author SHA1 Message Date
James Reid-Smith
366fd9642f [ruby/rdoc] Hide hamburger on desktop
(https://github.com/ruby/rdoc/pull/1237)

* Clean up the duplicate definitions and unnecessary print styling

* Hides the navigation toggle when there's enough room to always display the navigation

* Update lib/rdoc/generator/template/darkfish/css/rdoc.css

---------

c6193bf1e2

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-12-15 13:36:38 +00:00
James Reid-Smith
f9dc41b6a9 [ruby/rdoc] Fix iPad Pro navigation not shown
(https://github.com/ruby/rdoc/pull/1236)

Found this issue when I was debugging the navigation toggle. I noticed
it first in the chrome dev tools, but it was also reproducible on
an iPad Pro.

Symptom:
- On iPad Pro, the navigation section is hidden but there's enough
  space to show it. Making the user have to click the hamburger
  button to show it but it's not necessary to hide the navigation
  section.
- On desktop, the navigation section is shown.
- On mobile, the navigation section is hidden until the hamburger
  button is clicked.

Fix:
- The javascript code was matching 1024px instead of 1023px. The media
  sections of the css was altering the layout on 1024px. So ipad got
  the full desktop layout but the navigation section was hidden.

1794e59755
2024-12-15 13:24:53 +00:00
tomoya ishida
2c57b87cc3 [ruby/reline] Refactor Reline::Unicode ed_ vi_ em_ methods
(https://github.com/ruby/reline/pull/720)

* Refactor Reline::Unicode vi_ ed_ em_ methods

* Make Reline::Unicode's vi_ ed_ em_ method encoding safe

cdd7288978
2024-12-15 11:50:43 +00:00
Stan Lo
593b90a6d4 [ruby/irb] Fix broken rdoc-ref caused by a typo
(https://github.com/ruby/irb/pull/1049)

cdc88fe87f
2024-12-14 19:37:57 +00:00
Stan Lo
562b9fc525 [ruby/irb] Avoid generating documentation pages for internal
components
(https://github.com/ruby/irb/pull/1047)

f57025a35e
2024-12-13 17:08:34 +00:00
Stan Lo
598c6cfe80 [ruby/rdoc] Bump version to v6.9.0
dba9474732
2024-12-13 16:13:27 +00:00
Camden Narzt
6cde41bc52 [rubygems/rubygems] Fix restarting with locked version when $PROGRAM_NAME has been changed
Use Process.argv0 instead of $PROGRAM_NAME because $PROGRAM_NAME is
liable to be changed but Process.argv0 is not.

43b747dc9e
2024-12-13 14:23:30 +00:00
Hiroshi SHIBATA
e91b25ec8d Fixed compatibility error with setup command and rdoc plugin on rubygems 2024-12-13 15:39:41 +09:00
Hiroshi SHIBATA
654404a9c2
Removed unnecessary plugin file in ruby/ruby repository 2024-12-13 14:42:13 +09:00
mterada1228
7e3c29250e Make it loose coupling between RubyGems and RDoc (#1171)
* Make it loose coupling between RubyGems and RDoc

\### Problems

There are following problems because of tight coupling between RubyGems and RDoc.

1. If there are braking changes in RDoc, RubyGems is also broken.
2. When we maintain RDoc, we have to change RubyGems.

The reason why they are happened is that RubyGems creates documents about a gem with installing it.

Note that RubyGems uses functions of RDoc to create documents.
Specifically,

- Creating documents is executed by `rubygems/lib/rubygems/rdoc.rb`.
- `::RDoc::RubygemsHook` which is defined by RDoc is called by the file.

\### Solution

RubyGems has the plugin system.

If a gem includes `rubygems_plugin.rb`, RubyGems loads it.
RubyGems executes a process defined in it while installing gems, uninstalling gems or other events.

We can use the system to solve the problems.

The root cause is RubyGems directly references the class of RDoc.

We can remove the root cause by making RDoc RubyGems plugin.

Alternatively `rubygems_plugin.rb` creates documents about gems.

\### FAQ

Q1. Do we need to change codes of RubyGems?

A.

No, we don't.

This change keeps compatibility of API used from RubyGems.

Q2. Is it better to delete existing codes related to RDoc in RubyGems?

No, it isn't.

If we change codes of RubyGems,
we can't keep a compatibility.

Example:

If we delete codes that uses `RDoc::RubygemsHook` in `rubygems/lib/rubygems/rdoc.rb`,
documentations are not created with old RDoc.

Q3. When can we delete `rubygems/lib/rubygems/rdoc.rb`?

A.

We can delete it when all users use RDoc including `rubygems_plugin`.

Next ruby version is 3.4.
If it includes the RDoc including `rubygems_plugin`,
we can delete `rubygems/lib/rubygems/rdoc.rb` after ruby 3.3 is EOL.

Q4. Is it a breaking change that Rubygems creates documents with
rubygems_plugin not RDoc::RubygemsHook?

A.

No, it isn't.

If we simply implement this approach,
we move the implementation from `rdoc/lib/rdoc/rubygems_hook.rb` to
`rubygems_plugin.rb`.

This way can be breaking change.

It seems to be fine that we just need to delete `rdoc/rubygems_hook.rb` but it doesn't work.
It generates multiple documents.

`rubygems/lib/rubygems/rdoc.rb` has the following code.

```
begin
  require "rdoc/rubygems_hook"
  # ...
rescue LoadError
end
```

This code ignores RDoc related processes when `rdoc/rubygems_hook` can't be required.
But, this 'require' is not failed.

This is because Ruby installs Rdoc as a default gem.

So, Rdoc installed as a default gem generates documents and one installed as a normal gem does it too.

If you think that this behavior is accectable,
we can just delete `rdoc/rubygems_hook.rb`.

What do you think about this approach?

In this change, we take another approach to solve the problem that creates multiple documents.

If `Gem.done_installing(&Gem::RDoc.method(:generation_hook))` in `rubygems/rdoc.rb` doesn't create documents,
we can solve the problem.

We have some options.

* We change `rubygems/rdoc.rb` and then don't execute `Gem.done_installing`.
  (This is a change for RubyGems.)
* We change `rdoc/rubygems_hook.rb` and then make `generation_hook` a no-op method.
  (This is a change for RDoc.)

We choose the latter to avoid changing for RubyGems.

\### Test

\#### Preparation

Install Rdoc which including our changes by executing `rake install`.

❯ rake install

We confirmed that Rdoc which including our changes was installed.

❯ gem list | grep rdoc
rdoc (6.6.0, default: 6.4.0)

\#### Check point

We tested to check compatibility.

How to chack the compatibility?

We tested creating same documents by our RDoc and old RDoc with latest RubyGems.

We used following versions to test.

```
❯ ruby -v
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin22]

❯ gem list | grep rdoc
rdoc (default: 6.4.0)

❯ ruby -I rubygems/lib rubygems/exe/gem --version
3.5.14
```

Here is a result of test with old RDoc.
We can see that the document is created correctlly with `Parsing...` and `Done installing...`.

```
❯ ruby -I rubygems/lib rubygems/exe/gem install pkg-config
Successfully installed pkg-config-1.5.6
Parsing documentation for pkg-config-1.5.6
Done installing documentation for pkg-config after 0 seconds
1 gem installed
```

Here is a result of test with our RDoc.
We can see that the document is created correctlly with `Parsing...` and `Done installing...`.

```
❯ ruby -I rubygems/lib rubygems/exe/gem install pkg-config
Successfully installed pkg-config-1.5.6
Parsing documentation for pkg-config-1.5.6
Done installing documentation for pkg-config after 0 seconds
1 gem installed
```

As you can see we got the same results, our RDoc keeps compatibility.

* rename a test file

* Revert "rename a test file"

This reverts commit 70a144bf3fb8f2cc653972e858b5fed3747765d7.

* revert a test class name

* exclude `TestRDocRubyGemsHook` at job of ruby-core

* When `rubygems_plugin.rb` is not found, `test_rdoc_rubygems_hook.rb` is skipped.

* remove unnecessary whitespace

* add comment

* Add support for the case that RDoc is installed as a default gem

* Fix problems

Co-authored-by: mterada1228 <49284339+mterada1228@users.noreply.github.com>

* Simplify

* removed unused blank lines and revert test

* for rerun tests

* add comment for rubygems_plugin.rb

---------

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2024-12-13 05:35:00 +00:00
David Rodríguez
71bebcf658
Bump vendored uri to 1.0.2 2024-12-13 11:29:34 +09:00
David Rodríguez
57f222c182
Bump vendored net-http to 0.6.0 2024-12-13 11:29:17 +09:00
David Rodríguez
cd460d5d8d
Bump vendored securerandom to 0.4.0 2024-12-13 11:24:08 +09:00
Jeremy Evans
f0f9e2f50c
[ruby/resolv] Allow setting default Resolv::DNS config in Resolv.new
If a positional argument is provided, the use_ipv6 keyword
option is ignored:

```ruby
Resolv.new([Resolv::DNS.new], use_ipv6: false)
```

Issue a warning in this case.

Currently, you have to pass a positional hash argument to set
the DNS config.  However, after support for the use_ipv6 keyword
argument is removed, you will be able to pass either a positional
hash or keyword arguments.  Code that was just specifying the
use_ipv6 keyword optional will still work correctly in that case.

5ff9dda991
2024-12-13 10:54:48 +09:00
Hiroshi SHIBATA
43faf09bb9 [ruby/resolv] Bump up v0.6.0
cb4b335034
2024-12-13 01:13:12 +00:00
Hiroshi SHIBATA
5e05642c61 [ruby/logger] Bump up v1.6.3
97bce95f49
2024-12-13 10:05:16 +09:00
Hiroshi SHIBATA
f5850c0cf7 [ruby/shellwords] Bump up v0.2.2
55ab74d37a
2024-12-13 00:50:02 +00:00
Stan Lo
ff8570b005 Fix LoadError's linking issue
Original issue: https://github.com/ruby/rdoc/issues/1128

The problem is caused by the `# :stopdoc:` directive in `bundled_gems.rb`,
which's scope covers the redefinition of `LoadError`.

Since the goal of `# :stopdoc:` is to hide the documentation of `Gem::BUNDLED_GEMS`,
we can use `# :nodoc:` on it instead.
2024-12-12 16:43:25 -05:00
James Reid-Smith
c0caf1cc1a [ruby/irb] Load history when starting a direct debug session
(https://github.com/ruby/irb/pull/1046)

* Load history when starting a direct debug session

When starting a debug session directly with RUBY_DEBUG_IRB_CONSOLE=1 and
`require 'debug'; debugger`, IRB's history wasn't loaded. This commit ensures
history is loaded in this case by calling `load_history` when configuring IRB
for the debugger.

Fixes ruby/irb#975

* Update test/irb/test_history.rb

* Update lib/irb/debug.rb

---------

7f851b5353

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-12-12 17:26:06 +00:00
tomoya ishida
300be2b192 [ruby/reline] Undo and redo should restore indentation
(https://github.com/ruby/reline/pull/793)

* Undo and redo should restore indentation

Undo and redo should not perform auto indentation. It should not change the indentation. Instead, it should restore previous indentation.

* Rename ivar undoing(undoing or redoing) to restoring

6355a6e0b2
2024-12-12 16:40:08 +00:00
Stan Lo
911879e01f [ruby/irb] Bump version to v1.14.2
(https://github.com/ruby/irb/pull/1045)

dd31884657
2024-12-12 13:14:56 +00:00
Kevin Newton
34e68548d4 [ruby/prism] Bump typechecking deps
230c8b8a48
2024-12-11 19:50:20 +00:00
David Rodríguez
cfb7213882 [rubygems/rubygems] Normalize CLI flag documentation and make sure all flags are documented
20a834818b
2024-12-11 17:56:28 +00:00
Adam Leach
e1fcf20ea1 [rubygems/rubygems] Add documentation for changelog flags in bundle gem
The --changelog and --no-changelog flags are missing from docs, this adds them in a way that matches other flags

92f77678fe
2024-12-11 17:56:28 +00:00
David Rodríguez
f658f66124 [rubygems/rubygems] Add missing --pre flag to bundle update --help
21335a7378
2024-12-11 17:56:27 +00:00
David Rodríguez
af11c8ef4f [rubygems/rubygems] Add missing --outdated flag to bundle show --help
2864e54ce3
2024-12-11 17:56:27 +00:00
David Rodríguez
a1fee6de95 [rubygems/rubygems] Add missing flags documentation to bundle outdated --help
ad3b654bf3
2024-12-11 17:56:26 +00:00
David Rodríguez
1806f3facc [rubygems/rubygems] Add several missing flags to bundle lock --help
4070da1264
2024-12-11 17:56:26 +00:00
David Rodríguez
496e791a2e [rubygems/rubygems] Add missing flag documentation to bundle inject --help
2a01773cdb
2024-12-11 17:56:25 +00:00
David Rodríguez
6e3a6f6411 [rubygems/rubygems] Add missing --version flag to bundle info --help
5022b49e31
2024-12-11 17:56:25 +00:00
David Rodríguez
f5ed1b56d0 [rubygems/rubygems] Add several missing flags to bundle gem --help
aaf6398870
2024-12-11 17:56:24 +00:00
David Rodríguez
443319de35 [rubygems/rubygems] Add missing --gemfile flag to exec, lock, and update command's help
418dfbf373
2024-12-11 17:56:24 +00:00
David Rodríguez
c4bd744800 [rubygems/rubygems] Normalize whitespace in option lists in man pages
33ff4f8f2f
2024-12-11 17:56:24 +00:00
David Rodríguez
5633cff415 [rubygems/rubygems] Add missing flag documentation to bundle cache --help
b760a882a1
2024-12-11 17:56:23 +00:00
David Rodríguez
e88039ee4c [rubygems/rubygems] Add missing --all-platforms flag to bundle binstubs --help
440b7b8282
2024-12-11 17:56:23 +00:00
David Rodríguez
447189d7de [rubygems/rubygems] Add missing --glob flag to bundle add --help
1e4dc0a703
2024-12-11 17:56:22 +00:00
David Rodríguez
bbd11a7975 [rubygems/rubygems] Add missing --target-rbconfig flag to bundle install --help
54dbcdc656
2024-12-11 17:56:22 +00:00
David Rodríguez
ac959b177a [rubygems/rubygems] Clarify --target-rbconfig option banner
6625998ca6
2024-12-11 17:56:21 +00:00
David Rodríguez
99460d1eda [rubygems/rubygems] Add missing banners to bundle exec CLI flags
c6f62b2eed
2024-12-11 17:56:21 +00:00
David Rodríguez
06f074eb5c [rubygems/rubygems] Style CLI options consistently
In one liners, no whitespace for alignment.

413339a9ca
2024-12-11 17:56:20 +00:00
David Rodríguez
b37ab8c123 [rubygems/rubygems] Add missing man pages for bundle env and bundle licenses commands
6e1a515d58
2024-12-11 16:18:12 +00:00
David Rodríguez
d91ca85b97 [rubygems/rubygems] Bring man pages up to date
8288cfd3e0
2024-12-11 16:18:11 +00:00
David Rodríguez
e31f6a8f8b [rubygems/rubygems] Align all header lines with titles for consistency
83fd1c6718
2024-12-11 16:18:10 +00:00
Stan Lo
2335ecb7fa [ruby/irb] Page the output in irb:rdbg sessions too
(https://github.com/ruby/irb/pull/1043)

IRB started to page its evaluation output and it became a useful feature
for users. However, in `irb:rdbg` sessions, the output is not paged so
the sudden change in behavior is surprising and inconvenient.

This commit makes `irb:rdbg` sessions page the output of the debugger
too.

8241ec9a0c
2024-12-11 11:30:36 +00:00
tomoya ishida
3568e7aef7 [ruby/reline] Fix line wrapped cursor position
(https://github.com/ruby/reline/pull/791)

Cursor position calculation was wrong when the input line contains "\1" or CSI escape sequence.

a1943daaf4
2024-12-10 10:28:22 +00:00
David Rodríguez
ebb80c26b3 [ruby/resolv] Securerandom should be always available
324c355eb7
2024-12-10 10:08:49 +00:00
Stan Lo
93f8de777f [ruby/rdoc] Expand rdoc-ref targets at the end of ri output
(https://github.com/ruby/rdoc/pull/1141)

There have been several document refactors in ruby/ruby that extract
individual methods/classes' documentation into separate files, like
ruby/ruby#6567

Because RI is not capable of rendering those references, RI users
are left with dramatically fewer documentation on those methods/classes.

This commit adds a new option `--expand-ref` (default: true) to expand
all the rdoc-ref targets at the end of the output.

9e2b28c6e3
2024-12-09 17:21:01 +00:00
OKURA Masafumi
895f2c2152 [ruby/rdoc] lint: Remove unreachable code
(https://github.com/ruby/rdoc/pull/1137)

This is an attempt to utilize RuboCop further.
RuboCop was added in 9262fdd43a
but only a few rules have been enabled.
I believe we can utilize RuboCop more for better code quality,
especially with Lint cops.
This is the first step to enable other Lint cops.
This commit also exclude some auto generated files.

a53287fce0
2024-12-08 23:14:18 +00:00
nicholas a. evans
dd43af3be7 [ruby/rdoc] Use distinct styles for note lists and label lists
(https://github.com/ruby/rdoc/pull/1209)

* Use the original `label` description list style

As a default for all description lists, the original "label" style is
more readable.

This is slightly different from the original `label` dl though:
* slightly increased left margin for `dd` (to 1em)
* removed right margin on `dd`
* removed `dt` bottom margin and `dd` top margin, to reduce the gap
  between the term and its description (to only the standard line-height
  gap).

* Add closing tags for description list terms

Without the closing tags, the dt elements contain whitespace after the
text.  This normally isn't a big deal, but does mess some things up,
e.g: using `::after` with `content: ", "` in stylesheets.

* Restore float:left style for note lists

Unlike the original note list styles, this version sets the line-height
for all `dt` elements to be the same as the `p` elements contained
inside the `dd`, so that the second line has the same indentation as all
subsequent lines.

* Add commas between note list terms

9e69ea6d75
2024-12-08 10:43:47 +00:00
David Rodríguez
48443c0204 [rubygems/rubygems] Skip unresolved deps warning on Gem::Specification.reset on benign cases
If `Gem::Specification.reset` is used, but there are still unresolved
dependencies, RubyGems prints a warning. There are though, certain cases
where the situation will not cause any issues.

One such case is when the unresolved dependency does not restrict any
versions (>= 0) and there's a default gem matching it.

In this situation, it doesn't matter if Gem paths change, because
default gems are still activatable, so the dependency will be properly
activated if ever needed.

e5f8a3068e
2024-12-06 15:19:19 +00:00