ruby-next 0.13.3 → 0.14.0

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 +26 -0
  3. data/README.md +31 -5
  4. metadata +6 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcf5d21d885266f5a03a0568d3759d3aa2dc14e7a787fce60ed5ee2a9e31e32d
4
- data.tar.gz: '082bbdb7dd58f4ae65f101ad2f9c7ef88f3a8aaa4b404ed6e3997b09ad892df1'
3
+ metadata.gz: 83cba15364cdf7a70449a2516549ba4d824fb06cdfdb6a49add645ab5ce6cc7a
4
+ data.tar.gz: fc131a17d022a4fd367ad58eda5e8a4c0eaf49cbd122a1151cd4bb72a3462406
5
5
  SHA512:
6
- metadata.gz: 1826875405dd0611fbc51fb2f69402672a3bfafadbd3236fe7101254aad7a9346197905558c01fffc1eb14546f152af6e3d18ceb133ae4250caa37111453bf56
7
- data.tar.gz: 928a7f5bb8cbb8cafb1ef2e013ad8cedd6e7dcda806d12eb56b8a8ac8b04f25cf71efd4362e2c3df6f2f3aff77c48ae4ab43baa84a3543703880c4105483f948
6
+ metadata.gz: 8cebc2b5299b23a16ba5f303219b32ce5d90d9636778220ef6254a1743122b433ce57da1f887daaa1b90f78184c59df8c8684ef1656d26031057e6b492071c03
7
+ data.tar.gz: 5e98223fa663a2bca82819e6cb9275ead0c7ff2709fb2c49c050203b8441226d03acba611ef5c530f2aae44d996338f311db987b9ab31ea50b7843434e535361
data/CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.14.0 🎄
6
+
7
+ - Add `Integer.try_convert`. ([@palkan][])
8
+
9
+ - Add `Enumerable#compact`, `Enumerator::Lazy#compact`. ([@palkan][])
10
+
11
+ - [Proposed] Add support for binding instance, class, global variables in pattern matching. ([@palkan][])
12
+
13
+ This brings back rightward assignment: `42 => @v`.
14
+
15
+ - Add `MatchData#match`. ([@palkan][])
16
+
17
+ - Add support for command syntax in endless methods (`def foo() = puts "bar"`)
18
+
19
+ - Add `Refinement#import_methods` support. ([@palkan][])
20
+
21
+ 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).
22
+
23
+ You can find the details in [the PR](https://github.com/ruby-next/ruby-next/pull/85).
24
+
25
+ - Added support for instance, class and global variables and expressions for pin operator. ([@palkan][])
26
+
27
+ - Support omitting parentheses in one-line pattern matching. ([@palkan][])
28
+
29
+ - Anonymous blocks `def b(&); c(&); end` ([@palkan][]).
30
+
5
31
  ## 0.13.3 (2021-12-08)
6
32
 
7
33
  - Revert 0.13.2 and freeze Parser version. ([@skryukov][])
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.3
4
+ version: 0.14.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: 2021-12-09 00:00:00.000000000 Z
11
+ date: 2021-12-29 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.13.3
19
+ version: 0.14.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.13.3
26
+ version: 0.14.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.0.0.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.0.0.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 "