dotyaml 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dotyaml.rb +15 -14
  3. data/lib/dotyaml/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc296bc1f064a155c1913ec85053d305c5d77349
4
- data.tar.gz: f1459313ae3f8685533f64612840cc79c3924fe8
3
+ metadata.gz: dd2f0d4358b79ef682d9ffbaca12e6be128574e2
4
+ data.tar.gz: 69a31851268c8dcd6636a35a8ccfa0a581b2a535
5
5
  SHA512:
6
- metadata.gz: 03ab910d46089fd591023703825cce75a42b3a239d23f917e324f5aad0b975fd1203fbb3d603bbc08ee8aa8caf48b396a8c4b11b2e0040afdd79655a2cf8d7ad
7
- data.tar.gz: 646e7064b29eef51e0c960676274bfd8d1ad5bc91c39b008bd61db9e0ebc93f2eca80b7d9837ca107b75726d0635b741c48d0d72d2afe2b39e12d9ce7fbcc9c2
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 = HashWithIndifferentAccess.new(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[:platform],
23
- :path => manifest[:path],
24
- :dependencies => manifest[:dependencies].map do |dependency|
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[:name],
33
- :requirement => dependency[:requirement],
34
- :type => dependency[:type],
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(test_name, nil)
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[:type], {}).fetch('tests', {}).fetch(test_name, nil)
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[:path]), {}).fetch('tests', {}).fetch(test_name, nil)
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[:platform], {}).fetch('tests', {}).fetch(test_name, nil)
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[:platform], {}).fetch(dependency[:name], {}).fetch('tests', {}).fetch(test_name, nil)
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]
@@ -1,3 +1,3 @@
1
1
  module Dotyaml
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.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-18 00:00:00.000000000 Z
11
+ date: 2016-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport