dotyaml 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dotyaml.rb +15 -14
- data/lib/dotyaml/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: dd2f0d4358b79ef682d9ffbaca12e6be128574e2
|
4
|
+
data.tar.gz: 69a31851268c8dcd6636a35a8ccfa0a581b2a535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff61fdb67a6f17584104528b5c717a90af53c4bfa5fe55ab339eb68e6d6742fa2d1f15caedfee31acf3cff13f481cad7197ecc5ce1aa680e6c0aefc033da7a10
|
7
|
+
data.tar.gz: 76f113b0454f2caa0504913c305d3a5d86c2f7633300c1356d27727db302e7eb6f6604cf1040902608731c6f8665a18a1630f6f99da78fa4daace7c8e9626aed
|
data/lib/dotyaml.rb
CHANGED
@@ -7,8 +7,8 @@ module Dotyaml
|
|
7
7
|
attr_accessor :config
|
8
8
|
|
9
9
|
def initialize(manifests, config)
|
10
|
-
@manifests = manifests
|
11
|
-
@config =
|
10
|
+
@manifests = manifests.map{|m| m.deep_transform_keys{ |key| key.to_s.downcase } }
|
11
|
+
@config = config.deep_transform_keys{ |key| key.to_s.downcase }
|
12
12
|
end
|
13
13
|
|
14
14
|
def setup
|
@@ -19,9 +19,9 @@ module Dotyaml
|
|
19
19
|
|
20
20
|
def map_manifest(manifest)
|
21
21
|
{
|
22
|
-
:platform => manifest[
|
23
|
-
:path => manifest[
|
24
|
-
:dependencies => manifest[
|
22
|
+
:platform => manifest['platform'],
|
23
|
+
:path => manifest['path'],
|
24
|
+
:dependencies => manifest['dependencies'].map do |dependency|
|
25
25
|
map_dependency(manifest, dependency)
|
26
26
|
end
|
27
27
|
}
|
@@ -29,36 +29,37 @@ module Dotyaml
|
|
29
29
|
|
30
30
|
def map_dependency(manifest, dependency)
|
31
31
|
{
|
32
|
-
:name => dependency[
|
33
|
-
:requirement => dependency[
|
34
|
-
:type => dependency[
|
32
|
+
:name => dependency['name'],
|
33
|
+
:requirement => dependency['requirement'],
|
34
|
+
:type => dependency['type'],
|
35
35
|
:tests => tests.map do |test_name, default_value|
|
36
|
-
map_test(manifest, dependency, test_name, default_value)
|
36
|
+
map_test(manifest, dependency, test_name, default_value.downcase)
|
37
37
|
end.to_h
|
38
38
|
}
|
39
39
|
end
|
40
40
|
|
41
41
|
def map_test(manifest, dependency, test_name, default_value)
|
42
42
|
should_run = default_value
|
43
|
+
test_name_key = test_name.to_s.downcase
|
43
44
|
|
44
45
|
# test name
|
45
|
-
test_name_config = config.fetch('tests', {}).fetch(
|
46
|
+
test_name_config = config.fetch('tests', {}).fetch(test_name_key, nil)
|
46
47
|
should_run = test_name_config if test_name_config
|
47
48
|
|
48
49
|
# type
|
49
|
-
type_config = config.fetch('types', {}).fetch(dependency[
|
50
|
+
type_config = config.fetch('types', {}).fetch(dependency['type'].to_s.downcase, {}).fetch('tests', {}).fetch(test_name_key, nil)
|
50
51
|
should_run = type_config if type_config
|
51
52
|
|
52
53
|
# filename
|
53
|
-
filename_config = config.fetch('files', {}).fetch(remove_tmp_path(manifest[
|
54
|
+
filename_config = config.fetch('files', {}).fetch(remove_tmp_path(manifest['path'].to_s.downcase), {}).fetch('tests', {}).fetch(test_name_key, nil)
|
54
55
|
should_run = filename_config if filename_config
|
55
56
|
|
56
57
|
# platform
|
57
|
-
platform_config = config.fetch('platforms', {}).fetch(manifest[
|
58
|
+
platform_config = config.fetch('platforms', {}).fetch(manifest['platform'].to_s.downcase, {}).fetch('tests', {}).fetch(test_name_key, nil)
|
58
59
|
should_run = platform_config if platform_config
|
59
60
|
|
60
61
|
# project name
|
61
|
-
project_config = config.fetch('platforms', {}).fetch(manifest[
|
62
|
+
project_config = config.fetch('platforms', {}).fetch(manifest['platform'].to_s.downcase, {}).fetch(dependency['name'].to_s.downcase, {}).fetch('tests', {}).fetch(test_name_key, nil)
|
62
63
|
should_run = project_config if project_config
|
63
64
|
|
64
65
|
[test_name, should_run.to_s]
|
data/lib/dotyaml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotyaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|