ruby-next 0.13.3 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +44 -0
- data/README.md +65 -5
- metadata +6 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b0e47ba44b062642c2fe2859bfc46eea20edf4a060d1af872ed4c0ea1519d5b
|
4
|
+
data.tar.gz: 230c9f3fa559e841c188be97ea16dc58edce00de409973ea507cf225962ede5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1145cbe7b4afa3ab6d823d59c7391a126b28741f916ae87246406f7779caee3b271e65f1b0d61715d193e57daa7ef7ebbe1539f07b3c6d76757a429cfd0aa27
|
7
|
+
data.tar.gz: 16731c47cd9c169994beda5fd108631db60d9b7e5e25e5f783c9d407790b69dbc9a7f60b487f79a53b540724d94b086c4c2289f18d66fe00a8732a143454eec2
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,50 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.15.0 (2022-03-21)
|
6
|
+
|
7
|
+
- Support IRB ([@palkan][])
|
8
|
+
|
9
|
+
- Create empty `.rbnext` folder during `nextify` if nothing to transpile. ([@palkan][])
|
10
|
+
|
11
|
+
This would prevent from auto-transpiling a library every time when no files should be transpiled.
|
12
|
+
|
13
|
+
- Auto-transpile using the current Ruby version. ([@palkan][])
|
14
|
+
|
15
|
+
- Support Pry. ([@baygeldin][])
|
16
|
+
|
17
|
+
- Add `rescue/ensure/else` within block rewriter for Ruby < 2.5. ([@fargelus][])
|
18
|
+
|
19
|
+
## 0.14.1 (2022-01-21)
|
20
|
+
|
21
|
+
- Fix nested find patterns transpiling. ([@palkan][])
|
22
|
+
|
23
|
+
## 0.14.0 🎄
|
24
|
+
|
25
|
+
- Add `Integer.try_convert`. ([@palkan][])
|
26
|
+
|
27
|
+
- Add `Enumerable#compact`, `Enumerator::Lazy#compact`. ([@palkan][])
|
28
|
+
|
29
|
+
- [Proposed] Add support for binding instance, class, global variables in pattern matching. ([@palkan][])
|
30
|
+
|
31
|
+
This brings back rightward assignment: `42 => @v`.
|
32
|
+
|
33
|
+
- Add `MatchData#match`. ([@palkan][])
|
34
|
+
|
35
|
+
- Add support for command syntax in endless methods (`def foo() = puts "bar"`)
|
36
|
+
|
37
|
+
- Add `Refinement#import_methods` support. ([@palkan][])
|
38
|
+
|
39
|
+
This API only works in conjunction with transpiling, since it couldn't be backported purely as a method and requires passing an additional argument (Binding).
|
40
|
+
|
41
|
+
You can find the details in [the PR](https://github.com/ruby-next/ruby-next/pull/85).
|
42
|
+
|
43
|
+
- Added support for instance, class and global variables and expressions for pin operator. ([@palkan][])
|
44
|
+
|
45
|
+
- Support omitting parentheses in one-line pattern matching. ([@palkan][])
|
46
|
+
|
47
|
+
- Anonymous blocks `def b(&); c(&); end` ([@palkan][]).
|
48
|
+
|
5
49
|
## 0.13.3 (2021-12-08)
|
6
50
|
|
7
51
|
- Revert 0.13.2 and freeze Parser version. ([@skryukov][])
|
data/README.md
CHANGED
@@ -71,8 +71,11 @@ _Please, submit a PR to add your project to the list!_
|
|
71
71
|
- [`ruby -ruby-next`](#uby-next)
|
72
72
|
- [Logging & Debugging](#logging-and-debugging)
|
73
73
|
- [RuboCop](#rubocop)
|
74
|
+
- [Using with IRB](#irb)
|
75
|
+
- [Using with Pry](#pry)
|
74
76
|
- [Using with EOL Rubies](#using-with-eol-rubies)
|
75
77
|
- [Proposed & edge features](#proposed-and-edge-features)
|
78
|
+
- [Known limitations](#known-limitations)
|
76
79
|
|
77
80
|
## Overview
|
78
81
|
|
@@ -200,8 +203,6 @@ You can change the transpiler mode:
|
|
200
203
|
- Via environmental variable `RUBY_NEXT_TRANSPILE_MODE=ast`.
|
201
204
|
- Via CLI option ([see below](#cli)).
|
202
205
|
|
203
|
-
**NOTE:** For the time being, Unparser doesn't support Ruby 3.0 AST nodes, so we always use rewrite mode in Ruby 3.0+.
|
204
|
-
|
205
206
|
## CLI
|
206
207
|
|
207
208
|
Ruby Next ships with the command-line interface (`ruby-next`) which provides the following functionality:
|
@@ -231,7 +232,7 @@ Usage: ruby-next nextify DIRECTORY_OR_FILE [options]
|
|
231
232
|
|
232
233
|
The behaviour depends on whether you transpile a single file or a directory:
|
233
234
|
|
234
|
-
- When transpiling a directory, the `.rbnext` subfolder is created within the target folder with subfolders for each supported Ruby versions (e.g., `.rbnext/2.6`, `.rbnext/2.7`, `.rbnext/3.0
|
235
|
+
- When transpiling a directory, the `.rbnext` subfolder is created within the target folder with subfolders for each supported Ruby versions (e.g., `.rbnext/2.6`, `.rbnext/2.7`, `.rbnext/3.0`, etc.). If you want to create only a single version (the smallest), you can also pass `--single-version` flag. In that case, no version directory is created (i.e., transpiled files go into `.rbnext`).
|
235
236
|
|
236
237
|
- When transpiling a file and providing the output path as a _file_ path, only a single version is created. For example:
|
237
238
|
|
@@ -283,6 +284,8 @@ $ ruby-next core_ext -l --name=filter --name=deconstruct
|
|
283
284
|
- EnumeratorLazyFilterMap
|
284
285
|
- HashDeconstructKeys
|
285
286
|
- StructDeconstruct
|
287
|
+
|
288
|
+
...
|
286
289
|
```
|
287
290
|
|
288
291
|
### CLI configuration file
|
@@ -453,6 +456,38 @@ AllCops:
|
|
453
456
|
|
454
457
|
**NOTE:** you need `ruby-next` gem available in the environment where you run RuboCop (having `ruby-next-core` is not enough).
|
455
458
|
|
459
|
+
## IRB
|
460
|
+
|
461
|
+
Ruby Next supports IRB. In order to enable edge Ruby features for your REPL, add the following line to your `.irbrc`:
|
462
|
+
|
463
|
+
```ruby
|
464
|
+
require "ruby-next/irb"
|
465
|
+
```
|
466
|
+
|
467
|
+
Alternatively, you can require it at startup:
|
468
|
+
|
469
|
+
```sh
|
470
|
+
irb -r ruby-next/irb
|
471
|
+
# or
|
472
|
+
irb -ruby-next/irb
|
473
|
+
```
|
474
|
+
|
475
|
+
## Pry
|
476
|
+
|
477
|
+
Ruby Next supports Pry. In order to enable edge Ruby features for your REPL, add the following line to your `.pryrc`:
|
478
|
+
|
479
|
+
```ruby
|
480
|
+
require "ruby-next/pry"
|
481
|
+
```
|
482
|
+
|
483
|
+
Alternatively, you can require it at startup:
|
484
|
+
|
485
|
+
```sh
|
486
|
+
pry -r ruby-next/pry
|
487
|
+
# or
|
488
|
+
pry -ruby-next/pry
|
489
|
+
```
|
490
|
+
|
456
491
|
## Using with EOL Rubies
|
457
492
|
|
458
493
|
We currently provide support for Ruby 2.2, 2.3 and 2.4.
|
@@ -522,13 +557,38 @@ require "ruby-next/language/runtime"
|
|
522
557
|
|
523
558
|
### Supported edge features
|
524
559
|
|
525
|
-
|
560
|
+
It's too early, Ruby 3.1 has just been released. See its features in the [supported features list](./SUPPORTED_FEATURES.md).
|
526
561
|
|
527
562
|
### Supported proposed features
|
528
563
|
|
529
564
|
- _Method reference_ operator (`.:`) ([#13581](https://bugs.ruby-lang.org/issues/13581)).
|
565
|
+
- Binding non-local variables in pattern matching (`42 => @v`) ([#18408](https://bugs.ruby-lang.org/issues/18408)).
|
566
|
+
|
567
|
+
## Known limitations
|
568
|
+
|
569
|
+
Ruby Next aims to be _reasonably compatible_ with MRI. That means, some edge cases could be uncovered. Below is the list of known limitations.
|
570
|
+
|
571
|
+
For gem authors, we recommend testing against all supported versions on CI to make sure you're not hit by edge cases.
|
572
|
+
|
573
|
+
### Enumerable methods
|
574
|
+
|
575
|
+
Using refinements (`using RubyNext`) for modules could lead to unexpected behaviour in case there is also a `prepend` for the same module in Ruby <2.7.
|
576
|
+
To eliminate this, we also refine Array (when appropriate), but other enumerables could be affected.
|
577
|
+
|
578
|
+
See [this issue](https://bugs.ruby-lang.org/issues/13446) for details.
|
579
|
+
|
580
|
+
### `Refinement#import_methods`
|
581
|
+
|
582
|
+
- Doesn't support importing methods generated with `eval`.
|
583
|
+
- Doesn't support aliases (both `alias` and `alias_method`).
|
584
|
+
- In JRuby, importing attribute accessors/readers/writers is not supported.
|
585
|
+
- When using AST transpiling in runtime, likely fails to import methods from a transpiled files (due to the updated source location).
|
586
|
+
|
587
|
+
See the [original PR](https://github.com/ruby-next/ruby-next/pull/85) for more details.
|
588
|
+
|
589
|
+
### Other
|
530
590
|
|
531
|
-
|
591
|
+
See [Parser's known issues](https://github.com/whitequark/parser#known-issues).
|
532
592
|
|
533
593
|
## Contributing
|
534
594
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-next
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-next-core
|
@@ -16,34 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.15.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.15.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ruby-next-parser
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
34
|
-
- - "<"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 3.1.0.0
|
33
|
+
version: 3.1.1.0
|
37
34
|
type: :runtime
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
40
37
|
requirements:
|
41
38
|
- - ">="
|
42
39
|
- !ruby/object:Gem::Version
|
43
|
-
version: 3.
|
44
|
-
- - "<"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 3.1.0.0
|
40
|
+
version: 3.1.1.0
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: unparser
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,20 +52,6 @@ dependencies:
|
|
58
52
|
- - "~>"
|
59
53
|
- !ruby/object:Gem::Version
|
60
54
|
version: 0.6.0
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: parser
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "<"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: 3.0.3.0
|
68
|
-
type: :runtime
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "<"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 3.0.3.0
|
75
55
|
description: "\n Ruby Next is a collection of polyfills and a transpiler for supporting
|
76
56
|
latest and upcoming edge CRuby features\n in older versions and alternative implementations
|
77
57
|
(such as mruby, JRuby, Opal, Artichoke, RubyMotion, etc.).\n "
|