ruby-next 1.0.2 → 1.1.0
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 +8 -0
- data/README.md +19 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d02021cba138ffde5ada984fd1d3848a6fe666128bf9f61ae8fd4d16ea3e762
|
4
|
+
data.tar.gz: c9b212735494e26f9ccfe759e5cd039f1d8217e705b97fcde118698ab43d97a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4e958626a9c250e4425a64a233bd9923035421046241a34b293118716e9c4e5704173b4cb258b213e3010ebdae6796b262bc0346a33dc63d1a45838c6e76897
|
7
|
+
data.tar.gz: 4c4969d33ccee6113a0d4e1a2c5eb7e3392340479e836fb2970e651b1dad1a91eecaafef11950a7f063f6c1fba0c1c4419734d6e0079dc9e3e5f6564ea942194
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.1.0 (2025-01-15)
|
6
|
+
|
7
|
+
- Prepare for Ruby 3.5.
|
8
|
+
|
9
|
+
## 1.0.3 (2024-04-18)
|
10
|
+
|
11
|
+
- Fix RuboCop compatibility.
|
12
|
+
|
5
13
|
## 1.0.2 (2024-02-23)
|
6
14
|
|
7
15
|
- Automatically mark context as dirty if `#safe_rewrite` modifies source code. ([@palkan][])
|
data/README.md
CHANGED
@@ -364,6 +364,20 @@ If the command fails we warn the end user.
|
|
364
364
|
|
365
365
|
This feature, _auto-transpiling_, is **disabled** by default (will likely be enabled in future versions). You can enable it by calling `RubyNext::Language.setup_gem_load_path(transpile: true)`.
|
366
366
|
|
367
|
+
### Dependency-less setup
|
368
|
+
|
369
|
+
If you want to avoid adding `ruby-next-core` to your gem's dependencies, you can tweak the `$LOAD_PATH` yourself. It's much easier to do if you go with a single transpiled version per source file (i.e., use `--single-version` or specify particular rewriters using the `--rewrite` option of the `ruby-next nextify` command). If so, you can drop the following snippet to your gem's entrypoint:
|
370
|
+
|
371
|
+
```ruby
|
372
|
+
# lib/my_gem.rb
|
373
|
+
$LOAD_PATH.unshift "#{__dir__}/.rbnext"
|
374
|
+
|
375
|
+
# Then go `require` statements
|
376
|
+
# ...
|
377
|
+
```
|
378
|
+
|
379
|
+
That's it! Keep in mind that in this cases there is no auto-transpiling support (so, you may want to keep the transpiled files in the repository to allow installing the gem from source).
|
380
|
+
|
367
381
|
## Runtime usage
|
368
382
|
|
369
383
|
It is also possible to transpile Ruby source code in run-time via Ruby Next.
|
@@ -552,7 +566,7 @@ require "ruby-next/language/runtime"
|
|
552
566
|
|
553
567
|
### Supported edge features
|
554
568
|
|
555
|
-
|
569
|
+
None yet.
|
556
570
|
|
557
571
|
### Supported proposed features
|
558
572
|
|
@@ -565,6 +579,9 @@ Wonder what would happen if Ruby get a null coalescing operator (`??=`) or some
|
|
565
579
|
|
566
580
|
Ruby Next allows you to write your own syntax rewriters. Full-featured rewriters (used by Ruby Next itself) operate on AST and usually require parser modifications. However, we also support text-based rewriters which can be used to experiment with new syntax much quicker without dealing with grammars, parsers and syntax trees.
|
567
581
|
|
582
|
+
> [!TIP]
|
583
|
+
> You can experiment with Ruby Next rewriters at our [online playground][playground]!
|
584
|
+
|
568
585
|
To implement a text-based rewriter, you need to create a new class inherited from `RubyNext::Language::Rewriters::Text` and implementing either `#rewrite` or `#safe_rewrite` method. For example, the method reference operator (`.:`) could be implemented as follows:
|
569
586
|
|
570
587
|
```ruby
|
@@ -704,3 +721,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
704
721
|
[require-hooks]: https://github.com/ruby-next/require-hooks
|
705
722
|
[Natalie]: https://natalie-lang.org
|
706
723
|
[Paco]: https://github.com/ruby-next/paco
|
724
|
+
[playground]: https://ruby-next.github.io
|
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: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-16 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: 1.0
|
19
|
+
version: 1.1.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: 1.0
|
26
|
+
version: 1.1.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.
|
33
|
+
version: 3.4.0.2
|
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.
|
40
|
+
version: 3.4.0.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: require-hooks
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,7 +101,7 @@ metadata:
|
|
101
101
|
documentation_uri: https://github.com/ruby-next/ruby-next/blob/master/README.md
|
102
102
|
homepage_uri: https://github.com/ruby-next/ruby-next
|
103
103
|
source_code_uri: https://github.com/ruby-next/ruby-next
|
104
|
-
post_install_message:
|
104
|
+
post_install_message:
|
105
105
|
rdoc_options: []
|
106
106
|
require_paths:
|
107
107
|
- lib
|
@@ -116,8 +116,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
|
-
rubygems_version: 3.4.
|
120
|
-
signing_key:
|
119
|
+
rubygems_version: 3.4.19
|
120
|
+
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: Make older Rubies quack like edge Ruby
|
123
123
|
test_files: []
|