node_mutation 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b66c8223045972f4f91cdae0b61a5589c04e7f53f3eedf66b1c0eebee9d66b1c
4
- data.tar.gz: 64a47a10bce6886a876cd04b08ff37118e6094bcc40d1e909e861d6f25c37d43
3
+ metadata.gz: 44339bec6d4624f5f7cf60b9253e701c7215f2b5bae0094b0532bf86e4c6cf91
4
+ data.tar.gz: 4878c3c9f61830b728d6ea21424588d62c039e42aa5a029b1786844a1c7b74db
5
5
  SHA512:
6
- metadata.gz: 12f5cd0bc631511de6d7b250dec14869ce1e19d5c311ac59e5722578f2fa15f51b17be600d5fc59a3ef5ffaa1607e209ccc6e611e2046f1a9005cffb693367a9
7
- data.tar.gz: 7d3496c675ed29a8ddaa35d3fbf4b538677a44016696c40020e518afa62526fa5e7ad2abec2b7339732adabb820fa037795c3d8597b0149a2cd0502c23c95883
6
+ metadata.gz: 1d0b12e168a2a8aa7a8019484125bd0edcdb159846216de1d1822e1a75f1b47e1f57f87b5de0cb94a0ebec45e950b2f32c9349c76294ac6156d0d382be85d52e
7
+ data.tar.gz: deb03d485ddf7ca91797cafbe28526ea5e91b7f862c71173e801587d727ced13680f7ff4dc3d4f2d563e8830c52622e5ce44dc4f02d84ddc6f26f572941db6d5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # NodeMutation
2
2
 
3
+ ## 1.5.1 (2022-10-19)
4
+
5
+ * Better error message for unknown code
6
+
3
7
  ## 1.5.0 (2022-10-17)
4
8
 
5
9
  * Remove `insert_after`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- node_mutation (1.5.0)
4
+ node_mutation (1.5.1)
5
5
  activesupport (< 7.0.0)
6
6
  erubis
7
7
 
@@ -8,7 +8,7 @@ class NodeMutation::ParserAdapter < NodeMutation::Adapter
8
8
  def rewritten_source(node, code)
9
9
  code.gsub(/{{(.+?)}}/m) do
10
10
  old_code = Regexp.last_match(1)
11
- if node.respond_to?(old_code.split('.').first)
11
+ begin
12
12
  evaluated = child_node_by_name(node, old_code)
13
13
  case evaluated
14
14
  when Parser::AST::Node
@@ -38,10 +38,10 @@ class NodeMutation::ParserAdapter < NodeMutation::Adapter
38
38
  when NilClass
39
39
  'nil'
40
40
  else
41
- raise Synvert::Core::MethodNotSupported, "rewritten_source is not handled for #{evaluated.inspect}"
41
+ raise "rewritten_source is not handled for #{evaluated.inspect}"
42
42
  end
43
- else
44
- "{{#{old_code}}}"
43
+ rescue StandardError => e
44
+ raise "can not parse \"#{code}\""
45
45
  end
46
46
  end
47
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class NodeMutation
4
- VERSION = "1.5.0"
4
+ VERSION = "1.5.1"
5
5
  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.5.0
4
+ version: 1.5.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-17 00:00:00.000000000 Z
11
+ date: 2022-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport