node_mutation 1.3.0 → 1.3.2

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: e39eb120d51bf9d1839013e1e0b408c1d9f8eefc2eb2767e594f83e01171d323
4
- data.tar.gz: 63688a3c83e512004a010d29a373c91f8b542fe8ce1f8ccd16c89ebd8b059103
3
+ metadata.gz: d58aed2bff850b0b89d18864dcc6a3f4e85cae7f47afc619a5b45d32f48391c8
4
+ data.tar.gz: 00b768bfdf534bdcd8f6584b8dad1da5d7eaba8aa7db5e5c69938706835d7b79
5
5
  SHA512:
6
- metadata.gz: b1089cb5497135200f0b935fb2c4a3c2537581b5c53bedd8c2ca9392fc6a989de764f116f90040628b4f06f24a8cf29998d1ad7330a37fe4d29026b71d558c2e
7
- data.tar.gz: dfa661d9080738bf60f486ea05eba4f7fea7bb8320d7a76953ccdb00498d71f6c8070917ff2c0169aa351e9276f7317f1cbd7044c5e3039e88b12feabc0f53cd
6
+ metadata.gz: eb1879571f03a10b130114d712f6508c344407edf4c89db3e09cdff16c1fe614438e4f1e54d64455fd5bb7234e160ed004e454e42e8418620e4caf844e756cc9
7
+ data.tar.gz: 36ceb04aa0ea17bdb6fe8b6402e3d5e53332c9256bdafcad926185ed8c2e001945dd5ba09bafa1ac0bbd1c428aa6d9cb7c1524298eeae8655a2478d5e952d482
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # NodeMutation
2
2
 
3
+ ## 1.3.2 (2022-09-16)
4
+
5
+ * Add `NodeMutation::Action.to_hash`
6
+ * Add `NodeMutation::Result.to_hash`
7
+
3
8
  ## 1.3.0 (2022-09-15)
4
9
 
5
10
  * Add `NodeMutation#test`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- node_mutation (1.3.0)
4
+ node_mutation (1.3.2)
5
5
  activesupport (< 7.0.0)
6
6
  erubis
7
7
 
@@ -38,6 +38,10 @@ class NodeMutation::Action
38
38
  end
39
39
  end
40
40
 
41
+ def to_hash
42
+ { start: start, end: @end, new_code: new_code }
43
+ end
44
+
41
45
  protected
42
46
 
43
47
  # Calculate the begin the end positions.
@@ -20,4 +20,10 @@ class NodeMutation::Result
20
20
  def new_source
21
21
  @options[:new_source]
22
22
  end
23
+
24
+ def to_hash
25
+ @options.each_pair.with_object({}) do |(key, value), hash|
26
+ hash[key] = value.is_a?(Array) ? value.map { |action| action.to_hash } : value
27
+ end
28
+ end
23
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class NodeMutation
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: node_mutation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang