code_analyzer 0.5.3 → 0.5.4

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: 4455e3247da8def6aaed2fd3a0f677be5e563c38f67c58e3afda1292958685d1
4
- data.tar.gz: 9f9034f8704c2df789d5182be9c6bb01ea8d83785dd91699e7d5f2b73a2a3c72
3
+ metadata.gz: 6649593166b051c563e05a6a3a2130a1d369a6b828e5477a2f3d392f15ea691f
4
+ data.tar.gz: e78c03b663ad0951deee38f8202eaa73613a88690ccb5e43b07d81b3ca971f57
5
5
  SHA512:
6
- metadata.gz: c8e7a551087cf2be47f0dfb3d8e34dc2234227bd12a2f97d26747f1d2682c54c4aa3e59c70b6ff3c930f74210e27c845bd8897b5d1c82155a8b596d2defba025
7
- data.tar.gz: 50a1841f6e96d84c6839d6ba30cee28d0be769ac80d9905f36a77709c59c1a57ee72ecdee36aa72bc80d6e30b373d1a0dde881036b728b89a0b254d425e277f2
6
+ metadata.gz: 395be11e15e5a7ff181c381c1790b4b826c849d1ae4e1aadb1f002a9825f2976e3c696c4b710593c6b57d7e1d6cc742364ba24b2c9a4b5859e01ba86a1fd8a5b
7
+ data.tar.gz: 5aedb0a332cab72f10ad39dff8cc395133f8fb5170ae82ae7d01b8af9073a16d9d6c994af4046ab3f99ffd4edfbb0075fad5c0510b6bcbf83db6f0add433c03a
@@ -706,6 +706,8 @@ class Sexp
706
706
  # s(:string_literal, s(:string_add, s(:string_content), s(:@tstring_content, "Richard", s(1, 14))))
707
707
  def value
708
708
  if :assoc_new == sexp_type
709
+ return self[2] if :array == self[2].sexp_type
710
+
709
711
  self[2].to_s
710
712
  end
711
713
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CodeAnalyzer
4
- VERSION = '0.5.3'
4
+ VERSION = '0.5.4'
5
5
  end
@@ -662,6 +662,14 @@ describe Sexp do
662
662
  )
663
663
  expect(node.value).to eq 'Richard'
664
664
  end
665
+
666
+ it 'should get array value for assoc_new' do
667
+ node =
668
+ parse_content("add_user :user, name: %w[Richard Huang]").grep_node(
669
+ sexp_type: :assoc_new
670
+ )
671
+ expect(node.value.array_values.map(&:to_s)).to eq ['Richard', 'Huang']
672
+ end
665
673
  end
666
674
 
667
675
  describe 'array_size' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang