uber_config 1.0.5 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +6 -0
- data/lib/uber_config.rb +17 -1
- data/lib/uber_config/version.rb +1 -1
- metadata +7 -9
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0653f48863c6501d9694884b5cfb5af601dc312f
|
4
|
+
data.tar.gz: f6350f2d66ddebdf9f2358e0326235faa518ada8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eea5daa9bb800cef8ca6963aad86a0712b82c61c389df646021a80a95e4a3ee317afa6a9a65925e09b19da27e2bf0e1878468720620884fd339c05da7ca77546
|
7
|
+
data.tar.gz: e3922efbb0dc94bc1f39f78d9d581ba8dd0614cb764507bcd7c243c0a1757da148fb576878a5dd1ae6f1bf37ea6406e0238e9221759d71e617c59af4c0dd05ce
|
data/README.md
CHANGED
@@ -18,6 +18,12 @@ where with the different load() options.
|
|
18
18
|
Here is the order of where it looks:
|
19
19
|
|
20
20
|
- $abt_config global variable (for https://github.com/iron-io/abt)
|
21
|
+
- HTTP url of an IronCache entry set in ENV['CONFIG_CACHE_KEY']
|
22
|
+
- TODO: any http url set in ENV['CONFIGURL'], should parse body
|
23
|
+
- look at directory set by ENV['CONFIGDIR']
|
24
|
+
- look at directory set by cli argument --configdir
|
25
|
+
- look for file name set by ENV['CONFIGFILE']
|
26
|
+
- look for file name set by cli argument --configfile
|
21
27
|
- directory of file that calls UberConfig.load
|
22
28
|
- working directory
|
23
29
|
- TODO: look at ~/configs/#{working_directory_name} directory
|
data/lib/uber_config.rb
CHANGED
@@ -52,6 +52,21 @@ 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.
|
56
|
+
if ENV['CONFIGDIR']
|
57
|
+
dir = ENV['CONFIGDIR']
|
58
|
+
end
|
59
|
+
if ENV['CONFIGFILE']
|
60
|
+
file = ENV['CONFIGFILE']
|
61
|
+
end
|
62
|
+
# let cli args override
|
63
|
+
if ARGV.include?('--configdir')
|
64
|
+
dir = ARGV[ARGV.index('--configdir') + 1]
|
65
|
+
end
|
66
|
+
if ARGV.include?('--configfile')
|
67
|
+
file = ARGV[ARGV.index('--configfile') + 1]
|
68
|
+
end
|
69
|
+
|
55
70
|
filenames = []
|
56
71
|
if file.include?(".") # then has extension
|
57
72
|
filenames << file
|
@@ -83,8 +98,9 @@ module UberConfig
|
|
83
98
|
# Now check near caller file
|
84
99
|
filenames.each do |file|
|
85
100
|
dir_and_file = dir.nil? ? [] : dir.dup
|
101
|
+
p dir_and_file
|
86
102
|
dir_and_file << file
|
87
|
-
|
103
|
+
p dir_and_file
|
88
104
|
location = File.join(dir_and_file)
|
89
105
|
#p location
|
90
106
|
cf = File.expand_path(location, caller_dir)
|
data/lib/uber_config/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uber_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Travis Reeder
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-09-24 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Loads configs from common locations.
|
15
14
|
email:
|
@@ -32,26 +31,25 @@ files:
|
|
32
31
|
- uber_config.gemspec
|
33
32
|
homepage: ''
|
34
33
|
licenses: []
|
34
|
+
metadata: {}
|
35
35
|
post_install_message:
|
36
36
|
rdoc_options: []
|
37
37
|
require_paths:
|
38
38
|
- lib
|
39
39
|
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
40
|
requirements:
|
42
|
-
- -
|
41
|
+
- - '>='
|
43
42
|
- !ruby/object:Gem::Version
|
44
43
|
version: '0'
|
45
44
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
-
none: false
|
47
45
|
requirements:
|
48
|
-
- -
|
46
|
+
- - '>='
|
49
47
|
- !ruby/object:Gem::Version
|
50
48
|
version: '0'
|
51
49
|
requirements: []
|
52
50
|
rubyforge_project: uber_config
|
53
|
-
rubygems_version: 1.
|
51
|
+
rubygems_version: 2.1.4
|
54
52
|
signing_key:
|
55
|
-
specification_version:
|
53
|
+
specification_version: 4
|
56
54
|
summary: Loads configs from common locations.
|
57
55
|
test_files: []
|