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

161 Коммитов

Автор SHA1 Сообщение Дата
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
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 #17371] 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 #16977]
2020-07-10 15:31:51 -07:00
Burdette Lamar 24739c62e5
[ci skip] Rdoc enhancements for Array (#3063)
* 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 #11304]
2020-03-06 13:06:49 -08:00
zverok 281b350058 Add pattern matching documentation
Add separate doc/syntax/pattern_matching.rdoc, add
link to control_expressions.rdoc.

The documentation is "reverse-engineered" from Ruby 2.7
behavior and early preview presentations, and corrected
by pattern-matching feature author @k-tsj.
2020-02-24 00:28:13 +09:00
Adam Isom 09271acdaf Update documentation for Array/Hash Argument section of methods.rdoc 2020-01-17 19:50:39 +09:00
Takashi Kokubun afd3f64f8c
Redmine /projects/ruby-trunk is now redirected
to /projects/ruby-master
2019-12-31 22:06:19 -08:00
Marcus Stollsteimer 66e518f7b3 [DOC] Fix typo 2019-12-24 13:01:24 +01:00
zverok a4b99f9764 Fix typos of previous docs PR
In #2612 I made two typos (extra ,, and copy-pasted
same line of code instead of showing two different
ones), fixing them.
2019-12-23 08:36:58 +09:00
zverok e568bb5649 Update private visibility explanation 2019-12-22 23:17:39 +09:00
Nobuyoshi Nakada db16629008
Fixed misspellings
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
2019-12-20 09:32:42 +09:00
zverok bddb31bb37 Documentation improvements for Ruby core
* Top-level `return`;
* Documentation for comments syntax;
* `rescue` inside blocks;
* Enhance `Object#to_enum` docs;
* Make `chomp:` option more obvious for `String#each_line` and
  `#lines`;
* Enhance `Proc#>>` and `#<<` docs;
* Enhance `Processs` class docs.
2019-10-26 14:58:08 +09:00
Jeremy Evans 29c1e9a0d4 Document the difference between expressions and statements [ci skip]
In the grammar, all expressions are statements, but not all
statements are expressions.  Some parts of the grammar accept
expressions and not other types of statements, which causes
similar looking code to parse differently due to operator
precedence.

Mostly from Dan0042 (Daniel DeLorme).

Fixes [Bug #16092]
2019-10-10 13:45:19 -07:00
Jeremy Evans c7715a4936 Add documentation regarding keyword argument separation [ci skip] 2019-10-03 14:13:27 -07:00