ruby-next-core 0.13.1 → 0.13.2
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 +3 -3
- data/lib/.rbnext/2.1/ruby-next/core.rb +1 -1
- data/lib/.rbnext/2.7/ruby-next/core.rb +1 -1
- data/lib/ruby-next/core.rb +1 -1
- data/lib/ruby-next/language/rewriters/shorthand_hash.rb +6 -4
- data/lib/ruby-next/rubocop.rb +0 -4
- data/lib/ruby-next/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8f96706a5e89d202c08d55a2a500975f08e80a2fcb07f2615982d07473f8bb1
|
4
|
+
data.tar.gz: 91327d7797411dd0658646389d66eb6d9519f2a54c9c86a55d46a6a0e105b4e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b14d836602c69fe59d2432170a08632b288aa2589516dc0892a47bcf86fcddde7cb8c1f03d874c760567d71441adfe7fc1b94e100db6d92f67a3bc1e2d35c305
|
7
|
+
data.tar.gz: b8b61a1bccc6e4959598d3fe73e9c44c9c9a1265ae0ddaa228e79d43ceabd57e0e61800f9f3aba86e5ed7235ba65623c5d9a0df83f013647220537bf0c2d9cff
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -522,14 +522,14 @@ require "ruby-next/language/runtime"
|
|
522
522
|
|
523
523
|
### Supported edge features
|
524
524
|
|
525
|
-
`Array#intersect?` ([#15198](https://bugs.ruby-lang.org/issues/15198))
|
525
|
+
- `Array#intersect?` ([#15198](https://bugs.ruby-lang.org/issues/15198))
|
526
|
+
|
527
|
+
- Shorthand Hash/kwarg notation (`data = {x:, y:}` or `foo(x:, y:)`) ([#15236](https://bugs.ruby-lang.org/issues/15236)).
|
526
528
|
|
527
529
|
### Supported proposed features
|
528
530
|
|
529
531
|
- _Method reference_ operator (`.:`) ([#13581](https://bugs.ruby-lang.org/issues/13581)).
|
530
532
|
|
531
|
-
- Shorthand Hash/kwarg notation (`data = {x, y}` or `foo(x:, y:)`) ([#15236](https://bugs.ruby-lang.org/issues/15236)).
|
532
|
-
|
533
533
|
## Contributing
|
534
534
|
|
535
535
|
Bug reports and pull requests are welcome on GitHub at [https://github.com/ruby-next/ruby-next](ttps://github.com/ruby-next/ruby-next).
|
@@ -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/, "") # rubocop:disable Performance/StringReplacement
|
66
66
|
end
|
67
67
|
|
68
68
|
def build_location(trace_locations)
|
@@ -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/, "") # rubocop:disable Performance/StringReplacement
|
66
66
|
end
|
67
67
|
|
68
68
|
def build_location(trace_locations)
|
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/, "") # rubocop:disable Performance/StringReplacement
|
66
66
|
end
|
67
67
|
|
68
68
|
def build_location(trace_locations)
|
@@ -5,13 +5,15 @@ module RubyNext
|
|
5
5
|
module Rewriters
|
6
6
|
class ShorthandHash < Base
|
7
7
|
NAME = "shorthand-hash"
|
8
|
-
SYNTAX_PROBE = "data = {x}"
|
9
|
-
MIN_SUPPORTED_VERSION = Gem::Version.new(
|
8
|
+
SYNTAX_PROBE = "data = {x:}"
|
9
|
+
MIN_SUPPORTED_VERSION = Gem::Version.new("3.1.0")
|
10
|
+
|
11
|
+
def on_pair(node)
|
12
|
+
return super(node) unless node.children[0].loc.last_column == node.children[1].loc.last_column
|
10
13
|
|
11
|
-
def on_ipair(node)
|
12
14
|
context.track! self
|
13
15
|
|
14
|
-
ident, = *node.children
|
16
|
+
_, ident, = *node.children
|
15
17
|
|
16
18
|
key = key_from_ident(ident)
|
17
19
|
|
data/lib/ruby-next/rubocop.rb
CHANGED
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.13.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-next-parser
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.0.0
|
19
|
+
version: 3.1.0.0
|
20
20
|
type: :development
|
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: 3.0.0
|
26
|
+
version: 3.1.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: unparser
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|