code_analyzer 0.4.6 → 0.4.7

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
  SHA1:
3
- metadata.gz: 84254a2c93bfef8fd24e54f1830729c22cb24cb9
4
- data.tar.gz: d098c0883a5b139a4147118045f2c6ce3a76e034
3
+ metadata.gz: 7f096548a5fcf0ca019fb0068dd47e61210d3fde
4
+ data.tar.gz: cf822ded2b3877d376de8d24544fc7e0fac71407
5
5
  SHA512:
6
- metadata.gz: baddc030af7af45aba9b808432ea3374dd10231d0b1f4c1d0624499bb27319762405e2f318a42cf0a4102ac81833ccd1b535e0813e4ddfb9fa50a996bbf7ea18
7
- data.tar.gz: 0da69c9d2fc22b0db89a84b5b0f3435b06e1cfcb81cad98de5ead1bd34e89cbcdc8615b695d82b11155d1cfc608db4c1604ab4dfb52ab8dcdec397ea85d22136
6
+ metadata.gz: 6d3d8e34925d5dd51a7ff90301471b34ece615da44ce4162f8f7bbcb81d6cc1f802c010271273089afab22f294ee645484fdedab94cbae2f6d29bf456f4a36e4
7
+ data.tar.gz: dce0865b374883dc860951ce23496641ef04644c59a70bd6d50053778e9bc8b41afe063b999462cc875922f9e2fba28baadee9c2059116b65b05b08352c625b3
@@ -737,7 +737,7 @@ class Sexp
737
737
  def array_values
738
738
  case sexp_type
739
739
  when :array
740
- if nil == self[1]
740
+ if nil == self[1] || [:words_new, :qwords_new, :qsymbols_new].include?(self[1].sexp_type)
741
741
  []
742
742
  elsif [:words_add, :qwords_add, :qsymbols_add].include? self[1].sexp_type
743
743
  self[1].array_values
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module CodeAnalyzer
3
- VERSION = "0.4.6"
3
+ VERSION = "0.4.7"
4
4
  end
@@ -563,16 +563,31 @@ describe Sexp do
563
563
  expect(node.array_values.map(&:to_s)).to eq ["day", "week", "fortnight"]
564
564
  end
565
565
 
566
+ it "should get empty array values with array and words_add" do
567
+ node = parse_content("%W{}").grep_node(sexp_type: :array)
568
+ expect(node.array_values.map(&:to_s)).to eq []
569
+ end
570
+
566
571
  it "should get array value with array and qwords_add" do
567
572
  node = parse_content("%w(first_name last_name)").grep_node(sexp_type: :array)
568
573
  expect(node.array_values.map(&:to_s)).to eq ["first_name", "last_name"]
569
574
  end
570
575
 
576
+ it "should get empty array values with array and qwords_add" do
577
+ node = parse_content("%w()").grep_node(sexp_type: :array)
578
+ expect(node.array_values.map(&:to_s)).to eq []
579
+ end
580
+
571
581
  if RUBY_VERSION.to_i > 1
572
582
  it "should get array value with array and qsymbols_add" do
573
583
  node = parse_content("%i(first_name last_name)").grep_node(sexp_type: :array)
574
584
  expect(node.array_values.map(&:to_s)).to eq ["first_name", "last_name"]
575
585
  end
586
+
587
+ it "should get empty array values with array and qsymbols_new" do
588
+ node = parse_content("%i()").grep_node(sexp_type: :array)
589
+ expect(node.array_values.map(&:to_s)).to eq []
590
+ end
576
591
  end
577
592
  end
578
593
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-07 00:00:00.000000000 Z
11
+ date: 2016-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sexp_processor