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

8706 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA 757e185cee
Revert "[ruby/webrick] Allow empty POST and PUT requests without content length"
This reverts commit ed12019ce6.

  https://github.com/ruby/ruby/runs/1160423667?check_suite_focus=true#step:14:752
2020-09-24 22:20:02 +09:00
John W Higgins f64bea6d66 [ruby/webrick] Allow shutdown_pipe to be passed in via @config
https://github.com/ruby/webrick/commit/30152b4bf9
2020-09-24 21:37:06 +09:00
Jeremy Evans ed12019ce6 [ruby/webrick] Allow empty POST and PUT requests without content length
RFC 7230 section 3.3.3 allows for this.

Fixes #30

https://github.com/ruby/webrick/commit/069e9b1908
2020-09-24 21:34:07 +09:00
John W Higgins 4715a24dd2 [ruby/webrick] Ensure server port numbers are numeric and ensure they are stored as integers
https://github.com/ruby/webrick/commit/86ed621e11
2020-09-24 21:31:55 +09:00
John W Higgins 96da24f279 [ruby/webrick] Make readpartial limit chunk to appropriate size
https://github.com/ruby/webrick/commit/e693f501bd
2020-09-24 21:22:20 +09:00
Hiroshi SHIBATA b717f73402
Revert "Manually merged from https://github.com/rubygems/rubygems/pull/2636"
31a6eaabc1 is obsoleted with
  https://github.com/rubygems/rubygems/pull/3820
2020-09-23 22:01:44 +09:00
Hiroshi SHIBATA a46841612c
bump Bundler's version to 2.2.0.rc.1 2020-09-23 21:06:29 +09:00
Hiroshi SHIBATA 31a6eaabc1
Manually merged from https://github.com/rubygems/rubygems/pull/2636
Enable Style/EmptyLinesAroundClassBody rubocop cop.
2020-09-23 21:02:56 +09:00
aycabta e193dd1e3d [ruby/irb] Version 1.2.7
https://github.com/ruby/irb/commit/0eaa06838b
2020-09-19 05:13:08 +09:00
aycabta 555ea83344 [ruby/irb] Drop OMIT_ON_ASSIGNMENT and add :truncate option for ECHO_ON_ASSIGNMENT
https://github.com/ruby/irb/commit/4c89b0775b
2020-09-19 05:13:08 +09:00
aycabta 305c430603 [ruby/rdoc] Add man/ri.1 for distribution files
https://github.com/ruby/rdoc/commit/7cb5c3611f
2020-09-18 14:57:58 +09:00
Dorian Marié 0d56aec1dd [ruby/rdoc] Fix spelling error in parser comment
https://github.com/ruby/rdoc/commit/f237c9e223
2020-09-18 14:57:58 +09:00
Nobuyoshi Nakada e23f0f29da [ruby/rdoc] update all files if any file is newer
Cross references need parse all files which define the subject
names.  This commit makes `--force-update` option enforce to parse
all files if any file is newer than the previous parse, not only
updated files.

https://github.com/ruby/rdoc/commit/13e9a44896
2020-09-18 14:57:58 +09:00
aycabta b5db9b8a31 [ruby/rdoc] Support full filename to make a link for a text file
https://github.com/ruby/rdoc/commit/41db49c485
2020-09-18 14:57:57 +09:00
Kazuhiro NISHIYAMA e4dbb91f4c
Fix typos [ci skip]
s/overriden/overridden/
2020-09-17 20:34:59 +09:00
Jeremy Evans abbd324152 [ruby/uri] Remove deprecated URI.escape/URI.unescape
https://github.com/ruby/uri/commit/61c6a47ebf
2020-09-15 21:17:20 +09:00
Ashwin Maroli 3dd9e12b51 [ruby/fileutils] Reduce iteration through list for `:mkdir_p`
By calling the instruction to `list.map` within `list.each` itself.
https://github.com/ruby/fileutils/commit/e690eec937
2020-09-15 20:32:13 +09:00
Marc-Andre Lafortune 60f5d38482 [ruby/ostruct] Fix dup/clone 2020-09-14 16:10:37 -04:00
Marc-Andre Lafortune 125605abd9 [ruby/ostruct] method_missing is private 2020-09-14 16:10:37 -04:00
Marc-Andre Lafortune 606c009ce2 [ruby/ostruct] Avoid self calling our public methods.
Found because `json` has a bad example in its test suite.
This implementation still offers better encapsulation.
2020-09-14 16:10:37 -04:00
Marc-Andre Lafortune 67e5f7a9e5 [ruby/ostruct] Reinstate recent changes
This reverts commit 28e60b0045.
2020-09-14 16:10:37 -04:00
Marc-Andre Lafortune 28e60b0045 [ruby/ostruct] Revert recent changes
This reverts commit e026e186f4..12a2e32d43.
2020-09-14 13:29:54 -04:00
Marc-Andre Lafortune 867f0c6793 [ruby/rdoc] Prefer require_relative 2020-09-14 12:59:11 -04:00
Marc-Andre Lafortune 12a2e32d43 [ruby/ostruct] Add access to public instance methods in case they are overriden 2020-09-14 12:46:51 -04:00
Marc-Andre Lafortune 12a13eef49 [ruby/ostruct] Tweak doc 2020-09-14 12:46:49 -04:00
Marc-Andre Lafortune 8eefa8f373 [ruby/ostruct] Allow overriding public methods
[Fixes https://bugs.ruby-lang.org/issues/15409]
2020-09-14 12:46:47 -04:00
Marc-Andre Lafortune ebb8de7302 [ruby/ostruct] Refactor handling of frozen OpenStruct. Simplify `new_ostruct_member!` 2020-09-14 12:46:45 -04:00
Marc-Andre Lafortune e026e186f4 [ruby/ostruct] Revert "ostruct.rb: deferred accessors"
This reverts commits:
dc38e99813
22c082fcfd
b499e0f9ff
58e5876646

Add test for overriden private methods

[Fixes https://bugs.ruby-lang.org/issues/12136]
2020-09-14 12:46:27 -04:00
Nobuyoshi Nakada edb5c67195 [ruby/tmpdir] Warn when environment variables skipped (fixes #2)
https://github.com/ruby/tmpdir/commit/af7b020a89
2020-09-14 18:22:37 +09:00
nicholas a. evans f1d32010e6 [ruby/net-smtp] Add SNI support to net/smtp
https://github.com/ruby/net-smtp/commit/b706942392
2020-09-14 17:26:36 +09:00
TOMITA Masahiro 141404e898 [ruby/net-smtp] Net::SMTP.start arguments are keyword arguments
The helo argument is not important, but the helo argument must be
specified to specify the user and secret arguments.
If helo, user, secret, and authtype arguments are keyword arguments,
it is not necessary to specify the helo argument.

https://github.com/ruby/net-smtp/commit/269774deac
2020-09-14 17:23:41 +09:00
TOMITA Masahiro 888e04ae05 [ruby/net-smtp] TLS should not check the host name by default.
In tlsconnect(), the host name is checked when
@ssl_context.verify_mode is not OpenSSL::SSL::VERIFY_NONE, but the
verify_mode of @ssl_context generated by default is nil.

https://github.com/ruby/net-smtp/commit/bde75a15b5
2020-09-14 17:22:35 +09:00
Hiroshi SHIBATA cdb85142f9 [ruby/erb] Use libexec same as ruby core repository
https://github.com/ruby/erb/commit/660255cf24
2020-09-14 17:15:44 +09:00
Hiroshi SHIBATA 78ef7eeb36
Manually picked 724bdb8e1d 2020-09-14 14:07:37 +09:00
Hiroshi SHIBATA eace12c25b
Fixup 8f71bb0e4f 2020-09-14 14:06:02 +09:00
aycabta b682e0fc21 [ruby/irb] Version 1.2.6
https://github.com/ruby/irb/commit/5a7dd8c3bf
2020-09-14 02:14:02 +09:00
aycabta 5bb9e12573 [ruby/irb] Need calculate_width and split_by_width of Reline::Unicode of reline 0.1.5 or later
https://github.com/ruby/irb/commit/c05bc9e595
2020-09-14 02:13:32 +09:00
aycabta 8f9b1902f4 [ruby/irb] Omit output if first line of multiline is too long
https://github.com/ruby/irb/commit/0feeae38c5
2020-09-14 02:13:18 +09:00
aycabta e468d9f49c [ruby/irb] Add OMIT_ON_ASSIGNMENT
Omit the results evaluated at assignment if they are too long.

The behavior of ECHO_ON_ASSIGNMENT being on by default is hard to understand,
so I change it to off by default. Instead, we turn OMIT_ON_ASSIGNMENT on by
default. The result is displayed on assignment, but it will always be short
and within one line of the screen.

https://github.com/ruby/irb/commit/c5ea79d5ce
2020-09-14 02:13:11 +09:00
aycabta 5d841f5631 [ruby/irb] Version 1.2.5
https://github.com/ruby/irb/commit/07beb3964d
2020-09-14 02:12:58 +09:00
aycabta 3a3e933033 [ruby/reline] Version 0.1.5
https://github.com/ruby/reline/commit/c8a419beb5
2020-09-14 02:12:12 +09:00
aycabta ae508633b7 Suppress "assigned but unused variable" warning 2020-09-12 10:07:18 +09:00
aycabta 777d536749 [ruby/reline] Support for word movement escape sequences in iTerm2
https://github.com/ruby/reline/commit/187235f88c
2020-09-12 08:35:52 +09:00
aycabta f36dc2b6de [ruby/reline] Treat prompt correctly when Reline.prompt_proc isn't set
https://github.com/ruby/reline/commit/9c9ba0eff3
2020-09-12 08:35:52 +09:00
aycabta ce389ade45 [ruby/reline] Move cursor to currect vertical pos after rendering a logical line
https://github.com/ruby/reline/commit/9b932df544
2020-09-12 08:35:52 +09:00
aycabta 9baf1bd0a4 [ruby/reline] Stop using chomp option of lines method
https://github.com/ruby/reline/commit/3e2f55c3e0
2020-09-12 08:35:52 +09:00
aycabta 0ec19cc843 [ruby/reline] Stop erasing chars after the cursor at eol
When the cursor is at the end of the line and erases characters after the
cursor, some terminals delete the character at the cursor position.

https://github.com/ruby/reline/commit/e96ec97b02
2020-09-12 08:35:52 +09:00
aycabta 2e34b35a0f [ruby/reline] Skip the nil obtained from getc
The nil means there is nothing in the buffer in some systems. Incidentally,
Errno::EIO is raised if the I/O is closed.

https://github.com/ruby/reline/commit/c698634e74
2020-09-12 08:35:52 +09:00
Yoshinao Muramatu a840ef8569 [ruby/reline] not clear scrollback buffer
https://github.com/ruby/reline/commit/ba800f1461
2020-09-12 08:35:51 +09:00
Yoshinao Muramatu 0862744010 [ruby/reline] clear_screen use Windows API
https://github.com/ruby/reline/commit/2c5ee54cb3
2020-09-12 08:35:51 +09:00
aycabta 770e66030a [ruby/reline] Use str.encoding by default for split_by_width
https://github.com/ruby/reline/commit/2d32604c9e
2020-09-12 08:35:51 +09:00
Hiroshi SHIBATA 6042b7433d
Promote time.rb to default gems 2020-09-12 08:29:06 +09:00
Hiroshi SHIBATA 01e0d74965
Promote resolv-replace to default gems 2020-09-11 22:01:08 +09:00
Hiroshi SHIBATA e0675b1c76
Promote resolv to default gems 2020-09-11 21:50:07 +09:00
Hiroshi SHIBATA d1851ba5b9
Promote securerandom to default gems 2020-09-11 21:15:25 +09:00
Hiroshi SHIBATA 2f24818319
Promote open-uri to default gems 2020-09-11 20:38:18 +09:00
Hiroshi SHIBATA d55c914f0f Removed DRb.default_safe_level and DRb#safe_level 2020-09-11 10:52:52 +09:00
Hiroshi SHIBATA cf76a4a5c2
Promote base64 to default gems 2020-09-10 18:56:17 +09:00
Hiroshi SHIBATA cf681038d6
Promote shellwords to default gems 2020-09-10 18:56:17 +09:00
Hiroshi SHIBATA cee8e95761
Promote abbrev to default gems 2020-09-10 18:56:16 +09:00
Aaron Patterson 475c8701d7 Make SecureRandom support Ractor
SecureRandom lazily defines `get_random`.  Accessing the mutex to define
the `get_random` method is not supported inside a Ractor.  This commit
defines `gen_random` when `securerandom` is required and makes it
suppore Ractor (as well as thread safe).

Here is a test program:

```ruby
require "securerandom"

r = Ractor.new do
  loop do
    Ractor.yield SecureRandom.hex
  end
end

p r.take
```

Before this commit:

```
$ make runruby
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems ./test.rb
<internal:ractor>:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
/Users/aaron/git/ruby/lib/securerandom.rb:94:in `gen_random': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
<internal:ractor>:124:in `take': thrown by remote Ractor. (Ractor::RemoteError)
	from ./test.rb:9:in `<main>'
/Users/aaron/git/ruby/lib/securerandom.rb:94:in `gen_random': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
	from /Users/aaron/git/ruby/lib/securerandom.rb:155:in `random_bytes'
	from /Users/aaron/git/ruby/lib/securerandom.rb:176:in `hex'
	from ./test.rb:5:in `block (2 levels) in <main>'
	from ./test.rb:4:in `loop'
	from ./test.rb:4:in `block in <main>'
make: *** [runruby] Error
```

After this commit:

```
$ make runruby
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems ./test.rb
<internal:ractor>:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
"3fc8885157e3911bab4b5d7619bb0308"
```
2020-09-09 12:45:43 -07:00
Hiroshi SHIBATA 01828a955a
Promote tsort to default gems 2020-09-09 21:53:09 +09:00
Hiroshi SHIBATA b194973dcd
Revert the related commits about `Tempfile.open` change.
Start with fa21985a7a
  to d7492a0be8
2020-09-09 21:10:48 +09:00
Jeremy Evans 6997109fca [ruby/tempfile] Revert Tempfile.open unlinking the file
Document difference in behavior between Tempfile.open and
Tempfile.create.

https://github.com/ruby/tempfile/commit/426d6f887f
2020-09-09 20:15:41 +09:00
Marc-Andre Lafortune fbaab562d9 lib/ostruct.rb: Revert "To use RuntimeError instead of FrozenError for old ruby versions."
This reverts commit 4cd1fc8b3559353069860eee90b1b5bade013917.
2020-09-04 01:23:14 -04:00
Nobuyoshi Nakada 0eec4ae851
Get rid of using Socket.gethostbyname 2020-08-31 17:45:27 +09:00
Benoit Daloze d7492a0be8 Revert changes to rdoc & rubygems regarding Tempfile.open(&block)
* They likely want to support older Ruby/tempfile versions
* Reverts part of e8c3872555
2020-08-29 12:49:20 +02:00
Benoit Daloze 3beecafc2c Fix usages of Tempfile.open(&block) that expected the file to still be there after the block 2020-08-29 12:30:24 +02:00
Benoit Daloze e8c3872555 Simplify Tempfile.open calls with a block as they now unlink the file automatically 2020-08-29 12:23:23 +02:00
Benoit Daloze fa21985a7a Sync with ruby/tempfile@aa9ea12d94 2020-08-29 12:05:48 +02:00
aycabta 1f09c43628 [ruby/reline] Move width calculator methods to Reline::Unicode
https://github.com/ruby/reline/commit/f348ecd9f5
2020-08-28 11:05:18 +09:00
tompng cdd7d41046 [ruby/reline] fix cursor_pos regexp match
https://github.com/ruby/reline/commit/1dd80ef188
2020-08-28 11:05:18 +09:00
aycabta 8882927036 [ruby/irb] Discard newlines at end of file
https://github.com/ruby/irb/commit/0b2773d91d
2020-08-28 11:05:18 +09:00
Kenta Murata 72cb9bc55f
[webrick][DOC] Describe the stance of WEBrick about its security and utilization (#3457)
WEBrick is not recommended for the production use.  We need to explicitly
describe this fact in the document to avoid troubles due to misunderstanding.
2020-08-26 14:28:05 +09:00
Hiroshi SHIBATA e6ac1fb612
Specify the executable of erb 2020-08-25 08:44:14 +09:00
Hiroshi SHIBATA 8c97883b73
Promote erb to default gems 2020-08-21 20:18:44 +09:00
Hiroshi SHIBATA bc374e5cea
Promote rinda to default gems 2020-08-21 18:10:03 +09:00
Hiroshi SHIBATA dfda2f739b
Promote find to default gems 2020-08-20 21:00:53 +09:00
Hiroshi SHIBATA 8a40e9b5a2
Promote set to default gems 2020-08-20 12:39:11 +09:00
Hiroshi SHIBATA 5b04e2362c
[ruby/racc] Fixed the licenses field of gemspec
https://github.com/ruby/racc/commit/a1aeecff03
2020-08-19 19:35:04 +09:00
Hiroshi SHIBATA d3b2c1a175
Fixed the invalid SPDX identifier on gemspec 2020-08-18 20:26:40 +09:00
Hiroshi SHIBATA 8fb02b7a97
Update the license for the default gems to dual licenses 2020-08-18 20:26:39 +09:00
Hiroshi SHIBATA 0bb8bd7623
Added the missing licenses field to some default gems 2020-08-18 20:26:39 +09:00
Nobuyoshi Nakada 4f697bcf73
Strip trailing spaces [ci skip] 2020-08-18 20:10:34 +09:00
aycabta 172d44e809 [ruby/reline] Add require 'rbconfig' to use RbConfig
https://github.com/ruby/reline/commit/4a0d32a3d0
2020-08-18 19:10:09 +09:00
Nobuyoshi Nakada f2435c1508 [ruby/reline] Get rid of loading pathname unnecessarily
https://github.com/ruby/reline/commit/9bd54b7f1c
2020-08-18 19:09:58 +09:00
Maciej Mensfeld d1b06229fa [ruby/reline] Use the standard SPDX ID for license in gemspec
It is better to use SPDX ID for license field:

https://guides.rubygems.org/specification-reference/#license=

ref: https://spdx.org/licenses/Ruby.html
https://github.com/ruby/reline/commit/8468a727e5
2020-08-18 19:09:43 +09:00
aycabta ad24eaabfd [ruby/reline] Remove duplicated line of code
Co-authored-by: Quentin Sabah <quentin.sabah@gmail.com>

https://github.com/ruby/reline/commit/5526e9f7ee
2020-08-18 19:08:50 +09:00
aycabta 80a7358cfc [ruby/reline] Keep original characters in inputrc
https://github.com/ruby/reline/commit/96583c6336
2020-08-18 19:08:40 +09:00
Mark Delk 44b24ab4c1 [ruby/reline] Support mode icon
Co-authored-by: aycabta <aycabta@gmail.com>

https://github.com/ruby/reline/commit/067b618123
2020-08-18 19:08:32 +09:00
aycabta 568615d395 [ruby/reline] Use single quotes for non-expanded string literals
https://github.com/ruby/reline/commit/3bf7c7d722
2020-08-18 19:08:11 +09:00
aycabta 215fe54777 [ruby/reline] Check Errno::EIO
Catch Errno::EIO what will be occurred if the console terminates I/O before
Reline finishes rendering.

https://github.com/ruby/reline/commit/e51eaa6d43
2020-08-18 19:04:31 +09:00
Tomás Pollak f0d3d4fedb [ruby/reline] Add home/end mapping for urxvt and relatives
https://github.com/ruby/reline/commit/c30b293f1c
2020-08-18 19:03:27 +09:00
aycabta a30dea5852 [ruby/irb] Support shortening lambda notetion for nesting level of prompt
https://github.com/ruby/irb/commit/f1a775af47
2020-08-18 14:38:02 +09:00
aycabta 43c648c832 [ruby/irb] Support shortening lambda notation
https://github.com/ruby/irb/commit/8e3f81d428
2020-08-18 14:38:02 +09:00
aycabta b3f84b4a5b [ruby/irb] Expand path to run separated test correctly
https://github.com/ruby/irb/commit/be2937abd5
2020-08-18 14:38:01 +09:00
Nobuyoshi Nakada 7fa86de15b [ruby/irb] Workaround a bug of ruby-mode.el
https://github.com/ruby/irb/commit/6dfd59400d
2020-08-18 14:38:01 +09:00
Nobuyoshi Nakada 82d4da7816 [ruby/irb] Yet another unnecessary readline
https://github.com/ruby/irb/commit/933841af11
2020-08-18 14:38:01 +09:00
Nobuyoshi Nakada 0fcbd07247 [ruby/irb] Directly check if the method is available instead of version
https://github.com/ruby/irb/commit/3ea9fd9ed0
2020-08-18 14:38:01 +09:00
Nobuyoshi Nakada 6aa786b8a3 [ruby/irb] Get rid of loading readline unnecessarily
https://github.com/ruby/irb/commit/420e7d2270
2020-08-18 14:38:01 +09:00
Nobuyoshi Nakada d32229e338 [ruby/irb] Prefer require_relative to load the files in this library
https://github.com/ruby/irb/commit/0ac3bc7296
2020-08-18 14:38:01 +09:00
aycabta 126e1fc296 [ruby/irb] Make history infinite if set SAVE_HISTORY to negative
https://github.com/ruby/irb/commit/824473e880
2020-08-18 14:38:01 +09:00
aycabta ef498a016b [ruby/irb] Suppress crash when bignum is set to SAVE_HISTORY
https://github.com/ruby/irb/commit/5044eb2730
2020-08-18 14:38:01 +09:00
aycabta 6f0ef83de7 [ruby/irb] Symbol.all_symbols was adopted by Ruby 1.8.0 or later
https://github.com/ruby/irb/commit/71ba754e8e
2020-08-18 14:38:01 +09:00
aycabta 5474007d61 [ruby/irb] Support oneline method definition
https://github.com/ruby/irb/commit/826ae909c9
2020-08-18 14:38:01 +09:00
Jeremy Evans a73b5cc556 Remove the deprecated override of Kernel#open in open-uri
This was deprecated in 2.7 to resolve [Misc #15893].
2020-08-16 07:41:40 -07:00
Burdette Lamar c84ccf1a07
Fix links to Dig Methods document (#3421)
* Fix links to Dig Methods document

* Fix links to Dig Methods document
2020-08-14 18:55:04 -05:00
Burdette Lamar 22fd617aa5
Adding doc/dig_methods.rdoc and links to it (#3416)
Adds a full discussion of #dig, along with links from Array, Hash, Struct, and OpenStruct.

CSV::Table and CSV::Row are over in ruby/csv. I'll get to them soon.

The art to the thing is to figure out how much (or how little) to say at each #dig.
2020-08-13 13:16:27 -05:00
Nguyễn Quang Minh 1819652578
[Feature #16513] TracePoint#inspect returns "... file:line" (#3391)
* Fix debug documents to match Thread#to_s change (Feature #16412 ticket)

* TracePoint#inspect returns "... file:line" (Feature #16513)

* Guard older version of Ruby in Tracepoint inspection tests

* Focus on current thread only when running TracePoint inspection test
2020-08-06 11:56:24 +09:00
Hiroshi SHIBATA 8f71bb0e4f
Fixed the inconsistency gemspec location with net-* gems. 2020-08-05 20:01:03 +09:00
Hiroshi SHIBATA 1d637b1f5e [ruby/weakref] Use Gemfile instead of Gem::Specification#add_development_dependency.
https://github.com/ruby/weakref/commit/10d547ba12
2020-08-03 19:46:39 +09:00
Hiroshi SHIBATA 9e93596d7b [ruby/ostruct] Drop to Ruby 2.4
https://github.com/ruby/ostruct/commit/00e8fe3df2
2020-08-03 19:42:06 +09:00
Hiroshi SHIBATA e732d376af [ruby/cgi] Drop to Ruby 2.4
https://github.com/ruby/cgi/commit/8a86536e94
2020-08-03 18:30:19 +09:00
Hiroshi SHIBATA 3ec860ae88
net-ftp is under `lib/net` instead of `lib/net/ftp` 2020-08-03 17:52:01 +09:00
Hiroshi SHIBATA 2346e2f0db
Followed up b2d96abb42 for net-ftp. 2020-08-03 17:40:05 +09:00
David Rodríguez f80020bc50 [rubygems/rubygems] Read path binarily
I believe this should fix a flaky test on Windows.

https://github.com/rubygems/rubygems/commit/a516b49a0a
2020-07-31 21:07:19 +09:00
David Rodríguez b7e88e3c2f [rubygems/rubygems] Don't format executables on `gem update --system`
This restores 3.0 behavior and goes back to not formatting executables
by default on `gem update --system`. This is friendlier for jruby and
doesn't really affect OS packagers.

https://github.com/rubygems/rubygems/commit/1a504b651d
2020-07-31 21:07:19 +09:00
Hiroshi SHIBATA 0e2d8c487c [rubygems/rubygems] unset XDG_* environmental variables for testing of rubygems.
https://github.com/rubygems/rubygems/commit/539fd9a39a
2020-07-31 21:07:19 +09:00
David Rodríguez aa4ecfe7f7 [rubygems/rubygems] Revert "Disallow warnings to creep into the test suite"
This reverts commit 694e6afee769ffb3168a564ee7d315af2a934993.

It was failed on Windows and I'm unsure why. Also, the check seems
brittle since it could fail potentially fail because of warnings outside
of our control.

https://github.com/rubygems/rubygems/commit/908e9344dd
2020-07-31 21:07:19 +09:00
David Rodríguez e0bfc77824 [rubygems/rubygems] Remove unnecessary guard clause
Since 1ccf0912a161d20e0c4a7b139fd76e8739a411ba, this method no longer
uses `Kernel.gem`, so this guard clause is now unnecessary.

https://github.com/rubygems/rubygems/commit/8a19e7401c
2020-07-31 21:07:19 +09:00
David Rodríguez fe53e5a9f3 [rubygems/rubygems] Remove fileutils autoload
https://github.com/rubygems/rubygems/commit/dca345441f
2020-07-31 21:07:19 +09:00
David Rodríguez fedaa61b3f [rubygems/rubygems] Remove explicit require for autoloaded constant
https://github.com/rubygems/rubygems/commit/a54230093e
2020-07-31 21:07:19 +09:00
David Rodríguez 3921ab8291 [rubygems/rubygems] Let more exceptions flow
If any error happens while verifying a package entry, it doesn't mean
that the package is corrupt. It could be a bug in rubygems, for example.
This in fact happened in CI and the current error doesn't make it easy
to troubleshoot the root cause, since it doesn't provide a backtrace.

See
https://github.com/rubygems/rubygems/pull/3807/checks?check_run_id=862526615.

So I propose to let the exception happens. There was something useful
about the previous message, which is the file entry where the error
happened, so I'm keeping that information in a warning message.

https://github.com/rubygems/rubygems/commit/ece87d858f
2020-07-31 21:07:19 +09:00
Nobuyoshi Nakada ebf008b9ae [rubygems/rubygems] Install plugins to user directory
Fixes the `Gem::FilePermissionError` without the privilege.
Initialize `@plugins_dir` to the user gem directory, when
installing with `--user` option.

https://github.com/rubygems/rubygems/commit/21a71ac769
2020-07-31 21:07:19 +09:00
David Rodríguez 6c71033ac3 [rubygems/rubygems] Remove more unnecessary requires
Since `rubygems/util` is autoloaded.

https://github.com/rubygems/rubygems/commit/52a9f88b99
2020-07-31 21:07:19 +09:00
David Rodríguez 9057e9c7b1 [rubygems/rubygems] The file is only ever required when openssl is available
https://github.com/rubygems/rubygems/commit/41976ef3ec
2020-07-31 21:07:19 +09:00
David Rodríguez 6eb89f8637 [rubygems/rubygems] Remove now unneeded code
We patch `net-http-persistent` to not autoload `openssl`.

https://github.com/rubygems/rubygems/commit/757dec3cf2
2020-07-31 21:07:19 +09:00
David Rodríguez ea8f7d4a81 [rubygems/rubygems] Gem::Specification#to_ruby doesn't need `openssl`
The `openssl` require when openssl not present was having the
side-effect the our custom require fallbacks would end up loading `Gem::Specification.stubs`.

Co-authored-by: Alyssa Ross <hi@alyssa.is>

https://github.com/rubygems/rubygems/commit/22c4ded4ad
2020-07-31 21:07:19 +09:00
David Rodríguez e1494145d9 [rubygems/rubygems] Make sure tests at least load without openssl
https://github.com/rubygems/rubygems/commit/054d57f74b
2020-07-31 21:07:19 +09:00
David Rodríguez 69fa0d6d30 [rubygems/rubygems] Move openssl require to a separate file
So it can be reused.

https://github.com/rubygems/rubygems/commit/b9fc6e40db
2020-07-31 21:07:19 +09:00
David Rodríguez 6b14249c98 [rubygems/rubygems] In the rubies we support `Exception#path` is always there
https://github.com/rubygems/rubygems/commit/babf943144
2020-07-31 21:07:19 +09:00
David Rodríguez 0a7f12fcc6 [rubygems/rubygems] Only require what we are using
https://github.com/rubygems/rubygems/commit/d92b94f3cf
2020-07-31 21:07:19 +09:00
David Rodríguez 9ad9c2d9c3 [rubygems/rubygems] Let the original error happen
It will give more useful information.

https://github.com/rubygems/rubygems/commit/efcecb5af5
2020-07-31 21:07:19 +09:00
David Rodríguez b84b4e8bfa [rubygems/rubygems] Remove unnecessary stuff
The `rubygems/security` require already does this.

https://github.com/rubygems/rubygems/commit/bbb444b6f1
2020-07-31 21:07:19 +09:00
bronzdoc 6c19b0ec6e [rubygems/rubygems] Reword warning
https://github.com/rubygems/rubygems/commit/cbd4abf8cf
2020-07-31 21:07:19 +09:00
bronzdoc 00bdac18cf [rubygems/rubygems] Warn on duplicate dependency in a specification
https://github.com/rubygems/rubygems/commit/af3e5f7883
2020-07-31 21:07:19 +09:00
David Rodríguez 985309ac38 [rubygems/rubygems] Support PATH's using `File::ALT_SEPARATOR` in `Gem::Installer`
Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>

https://github.com/rubygems/rubygems/commit/710b969b60
2020-07-31 21:07:19 +09:00
David Rodríguez 04d3e0727a [rubygems/rubygems] Move traling `if` to the same line for readablity
https://github.com/rubygems/rubygems/commit/d722b8b578
2020-07-31 21:07:19 +09:00
David Rodríguez c090c64b4f [rubygems/rubygems] Prefer the standard separator on Windows
It seems like the most common case since it requires no tricks on our
CI environment.

Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>

https://github.com/rubygems/rubygems/commit/751c475574
2020-07-31 21:07:19 +09:00
Colby Swandale 65a4b03781 [rubygems/rubygems] fix missing identation
https://github.com/rubygems/rubygems/commit/2cca6714f3
2020-07-31 21:07:19 +09:00
Jean Boussier 561576367b [rubygems/rubygems] Deduplicate the requirement operators in memory
https://github.com/rubygems/rubygems/commit/9963d33cf2
2020-07-31 21:07:19 +09:00
Jeremy Evans 1a935606b5 [rubygems/rubygems] Fix Kernel#warn override to handle backtrace location with nil path
It's very unlikely to hit this case, but it is possible, as
Thread::Backtrace::Location#path can return nil if the location is
a cfunc with no previous iseq.  See location_path in vm_backtrace.c
in Ruby.

https://github.com/rubygems/rubygems/commit/511935645a
2020-07-31 21:07:19 +09:00
Benoit Daloze 331fe6a88f [rubygems/rubygems] Ignore internal frames in RubyGems' Kernel#warn
* See https://github.com/oracle/truffleruby/issues/2046
* `<internal:` is a common prefix also used by core Ruby files in CRuby.
* test_no_kernel_require_in_*warn_with_uplevel already test this.
* Unfortunately just skipping `<internal:` in the Ruby implementation
  is not enough, because RubyGems' #warn would not skip the
  `<internal:` require (TruffleRuby defines #require in Ruby),
  and the Ruby implementation's #warn would not skip
  RubyGems's #require. The #caller_locations(0) look like this:

  warnee.rb:1:in `<top (required)>' # where #warn is called
  <internal:core> core/kernel.rb:234:in `gem_original_require' # not skipped by RubyGems' warn, skipped by the Ruby impl
  rubygems/core_ext/kernel_require.rb:54:in `require' # not skipped by the Ruby impl's warn, what would be shown without this fix
  warn.rb:1:in `<main>' # what would be correct

  warn.rb is
  require "warnee"
  warnee.rb is
  puts caller_locations(0), nil
  warn "oops", uplevel: 1

https://github.com/rubygems/rubygems/commit/7c838f7419
2020-07-31 21:07:19 +09:00
David Rodríguez 14ab281faa [rubygems/rubygems] Disallow warnings to creep into the test suite
https://github.com/rubygems/rubygems/commit/694e6afee7
2020-07-31 21:07:19 +09:00
David Rodríguez 9d6123da15 [rubygems/rubygems] Fix test warning
https://github.com/rubygems/rubygems/commit/f4c4cddb68
2020-07-31 21:07:19 +09:00
David Rodríguez 06f84d0567 [rubygems/rubygems] Don't `super` on main test setup
The `teardown` method doesn't call it either and I don't think it's
necessary.

https://github.com/rubygems/rubygems/commit/ca2a5d485d
2020-07-31 21:07:19 +09:00
David Rodríguez d0cc4ecb8f [rubygems/rubygems] Remove very old compatibility code
https://github.com/rubygems/rubygems/commit/6e4bef758b
2020-07-31 21:07:19 +09:00
David Rodríguez 1260d22cae [rubygems/rubygems] Extract some common code into a private method
https://github.com/rubygems/rubygems/commit/d1be8cdb3a
2020-07-31 21:07:19 +09:00
David Rodríguez d5b5a7ab31 [rubygems/rubygems] Remove very old TODO note
It was added 10 years ago on a "146 additions, 170 deletions" commit
named "Deprecation removals and minor cleanup." that didn't explain much
other than that.

This TODO doesn't necessarily apply nowadays. I don't see how anyways.
TODO notes, if useful at all, should include a clear explanation of what
should be done either via the note itself or the commit message. This
note doens't meet any of these.

So I want to remove it because it distracts me every time I go through
it.

https://github.com/rubygems/rubygems/commit/58d81e8a32
2020-07-31 21:07:19 +09:00
Jean Boussier 76722c4928 [rubygems/rubygems] Optimize Gem.already_loaded?
Profiling a simple `ruby -e '1'` I see:

```
==================================
  Mode: wall(10)
  Samples: 3414 (55.10% miss rate)
  GC: 856 (25.07%)
==================================
     TOTAL    (pct)     SAMPLES    (pct)     FRAME
       689  (20.2%)         669  (19.6%)     Gem.already_loaded?
       462  (13.5%)         462  (13.5%)     (marking)
       393  (11.5%)         393  (11.5%)     (sweeping)
       815  (23.9%)         365  (10.7%)     Gem::Specification.load
      1050  (30.8%)         156   (4.6%)     Gem.register_default_spec
       100   (2.9%)          84   (2.5%)     Gem::Specification#files
        64   (1.9%)          64   (1.9%)     Gem::BasicSpecification#internal_init
       136   (4.0%)          59   (1.7%)     <top (required)>
      2312  (67.7%)          58   (1.7%)     <top (required)>
        57   (1.7%)          57   (1.7%)     RbConfig.expand
        81   (2.4%)          55   (1.6%)     Gem::Requirement.parse
       191   (5.6%)          51   (1.5%)     <top (required)>
       128   (3.7%)          47   (1.4%)     Gem::Requirement#initialize
        41   (1.2%)          41   (1.2%)     Gem.suffix_regexp
       229   (6.7%)          35   (1.0%)     <module:Gem>
       260   (7.6%)          34   (1.0%)     Kernel#require
```

So clearly `Gem.already_loaded?` is a major hotspot.

After this optimization, it's down to:
```
==================================
  Mode: wall(10)
  Samples: 2653 (58.21% miss rate)
  GC: 718 (27.06%)
==================================
     TOTAL    (pct)     SAMPLES    (pct)     FRAME
       416  (15.7%)         416  (15.7%)     (marking)
       715  (27.0%)         312  (11.8%)     Gem::Specification.load
       299  (11.3%)         299  (11.3%)     (sweeping)
       279  (10.5%)         279  (10.5%)     Gem.already_loaded?
       564  (21.3%)         106   (4.0%)     Gem.register_default_spec
        95   (3.6%)          80   (3.0%)     Gem::Specification#files
        72   (2.7%)          72   (2.7%)     Gem::BasicSpecification#internal_init
       129   (4.9%)          58   (2.2%)     <top (required)>
        53   (2.0%)          53   (2.0%)     RbConfig.expand
      1697  (64.0%)          52   (2.0%)     <top (required)>
        68   (2.6%)          49   (1.8%)     Gem::Requirement.parse
       183   (6.9%)          48   (1.8%)     <top (required)>
       112   (4.2%)          44   (1.7%)     Gem::Requirement#initialize
       220   (8.3%)          33   (1.2%)     <module:Gem>
       250   (9.4%)          32   (1.2%)     Kernel#require
```

The idea is that the vast majority of the time `already_loaded?` won't match
anything. So by first looking for candidate paths that `end_with?` the file we
look for, we save `default_gem_load_paths.size` iterations and string concatenations.

https://github.com/rubygems/rubygems/commit/c60ce88d49
2020-07-31 21:07:19 +09:00
Hiroshi SHIBATA 832fe77879 Bump version to 3.2.0.rc.1 2020-07-31 21:07:19 +09:00
Bart de Water 734c5276f0 [rubygems/rubygems] Simplify digest name selection and use SHA256
The previous commit introduces the Gem::Security.create_digest method, allowing to:
- decouple algorithm choice from implementation (OpenSSL or Ruby built-in)
- untangle the SHA512 fallback for TarWriter from the generic hashing digest choice (undoing commit 9471f8ed2bdc12248d2619bbbce6e53cd6c16cb6)

https://github.com/rubygems/rubygems/commit/1bc03231e4
2020-07-31 21:07:19 +09:00
Bart de Water 8161cf85ba Stop using deprecated OpenSSL::Digest constants 2020-07-31 21:07:19 +09:00
Karol Bucek e7b6e0ff58 [rubygems/rubygems] remove explicit require(s) for auto-loaded constant(s)
the Gem module's auto-loads will handle loading these as needed,

this started as a redundancy found in *rubygems.rb* which had:
`autoload :Specification, 'rubygems/specification'` as well as
`require 'rubygems/specification'`

https://github.com/rubygems/rubygems/commit/43ceae7ac0
2020-07-31 21:07:19 +09:00
Marc-Andre Lafortune c3b480b776 [rubygems/rubygems] Test files should not be included in spec.files
https://github.com/rubygems/rubygems/commit/0c0760b734
2020-07-31 21:07:19 +09:00
David Rodríguez a89665b7b1 Enforce no empty lines around class body in rubygems
To normalize the code style with `bundler`.
2020-07-31 21:07:19 +09:00
Nobuyoshi Nakada b2d96abb42 Extract version number from the source
"requiring version.rb" strategy has some issues.

- cannot work when cross-compiling
- often introduces wrong namespace
- must know the superclasses
- costs at each runtime than at build-time

etc.
2020-07-30 19:03:18 +09:00
Nobuyoshi Nakada 7fb12be99f [ruby/net-ftp] Moved Net::Ftp::Version to Net::FTP
On case-insensitive filesystem, generated Net/FTP.html is
overwritten by Net/Ftp.html.

https://github.com/ruby/net-ftp/commit/14a6ff5134
2020-07-28 15:14:01 +09:00
Sergio e4b63202eb Remove unnecessary word from comment 2020-07-28 12:14:45 +09:00
aycabta c4f8095e97 Use typewriter notation for var[:sym] correctly 2020-07-27 15:24:03 +09:00
Nobuyoshi Nakada ba99eae2a5
[ruby/optparse] Fix ls-files matching regexp
As splitting by NUL means to allow the file names to contain
newlines, path names should match at beginning-of-string instead
of beginning-of-line.

https://github.com/ruby/optparse/commit/df3933aa2b
2020-07-24 11:00:34 +09:00
Yusuke Endoh 098e8c2873 Suppress "assigned but unused variable" warnings 2020-07-23 23:44:25 +09:00
Tom Rothe e43d629575 [ruby/observer] add symbol usage example to Observer#add_observer [doc]
https://github.com/ruby/observer/commit/62a94e3799
2020-07-23 09:49:03 -04:00
Nobuyoshi Nakada f120e65200 [ruby/optparse] Define OptionParser::Version
https://github.com/ruby/optparse/commit/4c0021b5b2
2020-07-23 10:57:33 +09:00
Nobuyoshi Nakada cd429e68d2 [ruby/optparse] Update required ruby version
Now needs `DidYouMean#formatter` which is provided since
did_you_mean 1.2, which requires ruby 2.5.

https://github.com/ruby/optparse/commit/d44bb5c715
2020-07-23 10:57:31 +09:00
Hiroshi SHIBATA 7befc0cdfc
Promote optparse to default gems 2020-07-22 18:38:51 +09:00
aycabta 20172672db Add require 'irb/ruby-lex' to use RubyLex 2020-07-22 04:11:38 +09:00
hyrious 02951a45f0 [ruby/rdoc] Create link to unary operator methods correctly
https://github.com/ruby/rdoc/commit/54500cf12a
2020-07-22 02:35:12 +09:00
Benoit Tigeot 7693aa7056 [ruby/rdoc] Remove empty lines from html file by using ERB trim_mode flag
https://github.com/ruby/rdoc/commit/9e27299a46
2020-07-22 02:34:58 +09:00
Jeremy Evans 38480ad507 [ruby/rdoc] Fix parsing of rb_define_module_under
Fixes Ruby Bug #15819

https://github.com/ruby/rdoc/commit/94a052d833
2020-07-22 02:34:49 +09:00
aycabta f76d67f484 [ruby/rdoc] Fix RDoc::Context#instance_method_list
The warn method returns nil, it's a bug of #instance_method_list.

https://github.com/ruby/rdoc/commit/a20df89263
2020-07-22 02:34:26 +09:00
Nobuhiro IMAI f6e789e3b0 [ruby/irb] handle rescue modifier properly
https://github.com/ruby/irb/commit/6de1341f5e
2020-07-22 02:31:47 +09:00
Masataka Pocke Kuwabara b40e925c92 [ruby/irb] Fix error when `inspect` is called but not found in inspector
https://github.com/ruby/irb/commit/ce6d53e6d9
2020-07-22 02:31:47 +09:00
aycabta c72a2fad97 [ruby/irb] Simplify RubyLex.compile_with_errors_suppressed
nobu-san reviewed,

https://github.com/ruby/irb/pull/106#pullrequestreview-423400033
> How about lexer = Ripper::Lexer.new(";\n#{code}", nil, 0)?
> Encoding pragma is effective only at the beginning.
> And the semicolon and newline will be skipped because the position is before
> the initial pos.

I employ the way.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

https://github.com/ruby/irb/commit/e593cc65b7
2020-07-22 02:31:46 +09:00
aycabta 1dfd24a7fc [ruby/irb] Suppress incomplete encoding magic comment error
https://github.com/ruby/irb/commit/443e90af80
2020-07-22 02:31:46 +09:00
aycabta 78ccab2530 [ruby/irb] Suppress incomplete coding magic comment error
https://github.com/ruby/irb/commit/6a457edbd1
2020-07-22 02:31:46 +09:00
Gabriel Nagy a8eecceaef [ruby/csv] Bump minimum ruby version to 2.5.0 (#159)
A dependency to stringio was added to csv, which requires Ruby version
>= 2.5. Bump the gemspec version accordingly.
https://github.com/ruby/csv/commit/bc5a26029f
2020-07-21 09:17:56 +09:00
Sutou Kouhei c6f389d84e [ruby/csv] Move doc/* to doc/csv/* to work in ruby/ruby too
https://github.com/ruby/csv/commit/910f8e0c5d
2020-07-21 09:17:54 +09:00
Burdette Lamar 935d0b3d05 [ruby/csv] Enhanced RDoc for several methods (#158)
* Enhanced RDoc for several methods

* Update lib/csv.rb

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
https://github.com/ruby/csv/commit/72e8b00e51
2020-07-20 15:39:31 +09:00
Sutou Kouhei 78893f16b2 [ruby/csv] Bump version
https://github.com/ruby/csv/commit/f9cd046d66
2020-07-20 15:39:29 +09:00
Sutou Kouhei d919b0e4f9 [ruby/csv] Require stringio 0.1.3 or later
https://github.com/ruby/csv/commit/09dd9f2771
2020-07-20 15:39:26 +09:00
Sutou Kouhei 4fcfa85cb6
[ruby/csv] CSV.generate_line: use the encoding of the first non ASCII field as the expected encoding
See also: https://github.com/ruby/stringio/issues/13#issuecomment-660543554

https://github.com/ruby/csv/commit/004cf49d18
2020-07-20 02:32:55 +09:00
Sutou Kouhei 178649e6dc
[ruby/csv] force_quotes: add support for specifying the target indexes or names
GitHub: fix GH-153

Reported by Aleksandr. Thanks!!!

https://github.com/ruby/csv/commit/8812c58a26
2020-07-20 02:32:54 +09:00
Burdette Lamar d9749b4715
[ruby/csv] RDoc for converters (#157)
* More on RDoc for converters

* More on RDoc for converters

* Fix indent

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
https://github.com/ruby/csv/commit/6044976160
2020-07-20 02:32:54 +09:00
Burdette Lamar d7c42df0b1
[ruby/csv] Adding call-seq to methods RDoc (#155)
* Adding call-seq to methods RDoc

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>


https://github.com/ruby/csv/commit/dbd860c1cd
2020-07-20 02:32:54 +09:00
Burdette Lamar 544d82f49b
[ruby/csv] RDoc: summary lists for options (#154)
* RDoc: summary lists for options

* Enhanced RDoc for certain attributes and instance methods

* Enhanced RDoc for certain attributes and instance methods

* Enhanced RDoc for certain attributes and instance methods

* Enhanced RDoc for certain attributes and instance methods
https://github.com/ruby/csv/commit/72d8a25dc9
2020-07-20 02:32:54 +09:00
Burdette Lamar 40c5023629
[ruby/csv] RDoc remark about instance methods (#152)
https://github.com/ruby/csv/commit/76379bbe62
2020-07-20 02:32:54 +09:00
Burdette Lamar a0bee2bbd6
[ruby/csv] Revised introductory RDoc (#151)
https://github.com/ruby/csv/commit/60f6f1c28f
2020-07-20 02:32:54 +09:00
Burdette Lamar da83401ba4
[ruby/csv] Enhanced RDoc for filter (#149)
* Enhanced RDoc for filter

* Correct return values for ::filter, ::foreach, ::parse

* Enhanced RDoc for filter

* Remove "returns nil"s

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
https://github.com/ruby/csv/commit/2c347f9a3d
2020-07-20 02:32:54 +09:00
Burdette Lamar 66b5cedc29
[ruby/csv] Enhancements for RDoc (#148)
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
https://github.com/ruby/csv/commit/25dd4cddbb
2020-07-20 02:32:53 +09:00
Burdette Lamar d9eff306f5
[ruby/csv] Organize files in doc/ (#145)
https://github.com/ruby/csv/commit/bc9ea859b0
2020-07-20 02:32:53 +09:00
Burdette Lamar 920a16893a
[ruby/csv] RDoc for parse_line (adds headers examples) (#143)
* RDoc for parse_line (adds headers examples)

* RDoc for parse_line (adds headers examples)
https://github.com/ruby/csv/commit/a161be928e
2020-07-20 02:32:53 +09:00
Burdette Lamar 6106b7badd
[ruby/csv] Added headers to RDoc for CSV.foreach (#142)
* Added headers: to RDoc for CSV.foreach

* Correct options remark for CSV.generate

* Improve citation for option headers
https://github.com/ruby/csv/commit/b01945ec3a
2020-07-20 02:32:53 +09:00
Burdette Lamar e4742fec64
[ruby/csv] Add headers cases to CSV.parse (#141)
* Add headers cases to CSV.parse

* Adjust call-seq for CSV.parse

* Update csv.rb
https://github.com/ruby/csv/commit/848c760c43
2020-07-20 02:32:53 +09:00
Burdette Lamar 013cca1f9a
[ruby/csv] doc: fix return value of open {} and use File.open {} (#139)
* Enhanced RDoc for CSV

* Repair example code for foreach
https://github.com/ruby/csv/commit/16b425eb37
2020-07-20 02:32:52 +09:00
Burdette Lamar 7c55c96147
[ruby/csv] Rdoc (#137)
Enhancements for open, parse, minor tweaks.
https://github.com/ruby/csv/commit/35392f4e45
2020-07-20 02:32:52 +09:00
Burdette Lamar f89186aebb
[ruby/csv] Add document for CSV.instance (#136)
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
https://github.com/ruby/csv/commit/85e293c1ba
2020-07-20 02:32:52 +09:00
Burdette Lamar 1ac702cd29
[ruby/csv] Add RDoc links for delegated methods (#135)
https://github.com/ruby/csv/commit/1a4b96b418
2020-07-20 02:32:52 +09:00
Koichi ITO 08e70126ae
[ruby/csv] Add `invalid: :replace` for `CSV.open` (#130)
This PR adds `invalid: :replace` for `CSV.open`. It is a PR similar to #129.
https://github.com/ruby/csv/commit/5bf687341c
2020-07-20 02:32:52 +09:00
Koichi ITO cee10c1b70
[ruby/csv] Fix an error for `CSV.open` (#131)
Follow up to https://github.com/ruby/csv/pull/130/files#r434885191.

This PR fixes `ArgumentError` for `CSV.open` when processing
invalid byte sequence in UTF-8.
https://github.com/ruby/csv/commit/a4b528c209
2020-07-20 02:32:52 +09:00
Koichi ITO 4e33a87879
[ruby/csv] Add `undef: :replace` for `CSV.open` (#129)
This PR adds `undef: :replace` option for `CSV.open`.

`File.open` has `undef: :replace` option, but `CSV.open` does not.
It would be convenient if `CSV.open` could have a shortcut by having
`undef: :replace` option.
https://github.com/ruby/csv/commit/cff8b18480
2020-07-20 02:32:51 +09:00
Burdette Lamar cf8157e001
[ruby/csv] RDoc for foreach, generate (#127)
* Rdoc for foreach

* Enhanced Rdoc for CSV.generate
https://github.com/ruby/csv/commit/8c26c0ab1f
2020-07-20 02:32:51 +09:00
Sutou Kouhei 731c0eb44d
[ruby/csv] Bump version
https://github.com/ruby/csv/commit/c6577e5b6e
2020-07-20 02:32:51 +09:00
Burdette Lamar 9e6d54a501
[ruby/csv] Enhanced Rdoc (#124)
* Enhanced Rdoc for ::new

* Rdoc for parse_line

* More on parse_line

* Make ::new neater with :call-seq:

* Make better use of :call-seq:

* Rdoc for generate_line

* Respond to review
https://github.com/ruby/csv/commit/0d42df39cb
2020-07-20 02:32:51 +09:00
Sutou Kouhei e3808c5aca
[ruby/csv] Add missing document files to .gem
GitHub: fix GH-125

Reported by joast. Thanks!!!

https://github.com/ruby/csv/commit/bf41fa94cf
2020-07-20 02:32:51 +09:00
Sutou Kouhei 71bee3819f
[ruby/csv] Bump version
https://github.com/ruby/csv/commit/936f15f3cd
2020-07-20 02:32:50 +09:00
Sutou Kouhei 1822b19221
[ruby/csv] Don't drop stack trace in CSV.parse_line
GitHub: fix GH-120

Reported by Kyle d'Oliveira. Thanks!!!

https://github.com/ruby/csv/commit/2959483f90
2020-07-20 02:32:50 +09:00
Sutou Kouhei cf7e472ab4
[ruby/csv] test scanner: specify encoding explicitly
https://github.com/ruby/csv/commit/6e83a1de9c
2020-07-20 02:32:50 +09:00
Sutou Kouhei b8084b5cb4
[ruby/csv] Fix a bug that write_nil_value or write_empty_value don't work with non String
GitHub: fix GH-123

Reported by asm256. Thanks!!!

https://github.com/ruby/csv/commit/b4492139be
2020-07-20 02:32:50 +09:00
Burdette Lamar 6ba1abd40c
[ruby/csv] Enhanced Rdoc for CSV (#122)
https://github.com/ruby/csv/commit/cd670595d5
2020-07-20 02:32:50 +09:00
Sutou Kouhei 033514c62f
[ruby/csv] Bump version
https://github.com/ruby/csv/commit/edc6cb9022
2020-07-20 02:32:49 +09:00
Sutou Kouhei 814bfc8adc
[ruby/csv] Fix a parse bug when split character exists in middle of column value
GitHub: fix #115

Reported by TOMITA Masahiro. Thanks!!!

https://github.com/ruby/csv/commit/398b3564c5
2020-07-20 02:32:49 +09:00
TOMITA Masahiro aeac7db823
[ruby/csv] Fix docs for :strip option (#114)
https://github.com/ruby/csv/commit/fb10925271
2020-07-20 02:32:49 +09:00
Seiei Miyagi 3c5b67e0db
[ruby/csv] Ensuring StringIO's encoding in CSV.generate (#111)
https://github.com/ruby/csv/commit/dbf55ef008
2020-07-20 02:32:49 +09:00
Mike MacDonald d57bc03ba9
[ruby/csv] Do not loop forever when skip_lines regexp matches zero length with anchors (#110)
* Do not loop forever when skip_lines regexp matches zero length with anchors

* Remove needless white spaces

* Add missing eos check in skip_needless_lines

* Simplify test

https://github.com/ruby/csv/commit/3b15d4a3e8
2020-07-20 02:32:49 +09:00
Jim Kane b219cd5ac3
[ruby/csv] Make CSV::Row#dup return a usable Row (#108)
* Make CSV::Row#dup return a usable Row

Previously, calling `dup` on a `CSV::Row` object yielded an object whose
copy was too shallow. Changing the clone's fields would also change the
fields on the source. This change makes the clone more distinct from the
source, so that changes can be made to its fields without affecting the
source.

* Simplify

https://github.com/ruby/csv/commit/64a1ea06fc
2020-07-20 02:32:49 +09:00
Sutou Kouhei 172cfce6dc
[ruby/csv] Bump version
https://github.com/ruby/csv/commit/284ce810bc
2020-07-20 02:32:48 +09:00
David Rodríguez 5783d0dbfc Import remaining changes
The "sync with commits" scripts failed to properly import these for some
reason.
2020-07-15 16:05:12 +09:00
David Rodríguez 0c8d90b526 [rubygems/rubygems] Unswallow `Gem::Package::FormatError`
This error happen in a CI run, and as it is currently, it doesn't give
any useful information about the underlying cause. Let's not swallow the
original error.

https://github.com/rubygems/rubygems/commit/8c17ba2f45
2020-07-15 16:05:12 +09:00
David Rodríguez 4f9c673cab [rubygems/rubygems] Allow setting a tag prefix to be used by gem release tasks
https://github.com/rubygems/rubygems/commit/679008f23a
2020-07-15 16:05:12 +09:00
Utkarsh Gupta ca133c0366 [rubygems/rubygems] Fix line spacing to make Layout/EmptyLines happy
The Gemfile wasn't properly put in the last commit.
As a result, Layout/EmptyLines inspected an offense
in the Gemfile.

This also fixes the spec w.r.t change in the task
default.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/d1418fddd3
2020-07-15 16:05:12 +09:00
Utkarsh Gupta 95f90e3d2b [rubygems/rubygems] Add blank lines to make Bundler/OrderedGems happy
If the blank lines aren't used, then rubocop tries to
sort them in alphabetical order within their section.
Thus, adding lines so rubocop considers them as
different sections and doesn't try to sort them.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/cf44b18f0f
2020-07-15 16:05:12 +09:00
Utkarsh Gupta 281898ed6c [rubygems/rubygems] Fix Rakefile to make Style/SymbolArray happy
In case of multiple Rake tasks, the default tasks would
look something like this:
`task default: [:spec, :rubocop]`

Instead, they should use %i and look something like this:
`task default: %i[spec rubocop]`

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/487ecd59ce
2020-07-15 16:05:12 +09:00
Utkarsh Gupta 8c65f612f4 [rubygems/rubygems] Fix remaining RuboCop issues
With #3731 and #3740 merged, this covers up the
remaining part of the issues.
This was discovered when one tries to create a gem
with a different framework.
Could be reproduced with:
`bundle gem foo --ext --test=test-unit`

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/51b6457150
2020-07-15 16:05:12 +09:00
Jean Boussier 40f73b3a00 [rubygems/rubygems] Avoid calling LoadError#message because of its slowness
Instead we can rely on `LoadError#path`

https://github.com/rubygems/rubygems/commit/16d5c3b43c
2020-07-15 16:05:12 +09:00
Utkarsh Gupta e2837a77be [rubygems/rubygems] Constrain (shipped) RuboCop's version
Right now, we're not specifying the version constraints
on RuboCop that is shipped when a new gem is created.
This can break specs which runs rubocop on a new
skeleton gem as the newer versions of RuboCop are
released.

This commit ensures that the specs don't break by
constraining the RuboCop version.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/0b47243edd
2020-07-15 16:05:12 +09:00
Utkarsh Gupta ecb87b55d8 [rubygems/rubygems] Lock rubocop version to 0.80.1
The later RuboCop versions don't work with ruby2.3
so we should lock the version to what works with
ruby2.3 as we haven't dropped the support yet.

And since we're using the older version of rubocop,
also fix `Max` value of `LineLength` to 120, which
is the current standard. Without this, rubocop
will throw the line length offenses.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/46d0a800a2
2020-07-15 16:05:12 +09:00
Utkarsh Gupta b28c6d04d0 [rubygems/rubygems] Make Style/HashSyntax cop happy
Previously, we were using the old syntax like:
`task :default => :spec`, but now this commit
uses the new Ruby 1.9 hash syntax.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/b41d0fdb56
2020-07-15 16:05:12 +09:00
Utkarsh Gupta cbe4d29c2d [rubygems/rubygems] Roll back to Dir.chdir block
since without that, evaluating the gemspec from
outside `File.expand_path( __dir__)` won't work.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/9e5e52a1d9
2020-07-15 16:05:12 +09:00
Utkarsh Gupta 3b0d2a3d6d [rubygems/rubygems] Fix RuboCop offenses
These offenses appear when you create a gem with
`bundle gem foo` and run `rubocop` over it.

Initially, there were around 45 offenses detected,
but with #3731 and this, the number of offenses
have been reduced to 2.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/fe9dcaa1b4
2020-07-15 16:05:12 +09:00
MSP-Greg f3ad8a00e2 [rubygems/rubygems] bundler/lib/bundler/installer.rb - fix Windows 'executable_stubs'
Windows normal shell requires binstubs with *.cmd extensions

https://github.com/rubygems/rubygems/commit/b46326eb1f
2020-07-15 16:05:12 +09:00
Nobuyoshi Nakada c2a6295ec0
Make the mkmf methods private in the global [Bug #16896] 2020-07-13 18:44:22 +09:00
Kazuhiro NISHIYAMA 16bc9bf7e8
[DOC] Use https:// instead of http:// [ci skip] 2020-07-13 11:33:40 +09:00
Masataka Pocke Kuwabara ba81bc24e6
Add instance_methods to class generated by DelegateClass
Also, make DelegateClass.instance_method fallback to superclass.

Fixes [Bug #16982]
2020-07-09 15:01:10 -07:00
Bart de Water 3621a7debf Avoid deprecated OpenSSL::Digest constants 2020-06-29 13:25:32 +09:00
Richard Schneeman 2d89af45ea Add require to Delegator examples
In Ruby 2.7.1 SimpeDelegator cannot be used without requiring `delegate` this PR adds the require to the first example for each class so that devs don't have to hunt for what require to use.
2020-06-25 11:21:13 -04:00
Nobuyoshi Nakada 9a78e24f7d
Removed nonsense `rubygems_version` in input gemspec files
As it is ignored and set at building packages automatically, it is
just nonsense to set in gemspec file for input.
2020-06-25 15:44:56 +09:00
Kazuhiro NISHIYAMA 6adbdb56ed
Fix Encoding::CompatibilityError in `FileUtils::Entry_#join` 2020-06-22 18:34:24 +09:00
Kazuhiro NISHIYAMA 7ac6c967e4
Revert d231b8f95b and add debug print 2020-06-22 18:18:16 +09:00
Kazuhiro NISHIYAMA 3238641750
Use filesystem encoding for file path only
`path_info` contains filesystem encoding and binary.
Example is `"/webrick.cgi/%A5%DB%A4%B2/%A4%DB%A4%B2"` in `TestWEBrickCGI#test_cgi`.
2020-06-22 17:37:37 +09:00
Kazuhiro NISHIYAMA d231b8f95b
Fix remove_entry error when path encoding is not compatible UTF-8 2020-06-22 17:11:24 +09:00
Nobuyoshi Nakada 995923b7f9
[DOC] Mentioned that `Time.parse` method is not validator 2020-06-21 16:16:15 +09:00
Kazuhiro NISHIYAMA 32e2440a66
Fix `ERROR ArgumentError: invalid byte sequence in UTF-8`
http://ci.rvm.jp/results/trunk-test@ruby-sky1/3012894
```
/tmp/ruby/v3/src/trunk-test/tool/lib/minitest/unit.rb:199:in `assert': webrick log start: (MiniTest::Assertion)
  [2020-06-19 23:01:59] ERROR ArgumentError: invalid byte sequence in UTF-8
  	/tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/filehandler.rb:336:in `scan'
  	/tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/filehandler.rb:336:in `set_filename'
  	/tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/filehandler.rb:310:in `exec_handler'
  	/tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/filehandler.rb:245:in `do_GET'
  	/tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/abstract.rb:105:in `service'
  	/tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/filehandler.rb:241:in `service'
  	/tmp/ruby/v3/src/trunk-test/lib/webrick/httpserver.rb:140:in `service'
  	/tmp/ruby/v3/src/trunk-test/lib/webrick/httpserver.rb:96:in `run'
  	/tmp/ruby/v3/src/trunk-test/lib/webrick/server.rb:307:in `block in start_thread'
```
2020-06-19 23:06:38 +09:00
Kazuhiro NISHIYAMA 97c1782db6
Use filesystem encoding as FileHandler's encoding
instead of `@root.encoding`.
And fallback to ASCII-8BIT when filesystem encoding is US-ASCII.

When `@root.encoding` is not compatible filesystem encoding,
`Encoding::CompatibilityError` raised at `webrick/httpservlet/filehandler.rb:341`.
So `DocumentRoot` must be compatible with filesystem encoding.
2020-06-19 22:56:29 +09:00
Kazuhiro NISHIYAMA 78d4eace02
Do not change local_path encoding in WEBrick::HTTPServlet::DefaultFileHandler
This reverts 750203c514 and 93e6fa1d31
2020-06-19 22:08:19 +09:00
Kazuhiro NISHIYAMA 6fe1919486
Fix failure on mswin CI
https://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-master/log/20200619T054159Z.fail.html.gz
```
  1) Failure:
WEBrick::TestFileHandler#test_cjk_in_path [D:/tmp/mswin-build20200619-14304-utgij/ruby/test/webrick/utils.rb:72]:
exceptions on 2 threads:
webrick log start:
  [2020-06-19 16:28:42] ERROR `/あ.txt' not found.

webrick log end
Filesystem encoding is Windows-31J.
<"200"> expected but was
<"404">.
---
<[]> expected but was
<["[2020-06-19 16:28:42] ERROR `/\xE3\x81\x82.txt' not found.\n"]>.
```

`prevent_directory_traversal` treats `path_info` as filesystem encoding.
So path_info should be filesystem encoding in request URL.

On some environments, fallback to ASCII-8BIT when EncodingError.
2020-06-19 20:13:22 +09:00
Kazuhiro NISHIYAMA daa9dcd57e
Hide error location from error message 2020-06-19 20:13:22 +09:00
Jean Boussier adbdf11f94 [open3] only close streams if a block is passed
Ref: 5429deb075

The previous change totally borke `popen2e` in this usage:

```ruby
require 'open3'
stdin, stdout, process = Open3.popen2e("cat")
puts stdout.read
```
2020-06-18 10:00:20 -07:00
Yusuke Endoh 750203c514 lib/webrick/httpservlet/filehandler.rb: always handle a path as UTF-8
https://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-master/log/20200618T113134Z.fail.html.gz
```
  1) Failure:
WEBrick::TestFileHandler#test_cjk_in_path [D:/tmp/mswin-build20200618-84004-1t0dh8f/ruby/test/webrick/utils.rb:72]:
exceptions on 2 threads:
webrick log start:
  [2020-06-18 22:18:07] ERROR `/??.txt' not found.

webrick log end
Filesystem encoding is Windows-31J.
<"200"> expected but was
<"404">.
```
2020-06-18 23:43:48 +09:00
David Rodríguez c5ee078c5f [rubygems/rubygems] Disable parallel installation by default on Windows
Since we enabled parallel installation by default, we've fixed all the
issues related to it that have come up, except for a Windows issue that
we haven't yet figured out. This issue is hit by our specs on a daily
basis and there's no reason to believe that it won't be hit by end users
in a similar way.

So, both to stop the testing flakyness and to prevent regressions in the
default behavior on Windows, I'd rather leave the default as it was
before on Windows for now.

https://github.com/rubygems/rubygems/commit/5d8ab57131
2020-06-18 19:14:15 +09:00