Commit graph

67695 commits

Author SHA1 Message Date
git
0d74ddc5ff * 2021-07-15 [ci skip] 2021-07-15 09:26:19 +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
Nobuyoshi Nakada
169529a0c0
[ruby/fiddle] Check HAVE_RUBY_MEMORY_VIEW_H rather than API version (https://github.com/ruby/fiddle/pull/86)
c5abcc3a7e
2021-07-14 18:55:59 +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
git
57a743efa4 * 2021-07-14 [ci skip] 2021-07-14 10:48:29 +09:00
Hiroshi SHIBATA
896bbb9fad Merge RubyGems/Bundler master from 8459ebd6ad65ce3397233416dc64083ae7572bb9 2021-07-14 10:48:07 +09:00
xtkoba
29f6f79e73 Get ruby_nonempty_memcpy to have C linkage
Fixes [Bug #17788]
2021-07-13 22:55:17 +09:00
Nobuyoshi Nakada
cb955dc9ac
[ruby/fiddle] update dependencies 2021-07-13 21:34:28 +09:00
aycabta
1d03c7da04 [ruby/irb] Add an explanation of default sub commands of "measure", which are :time and :stackprof
759be5a344
2021-07-13 21:21:29 +09:00
Nobuyoshi Nakada
40d45ab093
[ruby/fiddle] Check HAVE_RUBY_MEMORY_VIEW_H rather than API version
93f9564446
2021-07-13 20:36:45 +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
Nobuyoshi Nakada
472d8c5555
[ruby/fiddle] Update required_ruby_version (https://github.com/ruby/fiddle/pull/85)
Drop supports for old versions, keeping 2.5 as CI supports it for
now.

90634e7c55
2021-07-13 19:37:46 +09:00
Sutou Kouhei
bb868f4814
[ruby/fiddle] Use have_header and have_type to detect memory view availability
Fix https://github.com/ruby/fiddle/pull/84

It may detect ruby/memory_view.h for system Ruby that is installed in
/usr.

We can use RUBY_API_VERSION_MAJOR to detect memory view availability
because memory view is available since Ruby 3.0.

Reported by Jun Aruga. Thanks!!!

3292929830
2021-07-13 19:37:46 +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
a2c9e1b58a
[ruby/fiddle] Bump version
049138b4b8
2021-07-13 19:37:46 +09:00
Sutou Kouhei
70b0318646
[ruby/fiddle] MemoryView: ensure reset rb_memory_view_t::obj on error
0ed39345fe
2021-07-13 19:37:46 +09:00
Sutou Kouhei
9f86e50e1e
[ruby/fiddle] StringValuePtr may change the val
bddca7c895
2021-07-13 19:37:45 +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
Sutou Kouhei
c0f9191ab6
[ruby/fiddle] Bump version
3784cfeec4
2021-07-13 19:37:44 +09:00
Nobuyoshi Nakada
4c039a2ea0
tool/sync_default_gems.rb: remove CRs 2021-07-13 19:36:52 +09:00
Nobuyoshi Nakada
f9c559a0a2
sync_default_gems.rb: expand links to PRs of the upstream 2021-07-13 19:05:50 +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
git
b18f6fff69 * 2021-07-13 [ci skip] 2021-07-13 16:28:57 +09:00
Samuel Williams
9df712a0e2 Expose rb_obj_is_fiber. 2021-07-13 19:28:40 +12:00
Yusuke Endoh
84fea8ee39 [ruby/error_highlight] Update a test for multibyte characters
2fc70d7f8e
2021-07-12 16:48:52 +09:00
Yusuke Endoh
8b01d16ad6 [ruby/error_highlight] Stop showing a code snippet if it has non-ascii characters
See https://github.com/ruby/error_highlight/issues/4

c20efd3961
2021-07-12 16:48:15 +09:00
Samuel Williams
028441d22f Avoid calling fstat on things we already know are valid sockets. 2021-07-12 19:16:22 +12:00
git
0895d57d31 * 2021-07-12 [ci skip] 2021-07-12 13:45:15 +09:00
Nobuyoshi Nakada
6504ca006b
Show node IDs in dump 2021-07-12 12:10:16 +09:00
Nobuyoshi Nakada
c2ed5ab08b [ruby/date] Fixed markups for bold [ci skip]
404f9d2096
2021-07-11 20:28:23 +09:00
Jeremy Evans
8065670cfb [ruby/date] Fix comparison with Float::INFINITY
Fixes [Bug #17945]

953d907238
2021-07-11 20:28:21 +09:00
Nobuyoshi Nakada
49ba7cd259
[DOC] Move mailing-list URLs to footnotes [ci skip] 2021-07-11 20:12:45 +09:00
Nobuyoshi Nakada
690385014a
Move core_assertions.rb from test/unit
This file contains extended assertions for ruby core which do not
belong to test/unit.
2021-07-11 19:56:53 +09:00
S-H-GAMELINKS
b32ae9898f Move rb_str_escape function declaration 2021-07-11 18:26:20 +09:00
git
e330bbeeb1 * 2021-07-11 [ci skip] 2021-07-11 06:12:24 +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
cb3eb3d7d5
Get rid of conflict in ccan/list
Undefine LIST_HEAD from BSD-origin sys/queue.h.
2021-07-10 17:39:25 +09:00
git
9c2851508e * 2021-07-10 [ci skip] 2021-07-10 13:44:33 +09:00
Jeremy Evans
289fd3c801 [ruby/irb] Pass local variables from workspace binding to lexer
This fixes at least an issue where irb will incorrectly assume
code opens a heredoc when it does not, such as this code:

```ruby
s1 = 'testing'
s2 = 'this'
s2 <<s1
p s1
s1
```

Ruby parses the `s2 <<s1` as `s2.<<(s1)`, not as a heredoc, because
`s2` is a local variable in scope.  irb was using ripper without
letting ripper know that `s2` was a local variable, so ripper would
lex it as a heredoc instead of a method call.

Fix the situation by prepending a line at line 0 with all local
variable definitions in scope whenever lexing.  This fixes the
heredoc issue, and potentially other issues that depend on whether
an identifier is a local variable or not.

Fixes [Bug #17530]

4ed2187f76
2021-07-10 13:44:17 +09:00