ruby-next 0.9.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +42 -0
- data/README.md +20 -6
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13bd3de07b288ceab89e02d629db39c0946fb93be30c84806d945f923b549ab2
|
4
|
+
data.tar.gz: 331bfca63292c880faadfe2d74ced0132320a55053305898e0a01025fb412f5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1abb1c61664fa3c52a7af52618de02dd47b99c644fa305a085b6c1302d7329ce7c9f7d43470679d9e644baf1e8e3062f871769e2e68e6fa22b6d396e40270411
|
7
|
+
data.tar.gz: 576682f808e5ab8eebc0ff1314b5a49dca222bdbe59190c9dcdac9883ad368a1cf16334d621986439954a37fc31dabac29737e03156bf65d9ace3973a2179ab1
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,47 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.10.3 (2020-09-28)
|
6
|
+
|
7
|
+
- Update RuboCop integration to handle the latest Parser changes. ([@palkan][])
|
8
|
+
|
9
|
+
Parser 2.7.1.5 unified endless and normal methods and rightward and leftward assignments, thus, making some cops report false negatives.
|
10
|
+
|
11
|
+
## 0.10.2 (2020-09-09)
|
12
|
+
|
13
|
+
- Fix regression when `nextify` produces incorrect files for 2.7. ([@palkan][])
|
14
|
+
|
15
|
+
## ~~0.10.1~~
|
16
|
+
|
17
|
+
## 0.10.0 (2020-09-02)
|
18
|
+
|
19
|
+
- Add proposed shorthand Hash syntax. ([@palkan][])
|
20
|
+
|
21
|
+
You can try it: `x = 1; y = 2; data = {x, y}`.
|
22
|
+
|
23
|
+
- Add leading argument support to args forwarding. ([@palkan][])
|
24
|
+
|
25
|
+
`def a(...) b(1, ...); end`.
|
26
|
+
|
27
|
+
- Add `Hash#except`. ([@palkan][])
|
28
|
+
|
29
|
+
`{a: 1, b: 2}.except(:a) == {b: 2}`
|
30
|
+
|
31
|
+
- Add find pattern support. ([@palkan][])
|
32
|
+
|
33
|
+
Now you can do: `[0, 1, 2] in [*, 1 => a, *c]`.
|
34
|
+
|
35
|
+
- Add Ruby 2.2 support. ([@palkan][])
|
36
|
+
|
37
|
+
With support for safe navigation operator (`&.`) and squiggly heredocs (`<<~TXT`).
|
38
|
+
|
39
|
+
## 0.9.2 (2020-06-24)
|
40
|
+
|
41
|
+
- Support passing rewriters to CLI. ([@sl4vr][])
|
42
|
+
|
43
|
+
Use `nextify --list-rewriters` to view all available rewriters.
|
44
|
+
Use `nextify` with `--rewrite=REWRITERS...` option to specify which particular rewriters to use.
|
45
|
+
|
5
46
|
## 0.9.1 (2020-06-05)
|
6
47
|
|
7
48
|
- Keep `ruby-next` version in sync with `ruby-next-core`. ([@palkan][])
|
@@ -195,3 +236,4 @@ p a #=> 1
|
|
195
236
|
|
196
237
|
[@palkan]: https://github.com/palkan
|
197
238
|
[backports]: https://github.com/marcandre/backports
|
239
|
+
[@sl4vr]: https://github.com/sl4vr
|
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
[](https://cultofmartians.com/tasks/ruby-next-cli-rewriters.html#task)
|
1
2
|
[](https://rubygems.org/gems/ruby-next) [](https://github.com/ruby-next/ruby-next/actions)
|
2
3
|
[](https://github.com/ruby-next/ruby-next/actions?query=workflow%3A%22TruffleRuby+Build%22)
|
3
4
|
[](https://github.com/ruby-next/ruby-next/actions?query=workflow%3A%22TruffleRuby+Build%22)
|
@@ -36,6 +37,8 @@ Read more about the motivation behind the Ruby Next in this post: [Ruby Next: Ma
|
|
36
37
|
- Ruby gems
|
37
38
|
- [anyway_config](https://github.com/palkan/anyway_config)
|
38
39
|
- [graphql-fragment_cache](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache)
|
40
|
+
- Rails applications
|
41
|
+
- [anycable_rails_demo](https://github.com/anycable/anycable_rails_demo)
|
39
42
|
- mruby
|
40
43
|
- [ACLI](https://github.com/palkan/acli)
|
41
44
|
|
@@ -67,7 +70,7 @@ Core provides **polyfills** for Ruby core classes APIs via Refinements (default
|
|
67
70
|
Language is responsible for **transpiling** edge Ruby syntax into older versions. It could be done
|
68
71
|
programmatically or via CLI. It also could be done in runtime.
|
69
72
|
|
70
|
-
Currently, Ruby Next supports Ruby versions 2.
|
73
|
+
Currently, Ruby Next supports Ruby versions 2.2+, including JRuby 9.2.8+ and TruffleRuby 20.1+ (with some limitations). Support for EOL versions (<2.5) slightly differs though ([see below](#using-with-eol-rubies)).
|
71
74
|
|
72
75
|
Please, [open an issue](https://github.com/ruby-next/ruby-next/issues/new/choose) or join the discussion in the existing ones if you would like us to support older Ruby versions.
|
73
76
|
|
@@ -138,7 +141,7 @@ The following _rule of thumb_ is recommended when choosing between refinements a
|
|
138
141
|
- Using core extensions could be considered for application development (no need to think about `using RubyNext`); this approach could potentially lead to conflicts with dependencies (if these dependencies are not using refinements 🙂)
|
139
142
|
- Use core extensions if refinements are not supported by your platform
|
140
143
|
|
141
|
-
**NOTE:**
|
144
|
+
**NOTE:** _Edge_ APIs (i.e., from the Ruby's master branch) are included by default.
|
142
145
|
|
143
146
|
[**The list of supported APIs.**][features_core]
|
144
147
|
|
@@ -200,12 +203,15 @@ It has the following interface:
|
|
200
203
|
```sh
|
201
204
|
$ ruby-next nextify
|
202
205
|
Usage: ruby-next nextify DIRECTORY_OR_FILE [options]
|
203
|
-
-o, --output=OUTPUT Specify output directory or file or stdout
|
206
|
+
-o, --output=OUTPUT Specify output directory or file or stdout
|
204
207
|
--min-version=VERSION Specify the minimum Ruby version to support
|
205
208
|
--single-version Only create one version of a file (for the earliest Ruby version)
|
206
|
-
--
|
209
|
+
--edge Enable edge (master) Ruby features
|
210
|
+
--proposed Enable proposed/experimental Ruby features
|
207
211
|
--transpile-mode=MODE Transpiler mode (ast or rewrite). Default: ast
|
208
212
|
--[no-]refine Do not inject `using RubyNext`
|
213
|
+
--list-rewriters List available rewriters
|
214
|
+
--rewrite=REWRITERS... Specify particular Ruby features to rewrite
|
209
215
|
-h, --help Print help
|
210
216
|
-V Turn on verbose mode
|
211
217
|
--dry-run Print verbose output without generating files
|
@@ -423,6 +429,8 @@ You must set `TargetRubyVersion: next` to make RuboCop use a Ruby Next parser.
|
|
423
429
|
|
424
430
|
Alternatively, you can load the patch from the command line by running: `rubocop -r ruby-next/rubocop ...`.
|
425
431
|
|
432
|
+
We recommend using the latest RuboCop version, 'cause it has support for new nodes built-in.
|
433
|
+
|
426
434
|
Also, when pre-transpiling source code with `ruby-next nextify`, we suggest ignoring the transpiled files:
|
427
435
|
|
428
436
|
```yml
|
@@ -435,7 +443,7 @@ AllCops:
|
|
435
443
|
|
436
444
|
## Using with EOL Rubies
|
437
445
|
|
438
|
-
We currently provide support for Ruby 2.3 and 2.4.
|
446
|
+
We currently provide support for Ruby 2.2, 2.3 and 2.4.
|
439
447
|
|
440
448
|
Ruby Next itself relies on 2.5 features and contains polyfills only for version 2.5+ (and that won't change).
|
441
449
|
Thus, to make it work with <2.5 we need to backport some APIs ourselves.
|
@@ -465,6 +473,8 @@ RUBY_NEXT_CORE_STRATEGY=backports ruby-next nextify lib/
|
|
465
473
|
|
466
474
|
**NOTE:** Make sure you have `backports` gem installed globally or added to your bundle (if you're using `bundle exec ruby-next ...`).
|
467
475
|
|
476
|
+
**NOTE:** For Ruby 2.2, safe navigation operator (`&.`) and squiggly heredocs (`<<~TXT`) support is provided.
|
477
|
+
|
468
478
|
## Proposed and edge features
|
469
479
|
|
470
480
|
Ruby Next aims to bring edge and proposed features to Ruby community before they (hopefully) reach an official Ruby release.
|
@@ -498,12 +508,16 @@ require "ruby-next/language/runtime"
|
|
498
508
|
|
499
509
|
- "Endless" method definition (`def foo() = 42`) ([#16746](https://bugs.ruby-lang.org/issues/16746)).
|
500
510
|
|
501
|
-
- Right-hand assignment (`13.divmod(5) => a,b`) ([#15921](https://bugs.ruby-lang.org/issues/15921))
|
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)).
|
502
514
|
|
503
515
|
### Supported proposed features
|
504
516
|
|
505
517
|
- _Method reference_ operator (`.:`) ([#13581](https://bugs.ruby-lang.org/issues/13581)).
|
506
518
|
|
519
|
+
- Shorthand Hash notation (`data = {x, y}`) ([#15236](https://bugs.ruby-lang.org/issues/15236)).
|
520
|
+
|
507
521
|
## Contributing
|
508
522
|
|
509
523
|
Bug reports and pull requests are welcome on GitHub at [https://github.com/ruby-next/ruby-next](ttps://github.com/ruby-next/ruby-next).
|
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.10.3
|
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-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-next-core
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.10.3
|
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.10.3
|
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:
|
33
|
+
version: 3.0.0.1
|
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:
|
40
|
+
version: 3.0.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: unparser
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.4.
|
47
|
+
version: 0.4.8
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.4.
|
54
|
+
version: 0.4.8
|
55
55
|
description: "\n Ruby Next is a collection of polyfills and a transpiler for supporting
|
56
56
|
latest and upcoming edge CRuby features\n in older versions and alternative implementations
|
57
57
|
(such as mruby, JRuby, Opal, Artichoke, RubyMotion, etc.).\n "
|
@@ -81,7 +81,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
81
|
requirements:
|
82
82
|
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version: 2.
|
84
|
+
version: 2.2.0
|
85
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|