ruby-next 0.9.0.pre → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +46 -0
- data/README.md +29 -8
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89eb69603a927bdc03e9ace7594a7e13a37ceb38dc9b6493fc0d93256aa6ef62
|
4
|
+
data.tar.gz: 4184cf7e927622a85a56dd5583654ad6230b0d3fa9f3afcee10fd47f0d125d28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba86d164f5490740abacca5a0d01192b9841377ea99a895f7319fd5b1121de5138868277eff6bddf5bd7bb9b1ad34080fba54f49abc4e339b0e6d47a263b9023
|
7
|
+
data.tar.gz: 909d8bd492835aaa90bef0502704fe6bdbd201dba15c22c3c394ee85d6cd8d13081ba25abf1c50248ccd52794dbb83775ad43005a7a5a31176558c436a7912cc
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,51 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.10.1 (2020-09-09)
|
6
|
+
|
7
|
+
- Fix regression when `nextify` produces incorrect files for 2.7. ([@palkan][])
|
8
|
+
|
9
|
+
## 0.10.0 (2020-09-02)
|
10
|
+
|
11
|
+
- Add proposed shorthand Hash syntax. ([@palkan][])
|
12
|
+
|
13
|
+
You can try it: `x = 1; y = 2; data = {x, y}`.
|
14
|
+
|
15
|
+
- Add leading argument support to args forwarding. ([@palkan][])
|
16
|
+
|
17
|
+
`def a(...) b(1, ...); end`.
|
18
|
+
|
19
|
+
- Add `Hash#except`. ([@palkan][])
|
20
|
+
|
21
|
+
`{a: 1, b: 2}.except(:a) == {b: 2}`
|
22
|
+
|
23
|
+
- Add find pattern support. ([@palkan][])
|
24
|
+
|
25
|
+
Now you can do: `[0, 1, 2] in [*, 1 => a, *c]`.
|
26
|
+
|
27
|
+
- Add Ruby 2.2 support. ([@palkan][])
|
28
|
+
|
29
|
+
With support for safe navigation operator (`&.`) and squiggly heredocs (`<<~TXT`).
|
30
|
+
|
31
|
+
## 0.9.2 (2020-06-24)
|
32
|
+
|
33
|
+
- Support passing rewriters to CLI. ([@sl4vr][])
|
34
|
+
|
35
|
+
Use `nextify --list-rewriters` to view all available rewriters.
|
36
|
+
Use `nextify` with `--rewrite=REWRITERS...` option to specify which particular rewriters to use.
|
37
|
+
|
38
|
+
## 0.9.1 (2020-06-05)
|
39
|
+
|
40
|
+
- Keep `ruby-next` version in sync with `ruby-next-core`. ([@palkan][])
|
41
|
+
|
42
|
+
Require `ruby-next-core` of the same version as `ruby-next`.
|
43
|
+
|
44
|
+
## 0.9.0 (2020-06-04)
|
45
|
+
|
46
|
+
- Add Ruby 2.3 support. ([@palkan][])
|
47
|
+
|
48
|
+
- Remove stale transpiled files when running `ruby-next nextify`. ([@palkan][])
|
49
|
+
|
5
50
|
- Add Ruby 2.4 support. ([@palkan][])
|
6
51
|
|
7
52
|
APIs for <2.5 must be backported via [backports][] gem. Refinements are not supported.
|
@@ -183,3 +228,4 @@ p a #=> 1
|
|
183
228
|
|
184
229
|
[@palkan]: https://github.com/palkan
|
185
230
|
[backports]: https://github.com/marcandre/backports
|
231
|
+
[@sl4vr]: https://github.com/sl4vr
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
+
[![Cult Of Martians](http://cultofmartians.com/assets/badges/badge.svg)](https://cultofmartians.com/tasks/ruby-next-cli-rewriters.html#task)
|
1
2
|
[![Gem Version](https://badge.fury.io/rb/ruby-next.svg)](https://rubygems.org/gems/ruby-next) [![Build](https://github.com/ruby-next/ruby-next/workflows/Build/badge.svg)](https://github.com/ruby-next/ruby-next/actions)
|
2
|
-
[![JRuby Build](https://github.com/ruby-next/ruby-next/workflows/JRuby%20Build/badge.svg)](https://github.com/ruby-next/ruby-next/actions)
|
3
|
+
[![JRuby Build](https://github.com/ruby-next/ruby-next/workflows/JRuby%20Build/badge.svg)](https://github.com/ruby-next/ruby-next/actions?query=workflow%3A%22TruffleRuby+Build%22)
|
4
|
+
[![TruffleRuby Build](https://github.com/ruby-next/ruby-next/workflows/TruffleRuby%20Build/badge.svg)](https://github.com/ruby-next/ruby-next/actions?query=workflow%3A%22TruffleRuby+Build%22)
|
3
5
|
|
4
6
|
# Ruby Next
|
5
7
|
|
@@ -35,6 +37,8 @@ Read more about the motivation behind the Ruby Next in this post: [Ruby Next: Ma
|
|
35
37
|
- Ruby gems
|
36
38
|
- [anyway_config](https://github.com/palkan/anyway_config)
|
37
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)
|
38
42
|
- mruby
|
39
43
|
- [ACLI](https://github.com/palkan/acli)
|
40
44
|
|
@@ -66,7 +70,7 @@ Core provides **polyfills** for Ruby core classes APIs via Refinements (default
|
|
66
70
|
Language is responsible for **transpiling** edge Ruby syntax into older versions. It could be done
|
67
71
|
programmatically or via CLI. It also could be done in runtime.
|
68
72
|
|
69
|
-
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)).
|
70
74
|
|
71
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.
|
72
76
|
|
@@ -137,6 +141,8 @@ The following _rule of thumb_ is recommended when choosing between refinements a
|
|
137
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 🙂)
|
138
142
|
- Use core extensions if refinements are not supported by your platform
|
139
143
|
|
144
|
+
**NOTE:** _Edge_ APIs (i.e., from the Ruby's master branch) are included by default.
|
145
|
+
|
140
146
|
[**The list of supported APIs.**][features_core]
|
141
147
|
|
142
148
|
## Transpiling
|
@@ -197,12 +203,15 @@ It has the following interface:
|
|
197
203
|
```sh
|
198
204
|
$ ruby-next nextify
|
199
205
|
Usage: ruby-next nextify DIRECTORY_OR_FILE [options]
|
200
|
-
-o, --output=OUTPUT Specify output directory or file or stdout
|
206
|
+
-o, --output=OUTPUT Specify output directory or file or stdout
|
201
207
|
--min-version=VERSION Specify the minimum Ruby version to support
|
202
208
|
--single-version Only create one version of a file (for the earliest Ruby version)
|
203
|
-
--
|
209
|
+
--edge Enable edge (master) Ruby features
|
210
|
+
--proposed Enable proposed/experimental Ruby features
|
204
211
|
--transpile-mode=MODE Transpiler mode (ast or rewrite). Default: ast
|
205
212
|
--[no-]refine Do not inject `using RubyNext`
|
213
|
+
--list-rewriters List available rewriters
|
214
|
+
--rewrite=REWRITERS... Specify particular Ruby features to rewrite
|
206
215
|
-h, --help Print help
|
207
216
|
-V Turn on verbose mode
|
208
217
|
--dry-run Print verbose output without generating files
|
@@ -390,6 +399,12 @@ RUBYOPT="-ruby-next" ruby my_ruby_script.rb
|
|
390
399
|
ruby -ruby-next -e "puts [2, 4, 5].tally"
|
391
400
|
```
|
392
401
|
|
402
|
+
**NOTE:** running Ruby scripts directly or executing code via `-e` option is not supported in TruffleRuby. You can still use `-ruby-next` to transpile required files, e.g.:
|
403
|
+
|
404
|
+
```sh
|
405
|
+
ruby -ruby-next -r my_ruby_script.rb -e "puts my_method"
|
406
|
+
```
|
407
|
+
|
393
408
|
## Logging and debugging
|
394
409
|
|
395
410
|
Ruby Next prints some debugging information when fails to load a file in the runtime mode (and fallbacks to the built-in loading mechanism).
|
@@ -414,6 +429,8 @@ You must set `TargetRubyVersion: next` to make RuboCop use a Ruby Next parser.
|
|
414
429
|
|
415
430
|
Alternatively, you can load the patch from the command line by running: `rubocop -r ruby-next/rubocop ...`.
|
416
431
|
|
432
|
+
We recommend using the latest RuboCop version, 'cause it has support for new nodes built-in.
|
433
|
+
|
417
434
|
Also, when pre-transpiling source code with `ruby-next nextify`, we suggest ignoring the transpiled files:
|
418
435
|
|
419
436
|
```yml
|
@@ -426,9 +443,7 @@ AllCops:
|
|
426
443
|
|
427
444
|
## Using with EOL Rubies
|
428
445
|
|
429
|
-
|
430
|
-
|
431
|
-
We currently provide experimental support for Ruby 2.4. Work on older Rubies (down to 2.2) is in progress.
|
446
|
+
We currently provide support for Ruby 2.2, 2.3 and 2.4.
|
432
447
|
|
433
448
|
Ruby Next itself relies on 2.5 features and contains polyfills only for version 2.5+ (and that won't change).
|
434
449
|
Thus, to make it work with <2.5 we need to backport some APIs ourselves.
|
@@ -458,6 +473,8 @@ RUBY_NEXT_CORE_STRATEGY=backports ruby-next nextify lib/
|
|
458
473
|
|
459
474
|
**NOTE:** Make sure you have `backports` gem installed globally or added to your bundle (if you're using `bundle exec ruby-next ...`).
|
460
475
|
|
476
|
+
**NOTE:** For Ruby 2.2, safe navigation operator (`&.`) and squiggly heredocs (`<<~TXT`) support is provided.
|
477
|
+
|
461
478
|
## Proposed and edge features
|
462
479
|
|
463
480
|
Ruby Next aims to bring edge and proposed features to Ruby community before they (hopefully) reach an official Ruby release.
|
@@ -491,12 +508,16 @@ require "ruby-next/language/runtime"
|
|
491
508
|
|
492
509
|
- "Endless" method definition (`def foo() = 42`) ([#16746](https://bugs.ruby-lang.org/issues/16746)).
|
493
510
|
|
494
|
-
- 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)).
|
495
514
|
|
496
515
|
### Supported proposed features
|
497
516
|
|
498
517
|
- _Method reference_ operator (`.:`) ([#13581](https://bugs.ruby-lang.org/issues/13581)).
|
499
518
|
|
519
|
+
- Shorthand Hash notation (`data = {x, y}`) ([#15236](https://bugs.ruby-lang.org/issues/15236)).
|
520
|
+
|
500
521
|
## Contributing
|
501
522
|
|
502
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.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: 2020-
|
11
|
+
date: 2020-09-09 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.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.
|
26
|
+
version: 0.10.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:
|
33
|
+
version: 3.0.0.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:
|
40
|
+
version: 3.0.0.0
|
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,12 +81,12 @@ 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
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '0'
|
90
90
|
requirements: []
|
91
91
|
rubygems_version: 3.0.6
|
92
92
|
signing_key:
|