ruby-next 0.10.1 → 0.11.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 +31 -1
- data/README.md +12 -14
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b887c822e671a94ce19bc333363144a702d5bafea021892773a2079aaadbb3e
|
4
|
+
data.tar.gz: 9a4af2952cd11a8a559c19a927af62ea222c0e29400229b1b3434994c7fb1959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a472790f1e7f90cd4fd221977d9fe1844289aa1d26b84ac13702686ae68b2b74336e56d58619eb121da33bfc7b8e424d48a3d67c04150603eed5c23b4528c2c8
|
7
|
+
data.tar.gz: 8e112129e8470a1e4af7e00b93d2eeaa8637d2566849f049ddbeae125a56666923b3a435cce1d47725797cd2915fb68085d342288cf2bb80e2d9f3e0ac6301d4
|
data/CHANGELOG.md
CHANGED
@@ -2,10 +2,40 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
-
## 0.
|
5
|
+
## 0.11.0 (2020-12-24) 🎄
|
6
|
+
|
7
|
+
- Extended proposed shorthand Hash syntax to support kwargs as well. ([@palkan][])
|
8
|
+
|
9
|
+
You can try it: `x = 1; y = 2; foo(x:, y:) # => foo(x: x, y: y)`.
|
10
|
+
|
11
|
+
- **Rewrite mode is used by default in transpiler**. ([@palkan][])
|
12
|
+
|
13
|
+
- Move 3.0 features to stable features. ([@palkan][])
|
14
|
+
|
15
|
+
- Refactor `a => x` and `a in x` to comply with Ruby 3.0. ([@palkan][])
|
16
|
+
|
17
|
+
## 0.10.5 (2020-10-13)
|
18
|
+
|
19
|
+
- Fix Unparser 0.5.0 compatibility. ([@palkan][])
|
20
|
+
|
21
|
+
## 0.10.4 (2020-10-09)
|
22
|
+
|
23
|
+
- Restrict Unparser dependency. ([@palkan][])
|
24
|
+
|
25
|
+
Unparser 0.5.0 is currently not supported.
|
26
|
+
|
27
|
+
## 0.10.3 (2020-09-28)
|
28
|
+
|
29
|
+
- Update RuboCop integration to handle the latest Parser changes. ([@palkan][])
|
30
|
+
|
31
|
+
Parser 2.7.1.5 unified endless and normal methods and rightward and leftward assignments, thus, making some cops report false negatives.
|
32
|
+
|
33
|
+
## 0.10.2 (2020-09-09)
|
6
34
|
|
7
35
|
- Fix regression when `nextify` produces incorrect files for 2.7. ([@palkan][])
|
8
36
|
|
37
|
+
## ~~0.10.1~~
|
38
|
+
|
9
39
|
## 0.10.0 (2020-09-02)
|
10
40
|
|
11
41
|
- Add proposed shorthand Hash syntax. ([@palkan][])
|
data/README.md
CHANGED
@@ -35,6 +35,7 @@ Read more about the motivation behind the Ruby Next in this post: [Ruby Next: Ma
|
|
35
35
|
## Examples
|
36
36
|
|
37
37
|
- Ruby gems
|
38
|
+
- [action_policy](https://github.com/palkan/action_policy)
|
38
39
|
- [anyway_config](https://github.com/palkan/anyway_config)
|
39
40
|
- [graphql-fragment_cache](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache)
|
40
41
|
- Rails applications
|
@@ -92,8 +93,7 @@ def greet(val) =
|
|
92
93
|
'👽'
|
93
94
|
end
|
94
95
|
|
95
|
-
greet(hello: 'martian')
|
96
|
-
puts greeting
|
96
|
+
puts greet(hello: 'martian')
|
97
97
|
"
|
98
98
|
|
99
99
|
=> 👽
|
@@ -178,17 +178,17 @@ In the AST mode, we parse the source code into AST, modifies this AST and **gene
|
|
178
178
|
|
179
179
|
In the rewrite mode, we apply changes to the source code itself, thus, keeping the original formatting of the unaffected code (in a similar way to RuboCop's autocorrect feature).
|
180
180
|
|
181
|
-
By default, we use the AST mode. That could likely change in the future when we collect enough feedback on the rewrite mode and fix potential bugs.
|
182
|
-
|
183
181
|
The main benefit of the rewrite mode is that it preserves the original code line numbers and layout, which is especially useful in debugging.
|
184
182
|
|
183
|
+
By default, we use the rewrite mode. If you found a bug with rewrite mode which is not reproducible in the AST mode, please, let us know.
|
184
|
+
|
185
185
|
You can change the transpiler mode:
|
186
186
|
|
187
187
|
- From code by setting `RubyNext::Language.mode = :ast` or `RubyNext::Language.mode = :rewrite`.
|
188
|
-
- Via environmental variable `RUBY_NEXT_TRANSPILE_MODE=
|
188
|
+
- Via environmental variable `RUBY_NEXT_TRANSPILE_MODE=ast`.
|
189
189
|
- Via CLI option ([see below](#cli)).
|
190
190
|
|
191
|
-
**NOTE:** For the time being, Unparser
|
191
|
+
**NOTE:** For the time being, Unparser doesn't support Ruby 3.0 AST nodes, so we always use rewrite mode in Ruby 3.0+.
|
192
192
|
|
193
193
|
## CLI
|
194
194
|
|
@@ -219,7 +219,7 @@ Usage: ruby-next nextify DIRECTORY_OR_FILE [options]
|
|
219
219
|
|
220
220
|
The behaviour depends on whether you transpile a single file or a directory:
|
221
221
|
|
222
|
-
- 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`). 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`).
|
222
|
+
- 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`).
|
223
223
|
|
224
224
|
- When transpiling a file and providing the output path as a _file_ path, only a single version is created. For example:
|
225
225
|
|
@@ -322,7 +322,7 @@ due to the way feature resolving works in Ruby (scanning the `$LOAD_PATH` and ha
|
|
322
322
|
|
323
323
|
If you're using [runtime mode](#runtime-usage) a long with `setup_gem_load_path` (e.g., in tests), the transpiled files are ignored (i.e., we do not modify `$LOAD_PATH`).
|
324
324
|
|
325
|
-
\* Ruby Next avoids storing duplicates; instead, only the code for the earlier version is created and is assumed to be used with other versions. For example, if the transpiled code is the same for Ruby 2.5 and Ruby 2.6, only the `.rbnext/2.7/path/to/file.rb` is kept. That's why multiple entries are added to the `$LOAD_PATH` (`.rbnext/2.6
|
325
|
+
\* Ruby Next avoids storing duplicates; instead, only the code for the earlier version is created and is assumed to be used with other versions. For example, if the transpiled code is the same for Ruby 2.5 and Ruby 2.6, only the `.rbnext/2.7/path/to/file.rb` is kept. That's why multiple entries are added to the `$LOAD_PATH` (`.rbnext/2.6`, `.rbnext/2.7`, and `.rbnext/3.0` in the specified order for Ruby 2.5, and `.rbnext/2.7` and `.rbnext/3.0` for Ruby 2.6).
|
326
326
|
|
327
327
|
### Transpiled files vs. VCS vs. installing from source
|
328
328
|
|
@@ -475,6 +475,8 @@ RUBY_NEXT_CORE_STRATEGY=backports ruby-next nextify lib/
|
|
475
475
|
|
476
476
|
**NOTE:** For Ruby 2.2, safe navigation operator (`&.`) and squiggly heredocs (`<<~TXT`) support is provided.
|
477
477
|
|
478
|
+
**IMPORTANT:** Unparser `~> 0.4.8` is required to run the transpiler on Ruby <2.4.
|
479
|
+
|
478
480
|
## Proposed and edge features
|
479
481
|
|
480
482
|
Ruby Next aims to bring edge and proposed features to Ruby community before they (hopefully) reach an official Ruby release.
|
@@ -506,17 +508,13 @@ require "ruby-next/language/runtime"
|
|
506
508
|
|
507
509
|
### Supported edge features
|
508
510
|
|
509
|
-
|
510
|
-
|
511
|
-
- Right-hand assignment (`13.divmod(5) => a,b`) ([#15921](https://bugs.ruby-lang.org/issues/15921)).
|
512
|
-
|
513
|
-
- Find pattern (`[0, 1, 2] in [*, 1 => a, *c]`) ([#16828](https://bugs.ruby-lang.org/issues/16828)).
|
511
|
+
No new features since 3.0 release.
|
514
512
|
|
515
513
|
### Supported proposed features
|
516
514
|
|
517
515
|
- _Method reference_ operator (`.:`) ([#13581](https://bugs.ruby-lang.org/issues/13581)).
|
518
516
|
|
519
|
-
- Shorthand Hash notation (`data = {x, y}`) ([#15236](https://bugs.ruby-lang.org/issues/15236)).
|
517
|
+
- Shorthand Hash/kwarg notation (`data = {x, y}` or `foo(x:, y:)`) ([#15236](https://bugs.ruby-lang.org/issues/15236)).
|
520
518
|
|
521
519
|
## Contributing
|
522
520
|
|
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.11.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: 2020-
|
11
|
+
date: 2020-12-24 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.
|
19
|
+
version: 0.11.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.11.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.
|
33
|
+
version: 3.0.0.3
|
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.
|
40
|
+
version: 3.0.0.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: unparser
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,6 +45,9 @@ dependencies:
|
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 0.4.8
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 0.6.0
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,6 +55,9 @@ dependencies:
|
|
52
55
|
- - ">="
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: 0.4.8
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.6.0
|
55
61
|
description: "\n Ruby Next is a collection of polyfills and a transpiler for supporting
|
56
62
|
latest and upcoming edge CRuby features\n in older versions and alternative implementations
|
57
63
|
(such as mruby, JRuby, Opal, Artichoke, RubyMotion, etc.).\n "
|