1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

171 commits

Author SHA1 Message Date
Jeremy Evans
4813443837 Fix language describing protected methods
Fixes [Bug ]
2022-07-14 13:28:58 -07:00
John Hawthorn
962a3247b1 Correct documentation for protected methods [ci skip] 2022-06-23 13:50:26 -07:00
Alexey Mostovoy
9f9a0940dd Quick markup fix 2022-05-12 07:53:46 +09:00
Nobuyoshi Nakada
5701b4084e
[DOC] mention assignment expression values 2022-04-25 23:50:49 +09:00
Burdette Lamar
d41bc9b68e
More details for Rational literals () 2022-04-24 19:41:26 -05:00
Burdette Lamar
01395d84ab
More details for regexp literals () 2022-04-14 14:25:06 -05:00
Nobuyoshi Nakada
e6c1db1d8a
[DOC] Refine flip-flop 2022-03-24 19:08:43 +09:00
Nobuyoshi Nakada
adca6f24b1
[DOC] Prefer the original file names over generated names
Should also the label in an explicit `rdoc-ref:` link be converted
in the future?
2022-02-09 15:31:10 +09:00
Jeremy Evans
f53dfab95c Add support for anonymous rest and keyword rest argument forwarding
This allows for the following syntax:

```ruby
def foo(*)
  bar(*)
end
def baz(**)
  quux(**)
end
```

This is a natural addition after the introduction of anonymous
block forwarding.  Anonymous rest and keyword rest arguments were
already supported in method parameters, this just allows them to
be used as arguments to other methods.  The same advantages of
anonymous block forwarding apply to rest and keyword rest argument
forwarding.

This has some minor changes to #parameters output.  Now, instead
of `[:rest], [:keyrest]`, you get `[:rest, :*], [:keyrest, :**]`.
These were already used for `...` forwarding, so I think it makes
it more consistent to include them in other cases.  If we want to
use `[:rest], [:keyrest]` in both cases, that is also possible.

I don't think the previous behavior of `[:rest], [:keyrest]` in
the non-... case and `[:rest, :*], [:keyrest, :**]` in the ...
case makes sense, but if we did want that behavior, we'll have to
make more substantial changes, such as using a different ID in the
... forwarding case.

Implements [Feature ]
2021-12-30 14:37:42 -08:00
Victor Shepelev
a0f10a973f
[DOC] Add documentation for hash value omission syntax 2021-12-20 01:09:52 +09:00
Burdette Lamar
0209beaca6
Enhanced RDoc for literals.rdoc ()
Makes link targets among percent literals.
    Adds links to those targets.
    Adds examples to percent literals.
    Links from opening summary list to corresponding sections.
2021-12-06 16:26:28 -06:00
Burdette Lamar
28fb6d6b9e
Adding links to literals and Kernel ()
* Adding links to literals and Kernel
2021-12-03 07:12:28 -06:00
Burdette Lamar
eac7c63538
Enhanced RDoc for numeric.c ()
Adds remarks about literals and Kernel methods to Float and Integer.
2021-11-27 13:07:37 -06:00
Jeremy Evans
4adb012926 Anonymous block forwarding allows a method to forward a passed
block to another method without having to provide a name for the
block parameter.

Implements [Feature ]

Co-authored-by: Yusuke Endoh mame@ruby-lang.org
Co-authored-by: Nobuyoshi Nakada nobu@ruby-lang.org
2021-11-18 14:17:57 -08:00
Peter Leitzen
09bdb43567 Clarify docs about magic comments placement
Magic comments like `frozen_string_literal` may appear everywhere
within the first comment section while `encoding` have to be the first
line, or second line after shebang.
2021-10-30 09:59:59 +09:00
Kazuki Tsujimoto
ecb6d6a4ef
Allow omission of parentheses in one line pattern matching [Feature ] 2021-08-19 17:07:58 +09:00
Kazuki Tsujimoto
eed5e8f796
One-line pattern matching is no longer experimental
https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20210715Japan.md#feature-17724-make-the-pin-operator-support-instanceclassglobal-variables-jeremyevans0
2021-07-17 11:13:52 +09:00
Jeremy Evans
fa87f72e1e Add pattern matching pin support for instance/class/global variables
Pin matching for local variables and constants is already supported,
and it is fairly simple to add support for these variable types.

Note that pin matching for method calls is still not supported
without wrapping in parentheses (pin expressions).  I think that's
for the best as method calls are far more complex (arguments/blocks).

Implements [Feature ]
2021-07-15 09:56:02 -07:00
Jeremy Evans
2e919e4a64 Remove extra word in heredoc documentation
From Thibault Jouan

Fixes [Misc ]
2021-05-20 12:24:41 -07:00
Jeremy Evans
ee1725cecb Update keyword argument description in method syntax guide
Remove discussion of Ruby 2.7 specific handling of keyword
argument separation.  Add a small example of keyword to
positional hash conversion for methods not accepting
keyword arguments.
2021-05-11 15:45:52 -07:00
wonda-tea-coffee
fc84e6679d [Doc] Fix a typo s/invokations/invocations/ 2021-04-25 19:45:01 +12:00
Kazuki Tsujimoto
21863470d9
Pattern matching pin operator against expression [Feature ]
This commit is based on the patch by @nobu.
2021-03-21 15:14:31 +09:00
Kenichi Kamiya
c7e6914b39 [Doc] Fix multiple Magic Comments example
[ci skip]
2021-03-13 15:44:34 +09:00
Marcus Stollsteimer
3fc53de5c9 methods.rdoc: Improve method definition documentation
* typos, grammar, formatting
* use `concrete_method` again in `regular_method` example,
  to better distinguish from `forwarding_method` example
* clarify that leading arguments before `...` require Ruby 3.0
2020-12-26 10:40:52 +01:00
Marcus Stollsteimer
ce65a7687f methods.rdoc: Clarify "currently" means "in 2.7" here 2020-12-26 10:40:47 +01:00
zverok
255ee4de8c Update method definition documentation
* Add endless methods
* Add argument forwarding ...
2020-12-25 22:10:09 +09:00
Nobuyoshi Nakada
aaf0474e76
Adjusted the heading level of "Block Arguments" [ci skip] 2020-12-25 22:09:22 +09:00
Marcus Stollsteimer
9f9a389d95 doc/syntax/pattern_matching.rdoc: fix typos, grammar, style 2020-12-24 11:35:03 +01:00
Marc-Andre Lafortune
8aa299de24 Tweak magic comments [doc] 2020-12-24 01:36:08 -05:00
Koichi Sasada
e43b5aa52d remove redundant example.
pointed by @marcandre.
2020-12-24 14:31:01 +09:00
Koichi Sasada
6f29716f9f shareable_constant_value: experimental_copy
"experimental_everything" makes the assigned value, it means
the assignment change the state of assigned value.
"experimental_copy" tries to make a deep copy and make copyied object
sharable.
2020-12-24 14:28:47 +09:00
Marcus Stollsteimer
458d5175b9 Small improvements in magic comments docs
* remove a duplicate statement
* fix rdoc markup
* fix typos
2020-12-23 19:47:26 +01:00
Marc-Andre Lafortune
8feb40f49a Document shareable_constant_value and other magic constants [doc] 2020-12-23 11:50:33 -05:00
Kazuki Tsujimoto
b222a1a494
Fix a message in example code
Thanks to @zverok for the report.
2020-12-23 02:37:27 +09:00
Kazuki Tsujimoto
5c0abe2d94
Update documentation for pattern matching 2020-12-22 02:08:57 +09:00
Kazuki Tsujimoto
85ec6cc387
Fix markups and indentation 2020-12-20 13:35:20 +09:00
Kazuki Tsujimoto
d37be18af5
Fix typos 2020-12-20 13:25:43 +09:00
Kazuki Tsujimoto
4902f96ee5
Update documentation for pattern matching 2020-12-20 13:22:53 +09:00
Kazuki Tsujimoto
88f3ce12d3
Reintroduce expr in pat [Feature ] 2020-12-13 11:51:49 +09:00
James Koenig
a67cd8a888 -> creates a lambda so this updates the documentation to reflect that 2020-11-30 20:11:18 -05:00
Kazuki Tsujimoto
b601532411
Pattern matching is no longer experimental 2020-11-01 13:33:58 +09:00
Victor Goff
1336698294 Respectively, instead of respentively 2020-10-12 13:08:13 +09:00
Nobuyoshi Nakada
dcb705ace7
doc/syntax/literals.rdoc: explain #@@foo too [ci skip] 2020-09-29 15:28:09 +09:00
Yusuke Endoh
2e947bc181 doc/syntax/literals.rdoc: explain #@foo and #$foo 2020-09-29 14:39:52 +09:00
Jeremy Evans
021cec938a Clarify behavior of super in method in module included in refinement [ci skip]
Fixes [Bug ]
2020-07-10 15:31:51 -07:00
Burdette Lamar
24739c62e5
[ci skip] Rdoc enhancements for Array ()
* Per @nobu review

* Rdoc enhancements for Array

* Responses to review
2020-05-15 14:12:40 -07:00
Kazuhiro NISHIYAMA
5257a53090
Removed NIL/TRUE/FALSE from documents too
This is follow up of 62554ca978
2020-04-17 17:40:57 +09:00
Kazuki Tsujimoto
cab9788e0c
Fix typos 2020-04-05 12:15:18 +09:00
zverok
33260d404f Enhance pattern matching introduction 2020-04-04 23:16:49 +09:00
Jeremy Evans
f991340e07 Document defined? and global_variables handling of regexp global variables [ci skip]
Fixes [Bug ]
2020-03-06 13:06:49 -08:00