Commit graph

15017 commits

Author SHA1 Message Date
Nobuyoshi Nakada
29ed9d1aaa [ruby/error_highlight] Fix leaked tempfiles
8b353a10a7
2021-07-16 15:25:13 +09:00
Jeremy Evans
95f8ffa5f6
Copy hash compare_by_identity setting in more cases
This makes the compare_by_identity setting always copied
for the following methods:

* except
* merge
* reject
* select
* slice
* transform_values

Some of these methods did not copy the setting, or only
copied the setting if the receiver was not empty.

Fixes [Bug #17757]

Co-authored-by: Kenichi Kamiya <kachick1@gmail.com>
2021-07-15 10:04:17 -07:00
Jeremy Evans
fa87f72e1e Add pattern matching pin support for instance/class/global variables
Pin matching for local variables and constants is already supported,
and it is fairly simple to add support for these variable types.

Note that pin matching for method calls is still not supported
without wrapping in parentheses (pin expressions).  I think that's
for the best as method calls are far more complex (arguments/blocks).

Implements [Feature #17724]
2021-07-15 09:56:02 -07:00
aycabta
f1035248af [ruby/irb] Show code page by irb_info on Windows
6160d74199
2021-07-16 01:55:25 +09:00
aycabta
456d0019dd [ruby/irb] Escape space in free-spacing mode
085ac42947
2021-07-16 01:55:16 +09:00
Nobuyoshi Nakada
3e7a7fb28a
Make Struct#keyword_init? return nil by default [Feature #18008] 2021-07-15 22:24:02 +09:00
NARUSE, Yui
835c63cd88 Add tests and NEWS [Feature #18008] 2021-07-15 18:21:49 +09:00
Nobuyoshi Nakada
f347b586fb
[ruby/fiddle] Handle#file_name results in very platform dependent 2021-07-15 09:49:56 +09:00
Nobuyoshi Nakada
c67c83fb68
[ruby/fiddle] Module file name may be the realpath
Even when the path which was used to dlopen may be a symlink.
2021-07-15 09:20:10 +09:00
Nobuyoshi Nakada
2fa3209a35
[ruby/fiddle] fixed the test on case-insensitive filesystem 2021-07-14 22:00:56 +09:00
Kenta Murata
67897762cf
[ruby/fiddle] Add Fiddle::Handle#file_name (https://github.com/ruby/fiddle/pull/88)
4ee1c6fc4b
2021-07-14 18:56:00 +09:00
Kenta Murata
818c74b7f4 [ruby/fiddle] Return the module handle value in Fiddle::Handle#to_i and add FIddle::Handle#to_ptr (https://github.com/ruby/fiddle/pull/87)
170111a0cb
2021-07-14 18:43:32 +09:00
Hiroshi SHIBATA
896bbb9fad Merge RubyGems/Bundler master from 8459ebd6ad65ce3397233416dc64083ae7572bb9 2021-07-14 10:48:07 +09:00
Yusuke Endoh
a5d6ea9266 [ruby/error_highlight] Set the binary mode for Tempfile creation in a test
8273d3b6f2
2021-07-13 20:30:20 +09:00
Aaron Patterson
5c0d8c6369
[ruby/fiddle] Add "offsetof" to Struct classes (https://github.com/ruby/fiddle/pull/83)
* Add "offsetof" to Struct classes

I need to get the offset of a member inside a struct without allocating
the struct.  This patch adds an "offsetof" class method to structs that
are generated.

The usage is like this:

```ruby
MyStruct = struct [
  "int64_t i",
  "char c",
]

MyStruct.offsetof("i") # => 0
MyStruct.offsetof("c") # => 8
```

* Update test/fiddle/test_c_struct_builder.rb

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

4e3b60c5b6

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2021-07-13 19:37:46 +09:00
Sutou Kouhei
10e26cfa76
[ruby/fiddle] Add MemoryView.export and MemoryView#release (https://github.com/ruby/fiddle/pull/80)
fix https://github.com/ruby/fiddle/pull/79

Users can release memory views explicitly before process exit.

Reported by xtkoba. Thanks!!!

1de64b7e76
2021-07-13 19:37:45 +09:00
Sutou Kouhei
9988f6ac4e
[ruby/fiddle] Add Fiddle::MemoryView#to_s (https://github.com/ruby/fiddle/pull/78)
Fix https://github.com/ruby/fiddle/pull/74

Reported by dsisnero. Thanks!!!
2021-07-13 19:37:45 +09:00
Sutou Kouhei
8c905349bb
[ruby/fiddle] test: fix SetLastError's input type
ca5e6a0404
2021-07-13 19:37:45 +09:00
Sutou Kouhei
37d16bb9dc
[ruby/fiddle] test: use double quote for string literal
fab7eab95b
2021-07-13 19:37:45 +09:00
Sutou Kouhei
5516d74ad2
[ruby/fiddle] test: add a test for win32_last_socket_error
c86cec03cd
2021-07-13 19:37:45 +09:00
Sutou Kouhei
303ab5da8b
[ruby/fiddle] test: add missing receiver
1da3b4af16
2021-07-13 19:37:45 +09:00
Sutou Kouhei
d1eeb9fec9
[ruby/fiddle] windows: use GetLastError() for win32_last_error
Ruby: [Bug #11579]

Patch by cremno phobia. Thanks!!!

760a8f9b14
2021-07-13 19:37:45 +09:00
Yusuke Endoh
5fd5d71a4b [ruby/error_highlight] Support a file that has no final newline
9d671284cb
2021-07-13 16:54:17 +09:00
Yusuke Endoh
23c8bc367c [ruby/error_highlight] Support hard tabs
Now, the highlight line is created by replacing non-tab characters with
spaces, and keeping all hard tabs as-is. This means the highlight line
has the completely same indentation as the code snippet line.

Fixes #7

38f20fa542
2021-07-13 16:51:02 +09:00
Yusuke Endoh
84fea8ee39 [ruby/error_highlight] Update a test for multibyte characters
2fc70d7f8e
2021-07-12 16:48:52 +09:00
Jeremy Evans
8065670cfb [ruby/date] Fix comparison with Float::INFINITY
Fixes [Bug #17945]

953d907238
2021-07-11 20:28:21 +09:00
aycabta
947d0198e0 [ruby/irb] Show LANG and LC_ALL env by irb_info
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

b431742430
2021-07-11 06:12:07 +09:00
Nobuyoshi Nakada
491ab2820a
Remove half-defined Reline on LoadError
When fiddle is not avaiable, reline/terminfo depending on it also
fails.
2021-07-10 21:02:50 +09:00
Nobuyoshi Nakada
d172f8ac09
Skip fiddle tests if fiddle is not avaiable 2021-07-10 19:14:40 +09:00
Nobuyoshi Nakada
524513be39
mkmf.rb: try linking at try_var
To check for variables accessible but not declared.
2021-07-08 18:18:35 +09:00
Nobuyoshi Nakada
7a2383b5c1
Split test of Hash.[] and add assertion for default value/proc
For a73f13c907.
2021-07-08 16:47:30 +09:00
Martin Dürst
3b36e34b90 Adapt test_emoji_breaks.rb to Unicode 13.0.0/Emoji 13.0
- Add UNICODE_VERSION,... to deal with new location of some
  of the emoji-related data files.
- Introduce class BreakFile to handle various file properties.
- Adapt main code to use BreakFile.
2021-07-08 14:45:03 +09:00
Hiroshi SHIBATA
c082c6eb7c Sync RubyGems and Bundler with upstream 2021-07-07 15:31:52 +09:00
David Rodríguez
6e2240a2f9 Sync latest bundler & rubygems development version 2021-07-07 13:30:20 +09:00
Nobuyoshi Nakada
3dacc14fd3 [ruby/rdoc] Fix links without paths
424bd5db4d
2021-07-05 11:34:37 +09:00
Nobuyoshi Nakada
f88a9097a4 [ruby/rdoc] Fix for explicit http link
caf234665c
2021-07-05 11:34:35 +09:00
Nobuyoshi Nakada
7c8aa0a5d2 [ruby/rdoc] Allow a label in a link to another document text
85bb2d33bb
2021-07-05 11:34:33 +09:00
Nobuyoshi Nakada
46ab28d6c9 [ruby/rdoc] Fix assertions which look very likely unintended
dc7c890a3d
2021-07-05 11:34:31 +09:00
aycabta
caa123b50e [ruby/rdoc] Support ActiveSupport::Concern.included
ref. 168ddaa08a/activerecord/lib/active_record/core.rb (L9-L20)

a2d651dade

Co-authored-by: Fumiaki MATSUSHIMA <mtsmfm@gmail.com>
2021-07-05 11:34:29 +09:00
Nobuyoshi Nakada
2f3edf28f3 [ruby/rdoc] Prefer omit to pend
These conditions are not temporary, rather platform dependent.

https://github.com/ruby/rdoc/pull/815#discussion_r654660411

92545fa250
2021-07-05 11:34:27 +09:00
Ulysse Buonomo
ec9a9af375 [ruby/rdoc] Fix chained inclusion ancestors_of
Fixes #814

Signed-off-by: Ulysse Buonomo <buonomo.ulysse@gmail.com>

b45f747216
2021-07-05 11:34:25 +09:00
Nobuyoshi Nakada
0a32cefabd
Add domain check macros 2021-07-04 22:15:59 +09:00
Nobuyoshi Nakada
2488589b2f
Removed extra double quotes from domain error messages 2021-07-04 15:28:25 +09:00
Nobuyoshi Nakada
2d3572a154
Separate toolchain dependent test 2021-07-03 22:11:24 +09:00
Nobuyoshi Nakada
8ebb5e23eb Keep GC disabled until VM bootstrap has done [Bug #17583] 2021-07-01 18:49:17 -07:00
Martin Dürst
f6539202c5 - add regression tests for U+6E7F (湿) in ISO-2022-JP
In ISO-2022-JP, the bytes use to code are the same as those for "<>".
  This adds regression tests to make sure that these bytes, when representing
  湿, are NOT escaped with encode("ISO-2022-JP, xml: :text) or similar.
  These are additional regression tests for #12052.
2021-07-01 17:33:43 +09:00
Samuel Williams
42130a64f0
Replace copy coroutine with pthread implementation. 2021-07-01 11:23:03 +12:00
Masataka Pocke Kuwabara
e8c2b03ee1 [ruby/irb] Fix error on ls object_cant_define_singleton
such as `ls 42`, `ls :sym` and so on

b1d436a853
2021-06-30 20:55:18 +09:00
Yusuke Endoh
b270b5df2c Prevent "warning: ambiguity between regexp and two divisions" 2021-06-30 13:41:18 +09:00
Yusuke Endoh
f428ced69c [ruby/error_highlight] Experimentally support a custom formatter
f40a1de20e
2021-06-30 12:49:18 +09:00