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

192 Коммитов

Автор SHA1 Сообщение Дата
Tanaka Akira 5e1001f754 [DOC] document line continuation.
Document details of escape sequences including line continuation.

[Bug #20518]
2024-06-07 21:55:42 +09:00
Tanaka Akira 61af722d4e fix typos. 2024-06-03 14:37:32 +09:00
Tanaka Akira ca2170e69f [DOC] percent literals can be nested. 2024-06-03 12:24:55 +09:00
Nobuyoshi Nakada b911d2222f
[Bug #20482] [DOC] Clarify about pattern maching guard clause
Guard clauses can only be used in `case` pattern matching statements,
not in `=>`/`in` operators.
2024-05-12 16:23:00 +09:00
crazeteam b2b665eba5 [DOC] remove repetitive words in comments
Signed-off-by: crazeteam <lilujing@outlook.com>
2024-03-27 07:52:18 +09:00
Pierre Merlin ec4333c970
[DOC] exceptions.rdoc : Add heads up about ensure not returning implicitly
There is a weird gotcha I already forgot twice.... and regret not to have found in doc.
See https://dev.to/okuramasafumi/be-sure-ensure-doesn-t-return-value-implicitly-8gp
2024-03-15 22:23:50 +09:00
ydah 926277bf82 s/ therefor/therefore/ 2024-02-15 17:01:02 +09:00
Peter Zhu be92bf4ff4 [DOC] Fix == and === in control_expressions.rdoc 2023-12-26 17:32:38 -05:00
Nobuyoshi Nakada c452fe17ac
[Bug #20087] [DOC] Uninitialized instance variable is not warned now 2023-12-27 01:10:30 +09:00
Hiroshi SHIBATA c903cddf55
Typofix under doc directory 2023-12-25 11:17:51 +09:00
Doug Orleans 1822acdf33 [DOC] remove reference to pre-3.0 splat operator behavior 2023-12-19 22:11:11 +09:00
Kouhei Yanagita b84e6fe93e
[DOC] Mention the omission of a superclass when reopening a class 2023-10-22 20:12:16 +09:00
Nicholas Browning 53a373078d doc: initial operators commit
docs: expand on operator documentaion

Include more specific details around logical operators.

doc: update link with proper syntax

doc: remove ambiguous language from operators doc

doc: remove link to source code file

doc: cleaning up some language, and removing some mistakes in understanding

doc: revert example to prior state

doc: fix spacing

doc: Update doc/syntax/operators.rdoc

align example with typical format

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

doc: Update doc/syntax/operators.rdoc

align format of other examples with rest of documentation

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

Update doc/syntax/operators.rdoc

align format of other examples with rest of documentation

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

doc: include `and` & `or` operators

doc(operators): remove accute language
2023-09-20 23:52:52 +09:00
Ivanov-Anton b89b7d8fdc
[DOC] Fix a magic comment in the section for `experimental_copy` 2023-07-18 19:23:27 +09:00
Jemma Issroff 1272865a8e
Fix broken wiki links (#8002)
Since [Misc #19679] migrated the wiki, these links should be updated
to their new locations.
2023-06-29 17:00:40 -04:00
Burdette Lamar 932dd9f10e
[DOC] Regexp doc (#7923) 2023-06-20 09:28:21 -04:00
Jeremy Evans 618a04d211
Document throw/catch in the control expressions document [ci skip]
This are implemented as Kernel methods and not keywords, but I
still think they are worth documenting with the other control
flow expressions.
2023-05-26 07:58:40 -07:00
Nobuyoshi Nakada e7342e76df
[Bug #19485] [DOC] Mention tabs in indentation of heredoc identifier
Co-Authored-By: sawa (Tsuyoshi Sawada) <sawadatsuyoshi@gmail.com>
2023-03-19 18:10:55 +09:00
zverok ce0f3de032 [DOC] Update pattern matching docs for 3.2
* Remove section about experimental status
* Add references to core objects that can deconstruct
2023-02-19 22:32:52 +02:00
Kouhei Yanagita 619af4fd64
[DOC] Add an example of the splat operator with a non-array object (#7098) 2023-02-15 12:43:55 +09:00
Talal Al-Humaidi 93bb415516
[DOC] Change local method to local variable in assignment docs 2023-01-23 11:48:44 +09:00
Jeremy Evans 4813443837 Fix language describing protected methods
Fixes [Bug #18887]
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 (#5840) 2022-04-24 19:41:26 -05:00
Burdette Lamar 01395d84ab
More details for regexp literals (#5800) 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 #18351]
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 (#5213)
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 (#5192)
* Adding links to literals and Kernel
2021-12-03 07:12:28 -06:00
Burdette Lamar eac7c63538
Enhanced RDoc for numeric.c (#5184)
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 #11256]

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 #16182] 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 #17724]
2021-07-15 09:56:02 -07:00
Jeremy Evans 2e919e4a64 Remove extra word in heredoc documentation
From Thibault Jouan

Fixes [Misc #17872]
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 #17411]
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