Граф коммитов

116 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada ca7de49aa5 [ruby/ostruct] [DOC] Fix code markups [ci skip]
Backquotes are not special characters in RDoc.

https://github.com/ruby/ostruct/commit/a901df26b9
2021-11-28 17:10:48 +09:00
Hiroshi SHIBATA 422b057d65 [ruby/ostruct] Bump up ostruct version to 0.5.0
https://github.com/ruby/ostruct/commit/c535a406f8
2021-10-21 20:54:33 +09:00
Nobuyoshi Nakada 8bdaaeb99a [ruby/ostruct] Strip trailing spaces
https://github.com/ruby/ostruct/commit/df1109c18f
2021-09-28 20:01:35 +09:00
rm155 cefa029573 [ruby/ostruct] Allow properties to be accessed even when the object is moved to another Ractor (https://github.com/ruby/ostruct/pull/29)
https://github.com/ruby/ostruct/commit/d85639f2f5
2021-09-28 17:30:06 +09:00
Nobuyoshi Nakada a27c274f04
[DOC] Fix broken links [ci skip]
* As the "doc/" prefix is specified by the `--page-dir` option,
  remove from the rdoc references.
* Refer to the original .rdoc instead of the converted .html.
2021-09-15 14:16:14 +09:00
Marc-Andre Lafortune f0818982e9 [ruby/ostruct] v0.4.0
https://github.com/ruby/ostruct/commit/8534f69e4e
2021-06-15 12:04:05 +09:00
Marc-Andre Lafortune 52369fc545 [lib/ostruct] Allow overriding of `block_given?` 2021-06-14 12:28:53 -04:00
Nobuyoshi Nakada 5dde13e5ce [ruby/ostruct] bump up
https://github.com/ruby/ostruct/commit/bb253be3e9
2021-06-14 23:31:49 +09:00
jfrazx 931ea7cfbe
Add fallback block to `OpenStruct#delete_field` (#1409) 2021-06-14 09:53:20 -04:00
Marc-Andre Lafortune 7f1323c3bd
[ruby/ostruct] Add compatibility for to_h with block in Ruby 2.5
https://github.com/ruby/ostruct/commit/da45de5068
2021-04-28 17:48:05 +09:00
Marc-Andre Lafortune 37b445eaeb [ruby/ostruct] Compatibility with Ruby 2.5
https://github.com/ruby/ostruct/commit/ecd9fafdf8
2021-04-28 17:33:59 +09:00
Marc-Andre Lafortune 30a35420e6 [ruby/ostruct] Bump version 2021-01-13 01:09:29 -05:00
Marc-Andre Lafortune f48edc28dd Fix method protection for modules in the ancestry chain.
[Fixes ruby/ostruct#23]
2021-01-12 23:29:39 -05:00
Marc-Andre Lafortune a0a6293e78 [ruby/ostruct] Bump version 2021-01-05 18:35:56 -05:00
Adam Hess e13f41e02d
[ruby/ostruct] Allow ostruct to return a value on super (#4028)
This fixes cases where you can super in something that inherits from OpenStruct

Co-authored-by: John Hawthorn <john@hawthorn.email>
2021-01-05 18:34:45 -05:00
Marc-Andre Lafortune 2aa9a50dcc [ruby/ostruct] Update version 2020-11-04 17:52:03 -05:00
Marc-Andre Lafortune 015b023820 [ruby/ostruct] Restore `ostruct` doc 2020-11-04 17:52:03 -05:00
Marc-Andre Lafortune 6f24be8565 Revert "Make `marshal_load` public"
This reverts commit ee7cc6ac35.

I'm not sure I agree with the spec, but I just tweaked it.
2020-11-04 17:52:03 -05:00
Nobuyoshi Nakada 3198e7abd7
Separate `send` into `public_send` and `__send__` 2020-10-27 16:12:45 +09:00
Aaron Patterson ee7cc6ac35
Make `marshal_load` public
Ruby specs expected this method to be public
2020-10-06 15:13:49 -07:00
Marc-Andre Lafortune 1486785a57 [lib/ostruct] Fix Marshal loading 2020-10-06 17:11:08 -04:00
Marc-Andre Lafortune bb2ba72c3b [ruby/ostruct] Tweak doc 2020-09-30 18:11:24 -04:00
Marc-Andre Lafortune 152ba86b6b [ruby/ostruct] Remove unused condition 2020-09-30 18:11:24 -04:00
Marc-Andre Lafortune b36a45c05c [ruby/ostruct] Improved YAML serialization.
Patch adapted from Pietro Monteiro [Fixes bug#8382]
2020-09-30 18:11:24 -04:00
Marc-Andre Lafortune 0977040133 [ruby/ostruct] Add test that frozen OpenStructs are Ractor-shareable 2020-09-30 18:11:24 -04:00
Marc-Andre Lafortune 083fa6e5d2 [ruby/ostruct] Protect subclass' methods and our bang methods.
Internally, use only bang methods
2020-09-30 18:11:24 -04:00
Marc-Andre Lafortune df4d08c44a [ruby/ostruct] Avoid calling initialize 2020-09-30 18:11:24 -04:00
Marc-Andre Lafortune 60f5d38482 [ruby/ostruct] Fix dup/clone 2020-09-14 16:10:37 -04:00
Marc-Andre Lafortune 125605abd9 [ruby/ostruct] method_missing is private 2020-09-14 16:10:37 -04:00
Marc-Andre Lafortune 606c009ce2 [ruby/ostruct] Avoid self calling our public methods.
Found because `json` has a bad example in its test suite.
This implementation still offers better encapsulation.
2020-09-14 16:10:37 -04:00
Marc-Andre Lafortune 67e5f7a9e5 [ruby/ostruct] Reinstate recent changes
This reverts commit 28e60b0045.
2020-09-14 16:10:37 -04:00
Marc-Andre Lafortune 28e60b0045 [ruby/ostruct] Revert recent changes
This reverts commit e026e186f4..12a2e32d43.
2020-09-14 13:29:54 -04:00
Marc-Andre Lafortune 12a2e32d43 [ruby/ostruct] Add access to public instance methods in case they are overriden 2020-09-14 12:46:51 -04:00
Marc-Andre Lafortune 12a13eef49 [ruby/ostruct] Tweak doc 2020-09-14 12:46:49 -04:00
Marc-Andre Lafortune 8eefa8f373 [ruby/ostruct] Allow overriding public methods
[Fixes https://bugs.ruby-lang.org/issues/15409]
2020-09-14 12:46:47 -04:00
Marc-Andre Lafortune ebb8de7302 [ruby/ostruct] Refactor handling of frozen OpenStruct. Simplify `new_ostruct_member!` 2020-09-14 12:46:45 -04:00
Marc-Andre Lafortune e026e186f4 [ruby/ostruct] Revert "ostruct.rb: deferred accessors"
This reverts commits:
dc38e99813
22c082fcfd
b499e0f9ff
58e5876646

Add test for overriden private methods

[Fixes https://bugs.ruby-lang.org/issues/12136]
2020-09-14 12:46:27 -04:00
Marc-Andre Lafortune fbaab562d9 lib/ostruct.rb: Revert "To use RuntimeError instead of FrozenError for old ruby versions."
This reverts commit 4cd1fc8b3559353069860eee90b1b5bade013917.
2020-09-04 01:23:14 -04:00
Burdette Lamar c84ccf1a07
Fix links to Dig Methods document (#3421)
* Fix links to Dig Methods document

* Fix links to Dig Methods document
2020-08-14 18:55:04 -05:00
Burdette Lamar 22fd617aa5
Adding doc/dig_methods.rdoc and links to it (#3416)
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.
2020-08-13 13:16:27 -05:00
Nobuyoshi Nakada b2d96abb42 Extract version number from the source
"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.
2020-07-30 19:03:18 +09:00
zverok 54fd50c951 Fix OpenStructDocumentation
In 9be3295d53,
OpenStruct's documentation stopped to be rendered by RDoc
(there should be no additional code between documentation
comment and documented class). Fixing this.
2020-01-05 14:35:14 +09:00
Marc-Andre Lafortune 9be3295d53 [ruby/ostruct] Create OpenStruct::VERSION 2019-12-22 21:48:54 -05:00
Nobuyoshi Nakada dbcc224f38
Removed old names of internal methods 2019-05-10 14:13:17 +09:00
Nobuyoshi Nakada a7b68e63c5
Suppress a warning in Psych&YAML with verbose mode 2019-05-10 14:12:51 +09:00
marcandre 816c5323fe OpenStruct: improve error message when passing wrong number of arguments.
Patch by Lisa Ugray (issue #15515)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14 13:47:24 +00:00
marcandre 1e30df6f77 ostruct.rb: Accept block for to_h [#15451].
Patch by Shuji Kobayashi.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-22 17:05:03 +00:00
hsbt 1380aa04a6 Support old versions of Ruby with FrozenError.
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-08-07 12:47:11 +00:00
marcandre 5219adf4f1 lib/ostruct: Remove unnecessary `__send__`
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-07-26 18:46:10 +00:00
marcandre b16eaf8632 lib/ostruct.rb: Use `FrozenError` instead of `RuntimeError`.
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
2018-02-06 23:52:30 +00:00