ruby-next 0.13.1 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -0
  3. data/README.md +31 -5
  4. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74856c7d76c7b984be4c36394d1a43067acbaf6a79a0e126748782952faa833c
4
- data.tar.gz: 8208beedd5fe90a057805743eb49e787eae5ffa47aaba90a3cefbeb69c858e23
3
+ metadata.gz: e7556a69e35b372fca28871d14d2282b0eaa46d6426cbc7edc0cf6234212e15b
4
+ data.tar.gz: de3bc4fd558d1f784a4869dc438f486d284a4cfa92cb390cf11251efa6993b82
5
5
  SHA512:
6
- metadata.gz: 5eda4f80af5d5c7e91c3f8af3ec1fef71ec2fabcd38b1025e906263a1a016bd92d806502982eb49adf6dc042e49250ae434b1984e261a80a6814ff25dec64e6b
7
- data.tar.gz: ab0e64fc7e39c26fa7a695e06c6c232689b26bb6273f538f81883627ac85c7728da46cdc5b8f3b0489b9babe89fe8c66bf8b15b91c7b42742a71ae55858a4bec
6
+ metadata.gz: ef72bad3d3f90c5068b011bfdc0889f4f522c4f171656f9860fc5503deaa238f42e0c51913de166ab73cedf4b119699615ac4a2a9658fcdcbc52f9653ed74199
7
+ data.tar.gz: e9d56f824694173d8747fa7cd7dcc366399c21765516b6109db35fd4dda9e5056b2239da034c7524af2e715a1589649d867ad719c575a6e85ec14174be906a7d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,46 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.14.1 (2022-01-21)
6
+
7
+ - Fix nested find patterns transpiling. ([@palkan][])
8
+
9
+ ## 0.14.0 🎄
10
+
11
+ - Add `Integer.try_convert`. ([@palkan][])
12
+
13
+ - Add `Enumerable#compact`, `Enumerator::Lazy#compact`. ([@palkan][])
14
+
15
+ - [Proposed] Add support for binding instance, class, global variables in pattern matching. ([@palkan][])
16
+
17
+ This brings back rightward assignment: `42 => @v`.
18
+
19
+ - Add `MatchData#match`. ([@palkan][])
20
+
21
+ - Add support for command syntax in endless methods (`def foo() = puts "bar"`)
22
+
23
+ - Add `Refinement#import_methods` support. ([@palkan][])
24
+
25
+ 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).
26
+
27
+ You can find the details in [the PR](https://github.com/ruby-next/ruby-next/pull/85).
28
+
29
+ - Added support for instance, class and global variables and expressions for pin operator. ([@palkan][])
30
+
31
+ - Support omitting parentheses in one-line pattern matching. ([@palkan][])
32
+
33
+ - Anonymous blocks `def b(&); c(&); end` ([@palkan][]).
34
+
35
+ ## 0.13.3 (2021-12-08)
36
+
37
+ - Revert 0.13.2 and freeze Parser version. ([@skryukov][])
38
+
39
+ Postpone upgrade 'till v0.14 due to breaking shorthand hash changes.
40
+
41
+ ## 0.13.2 (2021-11-28)
42
+
43
+ - Parser upgrade.
44
+
5
45
  ## 0.13.1 (2021-09-27)
6
46
 
7
47
  - Fix checking for realpath during $LOAD_PATH setup. ([@palkan][])
data/README.md CHANGED
@@ -73,6 +73,7 @@ _Please, submit a PR to add your project to the list!_
73
73
  - [RuboCop](#rubocop)
74
74
  - [Using with EOL Rubies](#using-with-eol-rubies)
75
75
  - [Proposed & edge features](#proposed-and-edge-features)
76
+ - [Known limitations](#known-limitations)
76
77
 
77
78
  ## Overview
78
79
 
@@ -200,8 +201,6 @@ You can change the transpiler mode:
200
201
  - Via environmental variable `RUBY_NEXT_TRANSPILE_MODE=ast`.
201
202
  - Via CLI option ([see below](#cli)).
202
203
 
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
204
  ## CLI
206
205
 
207
206
  Ruby Next ships with the command-line interface (`ruby-next`) which provides the following functionality:
@@ -231,7 +230,7 @@ Usage: ruby-next nextify DIRECTORY_OR_FILE [options]
231
230
 
232
231
  The behaviour depends on whether you transpile a single file or a directory:
233
232
 
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`). 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`).
233
+ - 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
234
 
236
235
  - When transpiling a file and providing the output path as a _file_ path, only a single version is created. For example:
237
236
 
@@ -283,6 +282,8 @@ $ ruby-next core_ext -l --name=filter --name=deconstruct
283
282
  - EnumeratorLazyFilterMap
284
283
  - HashDeconstructKeys
285
284
  - StructDeconstruct
285
+
286
+ ...
286
287
  ```
287
288
 
288
289
  ### CLI configuration file
@@ -522,13 +523,38 @@ require "ruby-next/language/runtime"
522
523
 
523
524
  ### Supported edge features
524
525
 
525
- `Array#intersect?` ([#15198](https://bugs.ruby-lang.org/issues/15198))
526
+ It's too early, Ruby 3.1 has just been released. See its features in the [supported features list](./SUPPORTED_FEATURES.md).
526
527
 
527
528
  ### Supported proposed features
528
529
 
529
530
  - _Method reference_ operator (`.:`) ([#13581](https://bugs.ruby-lang.org/issues/13581)).
531
+ - Binding non-local variables in pattern matching (`42 => @v`) ([#18408](https://bugs.ruby-lang.org/issues/18408)).
532
+
533
+ ## Known limitations
534
+
535
+ Ruby Next aims to be _reasonably compatible_ with MRI. That means, some edge cases could be uncovered. Below is the list of known limitations.
536
+
537
+ For gem authors, we recommend testing against all supported versions on CI to make sure you're not hit by edge cases.
538
+
539
+ ### Enumerable methods
540
+
541
+ 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.
542
+ To eliminate this, we also refine Array (when appropriate), but other enumerables could be affected.
543
+
544
+ See [this issue](https://bugs.ruby-lang.org/issues/13446) for details.
545
+
546
+ ### `Refinement#import_methods`
547
+
548
+ - Doesn't support importing methods generated with `eval`.
549
+ - Doesn't support aliases (both `alias` and `alias_method`).
550
+ - In JRuby, importing attribute accessors/readers/writers is not supported.
551
+ - When using AST transpiling in runtime, likely fails to import methods from a transpiled files (due to the updated source location).
552
+
553
+ See the [original PR](https://github.com/ruby-next/ruby-next/pull/85) for more details.
554
+
555
+ ### Other
530
556
 
531
- - Shorthand Hash/kwarg notation (`data = {x, y}` or `foo(x:, y:)`) ([#15236](https://bugs.ruby-lang.org/issues/15236)).
557
+ See [Parser's known issues](https://github.com/whitequark/parser#known-issues).
532
558
 
533
559
  ## Contributing
534
560
 
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.13.1
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-27 00:00:00.000000000 Z
11
+ date: 2022-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-next-core
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.13.1
19
+ version: 0.14.1
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.13.1
26
+ version: 0.14.1
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.0.0.3
33
+ version: 3.1.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 3.0.0.3
40
+ version: 3.1.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: unparser
43
43
  requirement: !ruby/object:Gem::Requirement