codeclimate-yaml 0.0.6 → 0.0.7
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/language_list.rb +6 -2
- data/lib/cc/yaml/nodes.rb +0 -1
- data/lib/cc/yaml/version.rb +1 -1
- metadata +1 -2
- data/lib/cc/yaml/nodes/language.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae155d660630ed6c713004789de2769e17b3b945
|
4
|
+
data.tar.gz: 608a2c96b26ba25431cdd1af2494e456a0e05511
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b8867df04a24d83ca590a9cce5ab200d3eae130a56f29e5629e102bfa133e94135d37be004eb86416f940e2d54285100bf0259ad293a1273f13be11c1d234d8
|
7
|
+
data.tar.gz: ff48f6a029744d085a9caaffc29847facef02316327cd66d81da69faf1595919f387cf84a4080a4121208253ee5bfcdf9a6448889fa33712d076032efae9795f
|
@@ -1,8 +1,12 @@
|
|
1
1
|
module CC
|
2
2
|
module Yaml
|
3
3
|
module Nodes
|
4
|
-
class LanguageList <
|
5
|
-
|
4
|
+
class LanguageList < Mapping
|
5
|
+
LANGUAGES = %w[Ruby JavaScript Python PHP].freeze
|
6
|
+
|
7
|
+
LANGUAGES.each do |language|
|
8
|
+
map :"#{language}", to: Scalar[:bool], required: false
|
9
|
+
end
|
6
10
|
end
|
7
11
|
end
|
8
12
|
end
|
data/lib/cc/yaml/nodes.rb
CHANGED
@@ -5,7 +5,6 @@ module CC
|
|
5
5
|
autoload :EngineList, "cc/yaml/nodes/engine_list"
|
6
6
|
autoload :Glob, "cc/yaml/nodes/glob"
|
7
7
|
autoload :GlobList, "cc/yaml/nodes/glob_list"
|
8
|
-
autoload :Language, "cc/yaml/nodes/language"
|
9
8
|
autoload :LanguageList, "cc/yaml/nodes/language_list"
|
10
9
|
autoload :Mapping, "cc/yaml/nodes/mapping"
|
11
10
|
autoload :Node, "cc/yaml/nodes/node"
|
data/lib/cc/yaml/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
@@ -50,7 +50,6 @@ files:
|
|
50
50
|
- lib/cc/yaml/nodes/engine_list.rb
|
51
51
|
- lib/cc/yaml/nodes/glob.rb
|
52
52
|
- lib/cc/yaml/nodes/glob_list.rb
|
53
|
-
- lib/cc/yaml/nodes/language.rb
|
54
53
|
- lib/cc/yaml/nodes/language_list.rb
|
55
54
|
- lib/cc/yaml/nodes/mapping.rb
|
56
55
|
- lib/cc/yaml/nodes/node.rb
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module CC
|
2
|
-
module Yaml
|
3
|
-
module Nodes
|
4
|
-
class Language < Scalar
|
5
|
-
LANGUAGES = %w[Ruby JavaScript Python PHP].freeze
|
6
|
-
|
7
|
-
def valid?
|
8
|
-
LANGUAGES.include?(name)
|
9
|
-
end
|
10
|
-
|
11
|
-
def name
|
12
|
-
to_s
|
13
|
-
end
|
14
|
-
|
15
|
-
def appears_to_be_mispelled_version_of?
|
16
|
-
if !valid? && downcased_language_map.has_key?(name.downcase)
|
17
|
-
downcased_language_map[self]
|
18
|
-
else
|
19
|
-
false
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def downcased_language_map
|
24
|
-
@downcased_language_map ||=
|
25
|
-
LANGUAGES.each_with_object({}) do |language, obj|
|
26
|
-
obj[language.downcase] = language
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|