ruby-next-core 0.15.0 → 0.15.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 +4 -0
- data/README.md +2 -2
- data/lib/.rbnext/2.1/ruby-next/core.rb +1 -1
- data/lib/.rbnext/2.3/ruby-next/commands/nextify.rb +1 -0
- data/lib/.rbnext/2.3/ruby-next/language/rewriters/2.7/pattern_matching.rb +0 -1
- data/lib/.rbnext/2.7/ruby-next/core.rb +1 -1
- data/lib/.rbnext/2.7/ruby-next/language/rewriters/2.7/pattern_matching.rb +0 -1
- data/lib/ruby-next/cli.rb +10 -12
- data/lib/ruby-next/commands/nextify.rb +1 -0
- data/lib/ruby-next/core/proc/compose.rb +0 -1
- data/lib/ruby-next/core/refinement/import.rb +1 -1
- data/lib/ruby-next/core.rb +1 -1
- data/lib/ruby-next/language/rewriters/2.5/rescue_within_block.rb +6 -4
- data/lib/ruby-next/language/rewriters/2.7/pattern_matching.rb +0 -1
- data/lib/ruby-next/language/runtime.rb +1 -1
- data/lib/ruby-next/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc36fd395eedfde5c29e65f1f3a75c683630d5111349b3070d3b4e6d200477ad
|
4
|
+
data.tar.gz: e53e28aec62f7e425a98ba1eeb9591778ca1dbab13a0390113fc7440aab9663d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50069c2ef6b59005d7efc640e1d84a74e17e4e385aaadce3ac54c2e3e061c7f71b727943140899210af997196f0bdf5a1157b86b97ce7af3de307e68a1cffe12
|
7
|
+
data.tar.gz: edf464100a254380bee320c586f48afc35782027303840fd319f32260ac5cf771c6f349d7447b9ed2f8a55bab424395664099dbd58600a05ffcd79e49080509f
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -544,9 +544,9 @@ These features are disabled by default, you must opt-in in one of the following
|
|
544
544
|
# It's important to load language module first
|
545
545
|
require "ruby-next/language"
|
546
546
|
|
547
|
-
require "ruby-next/language/edge"
|
547
|
+
require "ruby-next/language/rewriters/edge"
|
548
548
|
# or
|
549
|
-
require "ruby-next/language/proposed"
|
549
|
+
require "ruby-next/language/rewriters/proposed"
|
550
550
|
|
551
551
|
# and then activate the runtime mode
|
552
552
|
require "ruby-next/language/runtime"
|
@@ -62,7 +62,7 @@ module RubyNext
|
|
62
62
|
mod_name = singleton? ? singleton.name : mod.name
|
63
63
|
camelized_method_name = method_name.to_s.split("_").map(&:capitalize).join
|
64
64
|
|
65
|
-
"#{mod_name}#{camelized_method_name}".gsub(/\W/, "")
|
65
|
+
"#{mod_name}#{camelized_method_name}".gsub(/\W/, "")
|
66
66
|
end
|
67
67
|
|
68
68
|
def build_location(trace_locations)
|
@@ -152,6 +152,7 @@ module RubyNext
|
|
152
152
|
transpile path, contents, version: version
|
153
153
|
rescue SyntaxError, StandardError => e
|
154
154
|
warn "Failed to transpile #{path}: #{e.class} — #{e.message}"
|
155
|
+
warn e.backtrace.take(10).join("\n") if ENV["RUBY_NEXT_DEBUG"] == "1"
|
155
156
|
exit 1
|
156
157
|
end
|
157
158
|
|
@@ -62,7 +62,7 @@ module RubyNext
|
|
62
62
|
mod_name = singleton? ? singleton.name : mod.name
|
63
63
|
camelized_method_name = method_name.to_s.split("_").map(&:capitalize).join
|
64
64
|
|
65
|
-
"#{mod_name}#{camelized_method_name}".gsub(/\W/, "")
|
65
|
+
"#{mod_name}#{camelized_method_name}".gsub(/\W/, "")
|
66
66
|
end
|
67
67
|
|
68
68
|
def build_location(trace_locations)
|
data/lib/ruby-next/cli.rb
CHANGED
@@ -80,18 +80,16 @@ module RubyNext
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def optparser
|
83
|
-
@optparser ||=
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
@print_help = true
|
94
|
-
end
|
83
|
+
@optparser ||= OptionParser.new do |opts|
|
84
|
+
opts.banner = "Usage: ruby-next COMMAND [options]"
|
85
|
+
|
86
|
+
opts.on("-v", "--version", "Print version") do
|
87
|
+
$stdout.puts RubyNext::VERSION
|
88
|
+
exit 0
|
89
|
+
end
|
90
|
+
|
91
|
+
opts.on("-h", "--help", "Print help") do
|
92
|
+
@print_help = true
|
95
93
|
end
|
96
94
|
end
|
97
95
|
end
|
@@ -152,6 +152,7 @@ module RubyNext
|
|
152
152
|
transpile path, contents, version: version
|
153
153
|
rescue SyntaxError, StandardError => e
|
154
154
|
warn "Failed to transpile #{path}: #{e.class} — #{e.message}"
|
155
|
+
warn e.backtrace.take(10).join("\n") if ENV["RUBY_NEXT_DEBUG"] == "1"
|
155
156
|
exit 1
|
156
157
|
end
|
157
158
|
|
@@ -54,7 +54,7 @@ RubyNext::Core.singleton_class.module_eval do
|
|
54
54
|
|
55
55
|
# Copy constants (they could be accessed from methods)
|
56
56
|
other.constants.each do |name|
|
57
|
-
Kernel.eval "#{name} = #{other}::#{name}", bind
|
57
|
+
Kernel.eval "#{name} = #{other}::#{name}", bind # rubocop:disable Style/EvalWithLocation
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
data/lib/ruby-next/core.rb
CHANGED
@@ -62,7 +62,7 @@ module RubyNext
|
|
62
62
|
mod_name = singleton? ? singleton.name : mod.name
|
63
63
|
camelized_method_name = method_name.to_s.split("_").map(&:capitalize).join
|
64
64
|
|
65
|
-
"#{mod_name}#{camelized_method_name}".gsub(/\W/, "")
|
65
|
+
"#{mod_name}#{camelized_method_name}".gsub(/\W/, "")
|
66
66
|
end
|
67
67
|
|
68
68
|
def build_location(trace_locations)
|
@@ -15,23 +15,25 @@ module RubyNext
|
|
15
15
|
|
16
16
|
def on_block(block_node)
|
17
17
|
exception_node = block_node.children.find do |node|
|
18
|
-
node.type == :rescue || node.type == :ensure
|
18
|
+
node && (node.type == :rescue || node.type == :ensure)
|
19
19
|
end
|
20
20
|
|
21
|
-
return unless exception_node
|
21
|
+
return super(block_node) unless exception_node
|
22
22
|
|
23
23
|
context.track! self
|
24
24
|
|
25
25
|
insert_before(exception_node.loc.expression, "begin;")
|
26
26
|
insert_after(exception_node.loc.expression, ";end")
|
27
27
|
|
28
|
-
|
28
|
+
new_children = block_node.children.map do |child|
|
29
29
|
next s(:kwbegin, exception_node) if child == exception_node
|
30
30
|
|
31
31
|
child
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
process(
|
35
|
+
block_node.updated(:block, new_children)
|
36
|
+
)
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
data/lib/ruby-next/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-next-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.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: 2022-
|
11
|
+
date: 2022-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-next-parser
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
- !ruby/object:Gem::Version
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
173
|
+
rubygems_version: 3.3.7
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Ruby Next core functionality
|