Граф коммитов

10238 Коммитов

Автор SHA1 Сообщение Дата
Peter Zhu 5ca2335802 [ruby/irb] [DOC] Fix formatting in docs
https://github.com/ruby/irb/commit/3ddc89e38c
2022-06-20 22:42:30 +09:00
Stan Lo 2d4a41df6b [ruby/irb] Commands should respect `USE_COLORIZE` config (https://github.com/ruby/irb/pull/362)
https://github.com/ruby/irb/commit/534688dfc4
2022-06-20 22:27:30 +09:00
citrusmoose 8d689294d0 [rubygems/rubygems] Fix extension paths in generated standalone script
The paths for extensions of gems would contain the hardcoded ruby
version on which the extension was built. This will replace it with
runtime ruby version like the parent version directory. It will make the
standalone script compatible between different ruby version installations.

https://github.com/rubygems/rubygems/commit/a9dae93d5d
2022-06-20 16:04:47 +09:00
Josh Nichols aeab405878 [rubygems/rubygems] Improve performance of Bundler::SpecSet#for by using hash lookup of handled deps
I was looking at (yet another) flamegraph in speedscope, and used the
'left hand heavy' and was shocked to realize that 0.5s of the 1.7s
is spent in DepProxy#name. This method _only_ delegates the name to an
underlying spec, so it's not complex at all.

It seems to be of how often this line ends up calling it:

     next if handled.any?{|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler"

The `handled` array is built up as dependencies are handled, so this get
slower as more dependencies are installed.

This change changes how `handled` is track. Instead of just an array, I've
tried using a Hash, with the key being a dep's name, and the value being
a list of deps with that name. This means it's constant time to find
the dependencies with the same name.

I saw a drop from 1.7s to 1.0s against master, and from 0.95s to 0.24s
when used with https://github.com/rubygems/rubygems/pull/5533

https://github.com/rubygems/rubygems/commit/844dac30d4
2022-06-20 02:34:41 +09:00
Burdette Lamar 9327b6f222 [ruby/fileutils] [DOC] Revisions for module-level doc (https://github.com/ruby/fileutils/pull/90)
* Revisions for module-level doc

https://github.com/ruby/fileutils/commit/dcbad90a1f
2022-06-17 22:36:26 +09:00
David Rodríguez 1e8bf48fd5 [rubygems/rubygems] Bring TODO message up to date
https://github.com/rubygems/rubygems/commit/e07dba0923
2022-06-17 17:05:21 +09:00
David Rodríguez 5450b409fc [rubygems/rubygems] Remove part of comment that fell out of date
https://github.com/rubygems/rubygems/commit/272ac23aa8
2022-06-17 17:05:20 +09:00
David Rodríguez 8855b68f97 [rubygems/rubygems] Don't modify RbConfig at all when building extensions
Instead, pass sitearchdir and sitelibdir directly to `make`.

This also removes the need to create and use the siteconf file at all
when generating makefiles.

https://github.com/rubygems/rubygems/commit/dea41fa2dc
2022-06-17 17:05:20 +09:00
David Rodríguez 1aaeff8e36 [rubygems/rubygems] Remove unnecessary condition
This variable can't be falsy.

https://github.com/rubygems/rubygems/commit/b838f9a6f0
2022-06-17 17:05:19 +09:00
David Rodríguez 5a385677f3 [rubygems/rubygems] No need to change `RbConfig::CONFIG` at all
Only `RbConfig::MAKEFILE_CONFIG` is actually used.

https://github.com/rubygems/rubygems/commit/b767cc0929
2022-06-17 17:05:19 +09:00
Burdette Lamar 0ab2bca11c [ruby/fileutils] [DOC] Small tweaks (https://github.com/ruby/fileutils/pull/89)
https://github.com/ruby/fileutils/commit/13ab96439b
2022-06-16 23:56:37 +09:00
Shishir Joshi c310691dd8 [ruby/net-http] Make `Net::HTTPHeader#content_range` return nil on non-byte units
* Returning nil from the `content_range` method instead of raising an
  error when the unit in the content-range header is not "bytes".

Fix https://bugs.ruby-lang.org/issues/11450

https://github.com/ruby/net-http/commit/0b5030dd86

Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-06-16 23:35:27 +09:00
Nobuyoshi Nakada 2223eb082a
Revert "HTTPHeader.content_range throws error on non-byte units"
This reverts commit 63546bfc15.
2022-06-16 22:10:59 +09:00
Nobuyoshi Nakada 1cc64a5514 [ruby/racc] Fix flag to `Regexp.new`
Probably intended to pass encoding "none".

https://github.com/ruby/racc/commit/65cd26efd8
2022-06-16 21:43:53 +09:00
Shishir Joshi 63546bfc15
HTTPHeader.content_range throws error on non-byte units
* Added a nil check in Net::HTTPHeader#initialize_http_header for keys in the header that do not have any value
* Returning nil from the content_range method instead of raising an error when the unit in the content-range header is not bytes
* Modified initialize_http_header to match trunk

fix [Bug #11450]
fix https://github.com/ruby/ruby/pull/1018
2022-06-16 20:16:47 +09:00
Burdette Lamar 1e8fed2d2a [ruby/fileutils] [DOC] More on paths and lists (https://github.com/ruby/fileutils/pull/88)
https://github.com/ruby/fileutils/commit/ba3ae2430d
2022-06-16 05:56:39 +09:00
Burdette Lamar 788a5e14fa [ruby/fileutils] [DOC] More on cp_r (https://github.com/ruby/fileutils/pull/87)
* More on cp_r

https://github.com/ruby/fileutils/commit/82a2b62578
2022-06-15 05:42:26 +09:00
Burdette Lamar 9b9cc8ad34 [ruby/fileutils] [DOC] More on paths and lists (https://github.com/ruby/fileutils/pull/86)
* More on paths and lists

https://github.com/ruby/fileutils/commit/c3d92d34f4
2022-06-14 22:52:22 +09:00
Burdette Lamar 9a381c240c [ruby/fileutils] [DOC] Clarify path arguments (https://github.com/ruby/fileutils/pull/85)
https://github.com/ruby/fileutils/commit/5f9ef9ddc8
2022-06-14 00:39:44 +09:00
Burdette Lamar 753da6deca [ruby/fileutils] [DOC] Enhanced Rdoc (https://github.com/ruby/fileutils/pull/84)
Treats:

    ::chown_R
    ::touch
    ::commands
    ::options
    ::have_option?
    ::options_of
    ::collect_method

https://github.com/ruby/fileutils/commit/5df0324f52
2022-06-13 21:11:45 +09:00
st0012 b1397e96da [ruby/reline] Revert "Merge pull request #441 from nevans/workaround-linker-script-so"
This reverts commit https://github.com/ruby/reline/commit/4ccf128ffa18, reversing
changes made to https://github.com/ruby/reline/commit/a2651419e9a0.

https://github.com/ruby/reline/commit/51053138a4
2022-06-13 19:33:15 +09:00
Nobuyoshi Nakada d9ccb6b372 [ruby/reline] Check the ambiguous char width only on tty
It sent the char to check even to non-tty, e.g., pipe.
This causes `unknown command: "\xE2\x96\xBDstart ` warnings on
ruby's parallel test on Windows, where non-standard FDs cannot be
passed to child processes.

https://github.com/ruby/reline/commit/0d373647fb
2022-06-13 12:17:04 +09:00
David Rodríguez d0bf31e6cf [rubygems/rubygems] Don't on gemspecs with invalid `require_paths`, just warn
These gemspecs already work most of the times. When they are installed
normally, the require_paths in the gemspec stub line becomes actually
correct, and the incorrect value in the real gemspec is ignored. It only
becomes an issue in standalone mode.

In Ruby 3.2, `Kernel#=~` has been removed, and that means that it
becomes harder for us to gracefully deal with this error in standalone
mode, because it now happens earlier due to calling `Array#=~` for this
invalid gemspec (since require_paths is incorrectly an array of arrays).

The easiest way to fix this is to actually make this just work instead
by automatically fixing the issue when reading the packaged gemspec.

https://github.com/rubygems/rubygems/commit/d3f2fe6d26
2022-06-12 02:02:20 +09:00
David Rodríguez 7f9eb888a3 [rubygems/rubygems] Reuse package from the installer for extracting the specification
Previously we would instantiate two different packages and extract the
specification from the package twice for each gem installed. We can
reuse the installer for this so that we just need to do it once.

https://github.com/rubygems/rubygems/commit/e454f850b1
2022-06-11 18:43:28 +09:00
David Rodríguez 965c314e34 [rubygems/rubygems] Move security exception handling to the only place using it
https://github.com/rubygems/rubygems/commit/ba975b3b7f
2022-06-11 18:43:27 +09:00
David Rodríguez bf8dc36e40 [rubygems/rubygems] Swapping should not raise any errors
https://github.com/rubygems/rubygems/commit/600a9ac658
2022-06-11 18:43:27 +09:00
David Rodríguez 6292b36529 [rubygems/rubygems] Remove unclear comment
This is the explanation of why we do the swapping, not of why we
download the gem.

https://github.com/rubygems/rubygems/commit/1a25eb7e7b
2022-06-11 18:43:26 +09:00
David Rodríguez 52cc76d134 [rubygems/rubygems] `Gem::Specification.loaded_from` is already set by the installer
https://github.com/rubygems/rubygems/commit/796eebfdbf
2022-06-11 18:43:26 +09:00
David Rodríguez 22c97ab8ae [rubygems/rubygems] Refactor some more duplicated logic
https://github.com/rubygems/rubygems/commit/9bd389e1b6
2022-06-11 18:43:25 +09:00
David Rodríguez 95f5194b3c [rubygems/rubygems] Move `no_install` setting check to a more sensible place
It's only related to the `bundle cache` command, so it should be checked
there.

https://github.com/rubygems/rubygems/commit/cf749f8ffa
2022-06-11 18:43:25 +09:00
David Rodríguez 3f69774b76 [rubygems/rubygems] No need to redownload if package already there
https://github.com/rubygems/rubygems/commit/285ccbc07e
2022-06-11 18:43:24 +09:00
David Rodríguez a9077af75b [rubygems/rubygems] No need to overwrite path when there's a remote
https://github.com/rubygems/rubygems/commit/d86fb2c316
2022-06-11 18:43:24 +09:00
David Rodríguez 870e5a39d5 [rubygems/rubygems] Remove another unnecessary require
https://github.com/rubygems/rubygems/commit/04e6a5ae31
2022-06-11 18:43:24 +09:00
David Rodríguez 692fec4e72 [rubygems/rubygems] Simplify `Gem::Security::Exception` handling
These days all these errors are raised as `Gem::Security::Exception` so
there's no need to do any matching on the exception message.

https://github.com/rubygems/rubygems/commit/bd3403da57
2022-06-11 18:43:23 +09:00
David Rodríguez 572f3240fe [rubygems/rubygems] Remove unnecessary require
The `security_policies` method already requires it.

https://github.com/rubygems/rubygems/commit/d19b088f2f
2022-06-11 18:43:23 +09:00
David Rodríguez 4a75849680 [rubygems/rubygems] Remove unnecessary `spec.remote` guard
It's checked before calling the method already.

https://github.com/rubygems/rubygems/commit/4eb00e9586
2022-06-11 18:43:22 +09:00
David Rodríguez d5288c8aad [rubygems/rubygems] Refactor ambiguous gems check
https://github.com/rubygems/rubygems/commit/a00c79a4da
2022-06-11 18:43:22 +09:00
Burdette Lamar 44b3daa0d7 [ruby/fileutils] Enhanced RDoc (https://github.com/ruby/fileutils/pull/83)
Treats ::chmod_R and ::chown.

https://github.com/ruby/fileutils/commit/df4ac84bef
2022-06-11 06:41:27 +09:00
Burdette Lamar c2468fd88b [ruby/fileutils] Enhanced RDoc (https://github.com/ruby/fileutils/pull/82)
Treats ::chmod; adds Pathname usage to ::install.

https://github.com/ruby/fileutils/commit/9db4cb129c
2022-06-10 05:03:33 +09:00
Jean Boussier 4e21b19a61 [ruby/timeout] Keep a private reference to `Process.clock_gettime`
`timeout 0.3.0` broke our test suite because we have some
tests that stubs `Process.clock_gettime` making it return
a value in the past, causing `Timeout` to trigger almost immediately.

I beleive it wasn't a problem before because it was relying on `Process.sleep`.

https://github.com/ruby/timeout/commit/e5911a303e
2022-06-09 18:58:49 +09:00
Burdette Lamar 9b7208fca1 [ruby/fileutils] [DOC] Enhanced RDoc (https://github.com/ruby/fileutils/pull/81)
https://github.com/ruby/fileutils/commit/b9d5a79e38
2022-06-09 05:38:09 +09:00
Burdette Lamar a07acbe417 [ruby/fileutils] File trees (https://github.com/ruby/fileutils/pull/80)
Adds a note about file tree examples.

https://github.com/ruby/fileutils/commit/65ac65067a
2022-06-08 21:35:00 +09:00
Daniel Berger deff9e2699 [rubygems/rubygems] Remove unnecessary string concatenation
https://github.com/rubygems/rubygems/commit/81ccb3ab89
2022-06-07 23:18:31 +09:00
Yusuke Endoh f075be3dcb [ruby/error_highlight] Use Exception#detailed_message instead of overriding #message (https://github.com/ruby/error_highlight/pull/24)
See https://bugs.ruby-lang.org/issues/18564.
Ref: https://github.com/ruby/did_you_mean/pull/177

https://github.com/ruby/error_highlight/commit/671b7c61b2
2022-06-07 17:40:19 +09:00
Hiroshi SHIBATA 11b9dd8ccb
Manually merged https://github.com/ruby/did_you_mean/pull/177 2022-06-07 15:24:48 +09:00
Nobuyoshi Nakada 082c2d1b05 [ruby/rdoc] [DOC] Undocument internal constants [ci skip]
https://github.com/ruby/rdoc/commit/6d7bf24bb8
2022-06-07 11:44:58 +09:00
Nobuyoshi Nakada dbfb3b1917 [ruby/rdoc] Allow boolean arguments to `rb_attr` and `rb_define_attr`
Currently only literal `0` and `1` are accepted as `read`/`write`
flags.
This patch allows other boolean arguments, C macros (`FALSE`/`TRUE`),
Ruby `VALUE`s (`Qfalse`/`Qtrue`), and C99 `bool`s (`false`/`true`), as
well.

https://github.com/ruby/rdoc/commit/169dc02e3c
2022-06-07 10:42:10 +09:00
Burdette Lamar b737998d25 [ruby/fileutils] [DOC] Enhanced RDoc for FileUtils (https://github.com/ruby/fileutils/pull/78)
Treats:
    ::rm
    ::rm_f
    ::rm_r
    ::rm_rf
    ::remove_entry_secure

https://github.com/ruby/fileutils/commit/ce2a438d75
2022-06-07 00:37:31 +09:00
Alexander Ilyin 6fc16e748e [ruby/open-uri] [DOC] Fix markup for `URI.open`
* Add missing slash.

https://github.com/ruby/open-uri/commit/40023e63da
2022-06-07 00:06:56 +09:00
David Rodríguez ba38318827 [rubygems/rubygems] Unify loading `Gem::Requirement`
It was being explicitly required from `Gem::Specification` but also a
strange autoload was set for it at `Gem::Version`. The autoload was non
standard because it should've been done in the `Gem` module, not in
`Gem::Specification`, since that's where the constant is expected to get
defined. Doing this might get deprecated in the future, and it was not
being effective anyways due to the explicit require.

Unify everything with an `autoload` at the right place.

https://github.com/rubygems/rubygems/commit/174ea3e24c
2022-06-06 18:36:31 +09:00