[#99868] [Ruby master Bug#17144] Tempfile.open { ... } does not unlink the file — eregontp@...
Issue #17144 has been reported by Eregon (Benoit Daloze).
15 messages
2020/09/03
[ruby-core:99972] [Ruby master Bug#15409] OpenStruct error when attribute is called 'method'
From:
merch-redmine@...
Date:
2020-09-09 00:00:53 UTC
List:
ruby-core #99972
Issue #15409 has been updated by jeremyevans0 (Jeremy Evans).
marcandre (Marc-Andre Lafortune) wrote in #note-9:
> I opened a PR that resolves this: https://github.com/ruby/ostruct/pull/15
I reviewed the PR and the changes look good to me.
In regards to OpenStruct in general, I agree with @marcandre and @mame that=
it is an antipattern. I think it is almost always preferable to use a plai=
n hash. Personally, I would like to move ostruct from default gems to bund=
led gems, and at some point consider removing it as a bundled gem. The onl=
y complicating factor is json has a dependency on ostruct. JSON::GenericObj=
ect inherits from OpenStruct, though as far as I can tell, it doesn't seem =
to be used internally.
----------------------------------------
Bug #15409: OpenStruct error when attribute is called 'method'
https://bugs.ruby-lang.org/issues/15409#change-87511
* Author: elioncho (El=EDas Orozco)
* Status: Assigned
* Priority: Normal
* Assignee: marcandre (Marc-Andre Lafortune)
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin16]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
The following error is shown when you try to access an OpenStruct with a pr=
operty called method:
`method': wrong number of arguments (given 0, expected 1) (ArgumentError)
To replicate:
~~~ ruby
require 'ostruct'
o =3D OpenStruct.new({ method: 'get' })
o.method
~~~
The expected behavior should be to return 'get'
-- =
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>