203 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
e9593eb967
[DOC] Fix an error example
`%q{c}` after another string literal is parsed as RHS of modulo, `q`
method call with a block.
2025-01-07 09:56:54 +09:00
Earlopain
89c505dc47 Move string escape sequence documention further down
If someone looks at documention for strings,
I don't think escape sequences is what they look
for in majority of the cases.
2025-01-07 07:56:48 +09:00
Earlopain
b0d291ec83 Fix link to strings in literals.rdoc
Since 5e1001f754, the string link is broken

Instead of changing the anchor reference, I changed the header directly,
to keep in line with other titles
2025-01-07 07:56:48 +09:00
Nobuyoshi Nakada
b4ec22fe6c
[DOC] Exclude 'Method' from RDoc's autolinking 2025-01-02 12:23:49 +09:00
ydah
b8fe5550e7 s/backslashs/backslashes/ 2024-12-22 18:09:02 +09:00
tomoya ishida
477c505ac0
[DOC] Fix output examples containing old Hash#inspect format
The inspect format was intentionally changed as an outcome of
[Bug #20433] [ruby-core:118668], but some documentation update
was missing, as [Bug #20962] pointed out. Update some output
examples that clearly use Hash#inspect.
2024-12-18 12:08:15 -05:00
Victor Shepelev
1ac28224e0
[DOC] Adjust argument unpacking docs and document **nil (#12228)
[DOC] Rewrite argument unpacking docs and document **nil
2024-12-15 21:53:39 +02:00
Nobuyoshi Nakada
1fd2437b63
[DOC] Move the comma outside the <tt> tag 2024-12-13 11:59:58 +09:00
masatoshi_moritsuka
6b46060fc2 doc: Remove description of experimental warnings related pattern matching from documentation
Ruby 3.2.0 has been released and all experimental warnings about pattern matching have been removed.
Experimental warnings about pattern matching are no longer output, so I remove description about it from documentation as well.

cf. https://bugs.ruby-lang.org/issues/18585
cf. db6b23c76cbc7888cd9a9912790c2068703afdd0
cf. https://twitter.com/k_tsj/status/1606956336037900289?s=20&t=-_PSYLhYPtYsB9FZhtXl5A
2024-09-25 07:06:42 +09:00
BurdetteLamar
07a0aa9be6 [DOC] Fix link 2024-09-10 14:07:04 -04:00
Burdette Lamar
f5579c9278
[DOC] Include keywords.rdoc in doc/syntax/ (#11414) 2024-08-21 12:06:48 -04:00
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