summaryrefslogtreecommitdiff
path: root/lib/ostruct.rb
AgeCommit message (Collapse)Author
2021-06-15[ruby/ostruct] v0.4.0Marc-Andre Lafortune
https://github.com/ruby/ostruct/commit/8534f69e4e
2021-06-14[lib/ostruct] Allow overriding of `block_given?`Marc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/4572
2021-06-14[ruby/ostruct] bump upNobuyoshi Nakada
https://github.com/ruby/ostruct/commit/bb253be3e9
2021-06-14Add fallback block to `OpenStruct#delete_field` (#1409)jfrazx
Notes: Merged-By: marcandre <github@marc-andre.ca>
2021-04-28[ruby/ostruct] Add compatibility for to_h with block in Ruby 2.5Marc-Andre Lafortune
https://github.com/ruby/ostruct/commit/da45de5068
2021-04-28[ruby/ostruct] Compatibility with Ruby 2.5Marc-Andre Lafortune
https://github.com/ruby/ostruct/commit/ecd9fafdf8
2021-01-13[ruby/ostruct] Bump versionMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/4054
2021-01-12Fix method protection for modules in the ancestry chain.Marc-Andre Lafortune
[Fixes ruby/ostruct#23]
2021-01-05[ruby/ostruct] Bump versionMarc-Andre Lafortune
2021-01-05[ruby/ostruct] Allow ostruct to return a value on super (#4028)Adam Hess
This fixes cases where you can super in something that inherits from OpenStruct Co-authored-by: John Hawthorn <john@hawthorn.email> Notes: Merged-By: marcandre <github@marc-andre.ca>
2020-11-04[ruby/ostruct] Update versionMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3736
2020-11-04[ruby/ostruct] Restore `ostruct` docMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3736
2020-11-04Revert "Make `marshal_load` public"Marc-Andre Lafortune
This reverts commit ee7cc6ac35cfb056b3946b1dcd6d4d5a140ccacf. I'm not sure I agree with the spec, but I just tweaked it. Notes: Merged: https://github.com/ruby/ruby/pull/3736
2020-10-27Separate `send` into `public_send` and `__send__`Nobuyoshi Nakada
2020-10-06Make `marshal_load` publicAaron Patterson
Ruby specs expected this method to be public
2020-10-06[lib/ostruct] Fix Marshal loadingMarc-Andre Lafortune
2020-09-30[ruby/ostruct] Tweak docMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-30[ruby/ostruct] Remove unused conditionMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-30[ruby/ostruct] Improved YAML serialization.Marc-Andre Lafortune
Patch adapted from Pietro Monteiro [Fixes bug#8382] Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-30[ruby/ostruct] Add test that frozen OpenStructs are Ractor-shareableMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-30[ruby/ostruct] Protect subclass' methods and our bang methods.Marc-Andre Lafortune
Internally, use only bang methods Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-30[ruby/ostruct] Avoid calling initializeMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3593
2020-09-14[ruby/ostruct] Fix dup/cloneMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3541
2020-09-14[ruby/ostruct] method_missing is privateMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3541
2020-09-14[ruby/ostruct] Avoid self calling our public methods.Marc-Andre Lafortune
Found because `json` has a bad example in its test suite. This implementation still offers better encapsulation. Notes: Merged: https://github.com/ruby/ruby/pull/3541
2020-09-14[ruby/ostruct] Reinstate recent changesMarc-Andre Lafortune
This reverts commit 28e60b0045b5732bca11012d81a5223001faa6b2. Notes: Merged: https://github.com/ruby/ruby/pull/3541
2020-09-14[ruby/ostruct] Revert recent changesMarc-Andre Lafortune
This reverts commit e026e186f4..12a2e32d43.
2020-09-14[ruby/ostruct] Add access to public instance methods in case they are overridenMarc-Andre Lafortune
2020-09-14[ruby/ostruct] Tweak docMarc-Andre Lafortune
2020-09-14[ruby/ostruct] Allow overriding public methodsMarc-Andre Lafortune
[Fixes https://bugs.ruby-lang.org/issues/15409]
2020-09-14[ruby/ostruct] Refactor handling of frozen OpenStruct. Simplify ↵Marc-Andre Lafortune
`new_ostruct_member!`
2020-09-14[ruby/ostruct] Revert "ostruct.rb: deferred accessors"Marc-Andre Lafortune
This reverts commits: dc38e99813 22c082fcfd b499e0f9ff 58e5876646 Add test for overriden private methods [Fixes https://bugs.ruby-lang.org/issues/12136]
2020-09-04lib/ostruct.rb: Revert "To use RuntimeError instead of FrozenError for old ↵Marc-Andre Lafortune
ruby versions." This reverts commit 4cd1fc8b3559353069860eee90b1b5bade013917.
2020-08-14Fix links to Dig Methods document (#3421)Burdette Lamar
* Fix links to Dig Methods document * Fix links to Dig Methods document Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2020-08-13Adding doc/dig_methods.rdoc and links to it (#3416)Burdette Lamar
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. Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2020-07-30Extract version number from the sourceNobuyoshi Nakada
"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. Notes: Merged: https://github.com/ruby/ruby/pull/3375
2020-01-05Fix OpenStructDocumentationzverok
In https://github.com/ruby/ruby/commit/9be3295d53b6fd9f8a3ad8157aa0655b1976d8ac, OpenStruct's documentation stopped to be rendered by RDoc (there should be no additional code between documentation comment and documented class). Fixing this. Notes: Merged: https://github.com/ruby/ruby/pull/2810
2019-12-22[ruby/ostruct] Create OpenStruct::VERSIONMarc-Andre Lafortune
2019-05-10Removed old names of internal methodsNobuyoshi Nakada
2019-05-10Suppress a warning in Psych&YAML with verbose modeNobuyoshi Nakada
2019-04-14OpenStruct: improve error message when passing wrong number of arguments.marcandre
Patch by Lisa Ugray (issue #15515) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-22ostruct.rb: Accept block for to_h [#15451].marcandre
Patch by Shuji Kobayashi. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-07Support old versions of Ruby with FrozenError.hsbt
They should work separatedly from Ruby core repository. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26lib/ostruct: Remove unnecessary `__send__`marcandre
Patch by yuuji.yaginuma [Fix GH-1890] Since `remove_method` is public. Ref: https://bugs.ruby-lang.org/issues/14133 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-06lib/ostruct.rb: Use `FrozenError` instead of `RuntimeError`.marcandre
Patch by Yuuji Yaginuma. [Fixes GH-1808] In other classes, `FrozenError` will be raised if change the frozen object. In order to match the behavior, I think that `FrozenError` should use in `OpenStruct`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24lib/ostruct.rb: Use frozen literals.marcandre
Patch adapted from Espartaco Palma. [GH-1714] [Bug #14000] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-01ostruct.rb: improve fix for OpenStruct.allocate + #respond_to?eregon
* lib/ostruct.rb (OpenStruct#respond_to_missing?): this makes OpenStruct#respond_to? works on any OpenStruct instance, just like Kernel#respond_to? does, without workarounds. [ruby-core:80292] [Bug #13358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-28ostruct.rb: refine visibility failure messagenobu
* lib/ostruct.rb (method_missing): raise an exception with proper visibility message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-24ostruct.rb: fix OpenStruct.allocatenobu
* lib/ostruct.rb (OpenStruct.allocate): initialize an instance variable directly, without calling `intialize` method which may be overridden in a subclass. [ruby-core:80292] [Bug #13358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e