[#87773] timer thread [was Re: [ruby-alerts:7905] failure alert on trunk-asserts@silicon-docker (NG (r63844))] — Eric Wong <normalperson@...>
> test_all <main>: warning: pthread_create failed for timer: Resource temporarily unavailable, scheduling broken
[#87836] [Ruby trunk Bug#14898] test/lib/test/unit/parallel.rb: TestSocket#test_timestamp stuck sometimes — ko1@...
Issue #14898 has been reported by ko1 (Koichi Sasada).
ko1@atdot.net wrote:
On 2018/07/06 18:47, Eric Wong wrote:
[#87847] undefined symbol: mjit_init_p — Leam Hall <leamhall@...>
I pulled Ruby trunk on 3 Jul and am now getting errors similar to the
As I told you, `make install` is needed to make Ruby work. Running
One more reason for https://bugs.ruby-lang.org/issues/13620 maybe? ;)
Benoit Daloze <eregontp@gmail.com> wrote:
[#87986] [Ruby trunk Feature#14915] Deprecate String#crypt, move implementation to string/crypt — mame@...
Issue #14915 has been updated by mame (Yusuke Endoh).
mame@ruby-lang.org wrote:
normalperson (Eric Wong) wrote:
[#88088] [Ruby trunk Misc#14937] [PATCH] thread_pthread: lazy-spawn timer-thread only on contention — normalperson@...
Issue #14937 has been reported by normalperson (Eric Wong).
[#88104] [Ruby trunk Bug#14898] test/lib/test/unit/parallel.rb: TestSocket#test_timestamp stuck sometimes — ko1@...
Issue #14898 has been updated by ko1 (Koichi Sasada).
[#88173] [Ruby trunk Bug#14950] r64109 thread.c: move ppoll wrapper before thread_pthread.c - Windows compile failure - thread.c — Greg.mpls@...
Issue #14950 has been reported by MSP-Greg (Greg L).
[#88189] [Ruby trunk Bug#14950] r64109 thread.c: move ppoll wrapper before thread_pthread.c - Windows compile failure - thread.c — nobu@...
Issue #14950 has been updated by nobu (Nobuyoshi Nakada).
[#88199] [Ruby trunk Misc#14937] [PATCH] thread_pthread: lazy-spawn timer-thread only on contention — takashikkbn@...
Issue #14937 has been updated by k0kubun (Takashi Kokubun).
takashikkbn@gmail.com wrote:
> yet, sky3 had a failure at
> http://ci.rvm.jp/results/trunk@P895/1173951
> > http://ci.rvm.jp/results/trunk@P895/1173951
[ruby-core:87940] [Ruby trunk Bug#14909] Method call with object that has to_hash method crashes (method with splat and keyword arguments)
Issue #14909 has been updated by johannes_luedke (Johannes L端dke).
https://bugs.ruby-lang.org/issues/14909#note-2 doesn't resolve the issue for me
> Why your object has to_hash method?
the objects in question are instances of `Dry::Validation::Result` (dry-validation gem)
> So, I'd like to propose keeping the current behavior as is, because changing the semantics will bring extra complexity. Instead, just wait for Ruby 3.
Could this maybe be highlighted in the docs -- to be careful when passing objects that respond `to_hash` when there are keyword arguments?
In order to make it work both ways, `my_func(obj1, obj2, error_code: 422)` as well as `my_func(obj1, obj2)` with a default value for `error_code`, I ended up doing this workaround:
~~~ruby
def my_func(*args)
opts, objects = args.partition { |el| el.is_a? Hash }
error_code = opts&.first&.fetch(:error_code, nil) || 400
~~~
It would be cool if ruby would support that out of the box though.
----------------------------------------
Bug #14909: Method call with object that has to_hash method crashes (method with splat and keyword arguments)
https://bugs.ruby-lang.org/issues/14909#change-72947
* Author: johannes_luedke (Johannes L端dke)
* Status: Feedback
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin17]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
In a method with a splat method argument followed by a keyword argument, it leads to an `ArgumentError` when calling the method with an object that reacts to `to_hash`
~~~ruby
def my_func(*objects, error_code: 400)
objects.inspect
end
class Test
def to_hash
# an example hash
{ to_hash_key: "to_hash" }
end
end
my_func(Test.new)
~~~
Observed result: an exception is raised: `in my_func: unknown keyword: to_hash_key (ArgumentError)`
Expected result: `[#<Test:0x007fc8c9825318>]` is returned by the `my_func` call
It should behave the same when calling with objects that have a `to_hash` method and objects that don't, shouldn't it?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>