codeclimate-yaml 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cc/yaml/nodes/mapping.rb +20 -3
- data/lib/cc/yaml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c87debedccaa398765218009e2510a9af9c7a65f
|
4
|
+
data.tar.gz: 5763001c96f55a2abc81863aa2a33e90cfd8eceb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40c5ecec68e59edfb2c518678a0cae4107e26844160f8823e2925d422aa1c7e7d586f0eb4fc7814e5eb903597b9fd9e696f06259b031d8e596fbf5bbcda5b883
|
7
|
+
data.tar.gz: b47ae770a431cf9a20c7274d7ae3a9392ab10d53a970bfbd841433db5660a479e2e37d4a23ae831d8eb173aee372d2eca7bfb7bc734536194671e00c44c3a013
|
@@ -51,16 +51,33 @@ module CC::Yaml
|
|
51
51
|
|
52
52
|
def visit_pair(visitor, key, value)
|
53
53
|
key = visitor.generate_key(self, key)
|
54
|
-
|
54
|
+
if get_warnings(key)
|
55
|
+
get_warnings(key)
|
56
|
+
else
|
57
|
+
visit_key_value(visitor, key, value)
|
58
|
+
end
|
55
59
|
end
|
56
60
|
|
57
61
|
def visit_key_value(visitor, key, value)
|
58
|
-
|
59
|
-
warning("has multiple %p entries, keeping last entry", key) if self[key]
|
62
|
+
node = subnode_for(key)
|
60
63
|
self[key] = node
|
61
64
|
visitor.accept(node, value)
|
62
65
|
end
|
63
66
|
|
67
|
+
def get_warnings(key)
|
68
|
+
if subnode_for(key)
|
69
|
+
check_duplicates(key)
|
70
|
+
elsif key == "languages"
|
71
|
+
warning("analysis by language not available via CLI. Use engines configuration instead.")
|
72
|
+
else
|
73
|
+
warning("unexpected key %p, dropping", key)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def check_duplicates(key)
|
78
|
+
warning("has multiple %p entries, keeping last entry", key) if self[key]
|
79
|
+
end
|
80
|
+
|
64
81
|
def []=(key, value)
|
65
82
|
if mapped_key = mapped_key(key)
|
66
83
|
unless value.is_a? Node
|
data/lib/cc/yaml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate-yaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: secure_string
|