node_mutation 1.6.0 → 1.6.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/Gemfile.lock +1 -1
- data/lib/node_mutation/parser_adapter.rb +3 -2
- data/lib/node_mutation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a919cd77334f1c935135667972c64670f1513a31c63dde2a71405dcb165077f
|
4
|
+
data.tar.gz: ce7faaade885a41905b1371b04cb2c94962cd044404f754a6bd1d0537b6c871a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee3c31054d31ba1b997e366f3c2ac0fd4d6b3587f9f49e59d12d72a23cb8b8d4b1f12dcfb7f5d72440cbd867b4ed5ef01e19cfcdfbaa11a9c3d4b7db53c047e6
|
7
|
+
data.tar.gz: 2295e27670dbaa6be22ef320cd3e13cbb69e86fcf2f8824f8be4ada1607deb98fa7d6d1891bb3a4360debd37abf5876f155276ddd7bf45b0aac6667df67920af
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -13,7 +13,8 @@ class NodeMutation::ParserAdapter < NodeMutation::Adapter
|
|
13
13
|
def rewritten_source(node, code)
|
14
14
|
code.gsub(/{{(.+?)}}/m) do
|
15
15
|
old_code = Regexp.last_match(1)
|
16
|
-
|
16
|
+
first_key = old_code.split('.').first
|
17
|
+
if node.respond_to?(first_key)
|
17
18
|
evaluated = child_node_by_name(node, old_code)
|
18
19
|
case evaluated
|
19
20
|
when Parser::AST::Node
|
@@ -44,7 +45,7 @@ class NodeMutation::ParserAdapter < NodeMutation::Adapter
|
|
44
45
|
raise "can not parse \"#{code}\""
|
45
46
|
end
|
46
47
|
else
|
47
|
-
raise "
|
48
|
+
raise NodeMutation::MethodNotSupported, "#{first_key} is not supported for #{get_source(node)}"
|
48
49
|
end
|
49
50
|
end
|
50
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: node_mutation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|