uber_config 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/lib/uber_config.rb +6 -6
- data/lib/uber_config/version.rb +1 -1
- metadata +7 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12cf3592deddc3e2ab965df0ad9739f3ae45c95e
|
4
|
+
data.tar.gz: fd4d0fcb3fd7480c885ddf7078baf9244891daed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c82c82fb6c5b2cf4100fb3713de9e57d20155d1b826b198783079c34e29aebf2e81db059af04b321d91fc2c4ff1206d8b61c013ad66bf9251eeaaa1e865f09bf
|
7
|
+
data.tar.gz: 2284072514887d08551465bf59361bfec2f31903748f824bd6a581de15289adb0e0672c27fb1ab6762741ded8dc5566c90e4178ff0d746dfc54a6bf826a87e6b
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Just run:
|
|
12
12
|
|
13
13
|
config = UberConfig.load
|
14
14
|
|
15
|
-
It will look `config.yml` or `config.json` by default. You can change what it will look for and
|
15
|
+
It will look for `config.yml` or `config.json` by default. You can change what it will look for and
|
16
16
|
where with the different load() options.
|
17
17
|
|
18
18
|
Here is the order of where it looks:
|
@@ -31,3 +31,14 @@ Here is the order of where it looks:
|
|
31
31
|
|
32
32
|
:dir can be used to change working_directory_name.
|
33
33
|
|
34
|
+
## Store config in IronCache and using it with Heroku
|
35
|
+
|
36
|
+
Add this to your Rakefile:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
task :push do
|
40
|
+
UberConfig.push_heroku
|
41
|
+
end
|
42
|
+
```
|
43
|
+
|
44
|
+
Then `rake push`.
|
data/lib/uber_config.rb
CHANGED
@@ -26,18 +26,18 @@ module UberConfig
|
|
26
26
|
|
27
27
|
# First check for abt config: https://github.com/iron-io/abt
|
28
28
|
if defined? $abt_config
|
29
|
-
logger.
|
29
|
+
logger.debug "$abt_config found."
|
30
30
|
@config = $abt_config
|
31
31
|
return @config
|
32
32
|
end
|
33
33
|
|
34
34
|
if ENV['CONFIG_CACHE_KEY']
|
35
|
-
logger.
|
35
|
+
logger.debug "ENV[CONFIG_CACHE_KEY] found."
|
36
36
|
logger.debug "Getting config from #{ENV['CONFIG_CACHE_KEY']}"
|
37
37
|
config_from_cache = open(ENV['CONFIG_CACHE_KEY']).read
|
38
38
|
config_from_cache = JSON.parse(config_from_cache)
|
39
39
|
config_from_cache = YAML.load(config_from_cache['value'])
|
40
|
-
logger.
|
40
|
+
logger.debug "Got config from cache."
|
41
41
|
set_default_proc(config_from_cache)
|
42
42
|
return config_from_cache
|
43
43
|
end
|
@@ -52,7 +52,7 @@ module UberConfig
|
|
52
52
|
|
53
53
|
file = options[:file] || "config"
|
54
54
|
ext = options[:ext]
|
55
|
-
# let env variables override. Useful for things like minitest which don't allow you to pass in cli args to the tests.
|
55
|
+
# let env variables override. Useful for things like minitest which don't allow you to pass in cli args to the tests.
|
56
56
|
if ENV['CONFIGDIR']
|
57
57
|
dir = ENV['CONFIGDIR']
|
58
58
|
end
|
@@ -66,7 +66,7 @@ module UberConfig
|
|
66
66
|
if ARGV.include?('--configfile')
|
67
67
|
file = ARGV[ARGV.index('--configfile') + 1]
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
filenames = []
|
71
71
|
if file.include?(".") # then has extension
|
72
72
|
filenames << file
|
@@ -134,7 +134,7 @@ module UberConfig
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def self.load_from(cf)
|
137
|
-
logger.
|
137
|
+
logger.debug "Checking for config file at #{cf}..."
|
138
138
|
if File.exist?(cf)
|
139
139
|
config = YAML::load_file(cf)
|
140
140
|
# the following makes it indifferent access, but doesn't seem to for inner hashes
|
data/lib/uber_config/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uber_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Reeder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Loads configs from common locations.
|
14
14
|
email:
|
@@ -17,7 +17,7 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- .gitignore
|
20
|
+
- ".gitignore"
|
21
21
|
- Gemfile
|
22
22
|
- README.md
|
23
23
|
- Rakefile
|
@@ -38,22 +38,18 @@ require_paths:
|
|
38
38
|
- lib
|
39
39
|
required_ruby_version: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- -
|
41
|
+
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
44
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
requirements: []
|
50
50
|
rubyforge_project: uber_config
|
51
|
-
rubygems_version: 2.
|
51
|
+
rubygems_version: 2.4.5
|
52
52
|
signing_key:
|
53
53
|
specification_version: 4
|
54
54
|
summary: Loads configs from common locations.
|
55
|
-
test_files:
|
56
|
-
- test/config.json
|
57
|
-
- test/config.yml
|
58
|
-
- test/config2.json
|
59
|
-
- test/test_uber_config.rb
|
55
|
+
test_files: []
|