ruby-next 0.10.5 → 0.11.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 +12 -0
  3. data/README.md +9 -14
  4. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b42b646bf5a54df76b6d4dc0d0fb5dc17d215177aa5da1c60f6f801ae24900e8
4
- data.tar.gz: df89c85b14e63c9edeb663481854e293962086a9a6523b78e7f6943f9926a62e
3
+ metadata.gz: 5b887c822e671a94ce19bc333363144a702d5bafea021892773a2079aaadbb3e
4
+ data.tar.gz: 9a4af2952cd11a8a559c19a927af62ea222c0e29400229b1b3434994c7fb1959
5
5
  SHA512:
6
- metadata.gz: 4a0ec2c5ea4e3321324bf3a45f39b3a6cf1dc4e57421ddd2069894de4d3491cad2fa434de0ea082509e45ed5e251a698efec88f1ae940183d23e5fc2812afec5
7
- data.tar.gz: 4748e31aea1d1713a15ea1246b5db2c39374edd9a58f7afe44e2dac44acce5843febd315866d8d2081be31a1064bdc75e6765ea763f379fb51fbaad8c96a7012
6
+ metadata.gz: a472790f1e7f90cd4fd221977d9fe1844289aa1d26b84ac13702686ae68b2b74336e56d58619eb121da33bfc7b8e424d48a3d67c04150603eed5c23b4528c2c8
7
+ data.tar.gz: 8e112129e8470a1e4af7e00b93d2eeaa8637d2566849f049ddbeae125a56666923b3a435cce1d47725797cd2915fb68085d342288cf2bb80e2d9f3e0ac6301d4
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## master
4
4
 
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
+
5
17
  ## 0.10.5 (2020-10-13)
6
18
 
7
19
  - Fix Unparser 0.5.0 compatibility. ([@palkan][])
data/README.md CHANGED
@@ -93,8 +93,7 @@ def greet(val) =
93
93
  '👽'
94
94
  end
95
95
 
96
- greet(hello: 'martian') => greeting
97
- puts greeting
96
+ puts greet(hello: 'martian')
98
97
  "
99
98
 
100
99
  => 👽
@@ -179,17 +178,17 @@ In the AST mode, we parse the source code into AST, modifies this AST and **gene
179
178
 
180
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).
181
180
 
182
- 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.
183
-
184
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.
185
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
+
186
185
  You can change the transpiler mode:
187
186
 
188
187
  - From code by setting `RubyNext::Language.mode = :ast` or `RubyNext::Language.mode = :rewrite`.
189
- - Via environmental variable `RUBY_NEXT_TRANSPILE_MODE=rewrite`.
188
+ - Via environmental variable `RUBY_NEXT_TRANSPILE_MODE=ast`.
190
189
  - Via CLI option ([see below](#cli)).
191
190
 
192
- **NOTE:** For the time being, Unparser [doesn't support](https://github.com/mbj/unparser/pull/142) new Ruby 2.7 AST nodes, so we always use rewrite mode in Ruby 2.7+.
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+.
193
192
 
194
193
  ## CLI
195
194
 
@@ -220,7 +219,7 @@ Usage: ruby-next nextify DIRECTORY_OR_FILE [options]
220
219
 
221
220
  The behaviour depends on whether you transpile a single file or a directory:
222
221
 
223
- - 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`).
224
223
 
225
224
  - When transpiling a file and providing the output path as a _file_ path, only a single version is created. For example:
226
225
 
@@ -323,7 +322,7 @@ due to the way feature resolving works in Ruby (scanning the `$LOAD_PATH` and ha
323
322
 
324
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`).
325
324
 
326
- \* 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` and `.rbnext/2.7` in the specified order for Ruby 2.5 and only `.rbnext/2.7` for Ruby 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).
327
326
 
328
327
  ### Transpiled files vs. VCS vs. installing from source
329
328
 
@@ -509,17 +508,13 @@ require "ruby-next/language/runtime"
509
508
 
510
509
  ### Supported edge features
511
510
 
512
- - "Endless" method definition (`def foo() = 42`) ([#16746](https://bugs.ruby-lang.org/issues/16746)).
513
-
514
- - Right-hand assignment (`13.divmod(5) => a,b`) ([#15921](https://bugs.ruby-lang.org/issues/15921)).
515
-
516
- - 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.
517
512
 
518
513
  ### Supported proposed features
519
514
 
520
515
  - _Method reference_ operator (`.:`) ([#13581](https://bugs.ruby-lang.org/issues/13581)).
521
516
 
522
- - 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)).
523
518
 
524
519
  ## Contributing
525
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.10.5
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-10-13 00:00:00.000000000 Z
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.10.5
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.10.5
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.1
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.1
40
+ version: 3.0.0.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: unparser
43
43
  requirement: !ruby/object:Gem::Requirement