syntax_tree_ext 0.7.0 → 0.7.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: 97f2ba6521c0048eaaa6f65a4a17b4f34891b0eef53d968374f7e44bf4e75246
4
- data.tar.gz: 27bd10410c6189066f89c6a94e7ce1b92d84a59be1598eba177ed2f0ee617818
3
+ metadata.gz: 76f93356ad00c2206f575f6aa8117de178eb2710a6534f8df11c10871f68a9b8
4
+ data.tar.gz: a846f03d2f62bf8928764a6423df58ded2b1f524cf677c886f069f9e835cc7e9
5
5
  SHA512:
6
- metadata.gz: bb7aeb9a688f2d789e54087caf16a031b7f1caa8c9f553f5be17b3b086532456914c9c61f391e08860b9fd22496a2de07c3653a7d6430863cbd550321937176d
7
- data.tar.gz: b52f466c32ca64172aaeb0b8ede41f4c93feef922b4f1d36ac24a522a844f21319eac8b025c85fc51e02054bd7464471830f19070bd8c0d5b50435427c482230
6
+ metadata.gz: 7e677f857fe5e663a92d2e2905535647ce0c4c6927da6a151a1ab88fd7c3265d465efba409cd4147c7c20486e7aedde93cb7bfa715c00f19d499708bfb5ae17e
7
+ data.tar.gz: f9b15130df4786bb1b9548ea3d21eb234508270c38599b80cf01600fa7cd8de8c6150283c6e1e13bb69975b5aea6ad0535410fc952d8013963921ec4926efd7b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.7.1 (2024-02-11)
4
+
5
+ * Reuse `respond_to_assocs`
6
+
3
7
  ## 0.7.0 (2024-02-10)
4
8
 
5
9
  * Remove `to_hash` extend
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- syntax_tree_ext (0.7.0)
4
+ syntax_tree_ext (0.7.1)
5
5
  syntax_tree
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SyntaxTreeExt
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.1"
5
5
  end
@@ -51,7 +51,7 @@ module SyntaxTree
51
51
  end
52
52
 
53
53
  def keys
54
- if is_a?(BareAssocHash) || is_a?(HashLiteral)
54
+ if respond_to_assocs?
55
55
  assocs.map(&:key)
56
56
  else
57
57
  raise MethodNotSupported, "keys is not supported for #{self}"
@@ -59,7 +59,7 @@ module SyntaxTree
59
59
  end
60
60
 
61
61
  def values
62
- if is_a?(BareAssocHash) || is_a?(HashLiteral)
62
+ if respond_to_assocs?
63
63
  assocs.map(&:value)
64
64
  else
65
65
  raise MethodNotSupported, "values is not supported for #{self}"
@@ -67,7 +67,7 @@ module SyntaxTree
67
67
  end
68
68
 
69
69
  def hash_assoc(key)
70
- if is_a?(BareAssocHash) || is_a?(HashLiteral)
70
+ if respond_to_assocs?
71
71
  assocs.find { |assoc_node| assoc_node.key.to_value == key }
72
72
  else
73
73
  raise MethodNotSupported, "hash_assoc is not supported for #{self}"
@@ -75,7 +75,7 @@ module SyntaxTree
75
75
  end
76
76
 
77
77
  def hash_value(key)
78
- if is_a?(BareAssocHash) || is_a?(HashLiteral)
78
+ if respond_to_assocs?
79
79
  assocs.find { |assoc_node| assoc_node.key.to_value == key }&.value
80
80
  else
81
81
  raise MethodNotSupported, "hash_value is not supported for #{self}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syntax_tree_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.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: 2024-02-10 00:00:00.000000000 Z
11
+ date: 2024-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: syntax_tree