centroid 1.1.0.pre.alpha3 → 1.1.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/centroid.gemspec +1 -1
- data/lib/centroid.rb +2 -0
- data/test/centroid_test.rb +20 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b3f16a749848af2f78c074074d10450d30ae1a2
|
4
|
+
data.tar.gz: 4be849c2e61291bdd321ad33ea329d96fd2bd690
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d67614bf0beedf2f43140521ae37ea201282c5608f7763bb909750bb8db1dd88b982aecd5b9668248bc6fc44ce41b852fe296e3ad15672071f229702aa67fe9
|
7
|
+
data.tar.gz: 5cbc45a4b9a2c138ad803e82c03932127d2f5e36750dbc3deebaa22dd68ac2228b5cce61a85e485e96da354670b462707fc2d91727693042946a8818915ccf80
|
data/centroid.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'centroid'
|
3
|
-
s.version = '1.1.0
|
3
|
+
s.version = '1.1.0'
|
4
4
|
s.summary = 'A centralizaed paradigm to configuration management.'
|
5
5
|
s.description = 'Centroid is a tool for loading configuration values declared in JSON, and accessing those configuration values using object properties.'
|
6
6
|
s.author = 'Resource Data, Inc'
|
data/lib/centroid.rb
CHANGED
data/test/centroid_test.rb
CHANGED
@@ -7,6 +7,10 @@ class ConfigTests < Test::Unit::TestCase
|
|
7
7
|
'{"theEnvironment":{"theKey":"TheValue"}}'
|
8
8
|
end
|
9
9
|
|
10
|
+
def json_config_with_array
|
11
|
+
'{"theArray":[{"theKey": "Value1"},{"theKey": "Value2"}]}'
|
12
|
+
end
|
13
|
+
|
10
14
|
def shared_file_path
|
11
15
|
'config.json'
|
12
16
|
end
|
@@ -120,6 +124,22 @@ class ConfigTests < Test::Unit::TestCase
|
|
120
124
|
assert(!config.respond_to?(:does_not_exist))
|
121
125
|
end
|
122
126
|
|
127
|
+
def test_indexing_json_array
|
128
|
+
config = Centroid::Config.new(json_config_with_array)
|
129
|
+
assert_equal(config.the_array[0].the_key, "Value1")
|
130
|
+
assert_equal(config.the_array[1].the_key, "Value2")
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_enumerating_json_array
|
134
|
+
config = Centroid::Config.new(json_config_with_array)
|
135
|
+
itemCount = 0
|
136
|
+
config.the_array.each do |item|
|
137
|
+
assert_equal(item.the_key, config.the_array[itemCount].the_key)
|
138
|
+
itemCount += 1
|
139
|
+
end
|
140
|
+
assert_equal(itemCount, 2)
|
141
|
+
end
|
142
|
+
|
123
143
|
def test_enumerating_json_object
|
124
144
|
config = Centroid::Config.new(json_config)
|
125
145
|
itemCount = 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: centroid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Resource Data, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Centroid is a tool for loading configuration values declared in JSON,
|
14
14
|
and accessing those configuration values using object properties.
|
@@ -36,12 +36,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
36
36
|
version: '0'
|
37
37
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: '0'
|
42
42
|
requirements: []
|
43
43
|
rubyforge_project:
|
44
|
-
rubygems_version: 2.
|
44
|
+
rubygems_version: 2.4.1
|
45
45
|
signing_key:
|
46
46
|
specification_version: 4
|
47
47
|
summary: A centralizaed paradigm to configuration management.
|