app_config_loader 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af7599d6ae9f0d3b78dc84c98ba95af7eba9999d
4
- data.tar.gz: 73403a0498d2f8b518cd1f33e6de5267d205938d
3
+ metadata.gz: 7a9784e8b7cbbb457d574c16c03a76a8c647de00
4
+ data.tar.gz: 8f96083cbcb8493b9fb250fafb763e67552d2400
5
5
  SHA512:
6
- metadata.gz: eb5b8805a947bf0bbe9aae295b3f8d0b04369631c6b78cbbc491ba62c4c697dff17375f80465a773a3aa44bea3aa1f4ad0dfa3c1168aea5ddd3790fa3a33bdf8
7
- data.tar.gz: 29560b75a9d77fa13ea173de079eb0fbb966ab122df19de33103b3d23a6740edda43a4cc8ce8e6deccd5cb20cc746ef7b6b888c7f9116dbe28c15e6aa9ffd6bf
6
+ metadata.gz: 7a79629f517c0e2b2a895780d2043f6cb90dd22babd6482f53f22bf0000ac1777de269e955b72381779bc5abdae41d7232afd5618a5a9e80839bc8189aa1dbdd
7
+ data.tar.gz: 04944fbfe2ecc152ebeaec0a15834df3a0dc8b4f675f470c7faed8eee5c4d19308c38efdeb4cd95592a6f01ff9d8b853c097ccfb84bfd9726f0b7946613cf526
data/.gitignore CHANGED
@@ -8,6 +8,8 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
 
11
+ /builds
12
+
11
13
  # rbenv
12
14
  .ruby-version
13
15
 
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # CHANGELOG
2
+
3
+ ## [v1.0.1](https://github.com/lscspirit/app_config_loader/tree/v1.0.1) (2017-01-12)
4
+ [Full list of commits](https://github.com/lscspirit/app_config_loader/compare/58ae3bea8d929ce97ac2985f4485d435bd6056c6...v1.0.1)
5
+
6
+ - allow the gem to work in non-Rails environment
data/README.md CHANGED
@@ -36,10 +36,10 @@ APP_CONFIG = AppConfigLoader.load
36
36
  From this point onward, you can access your app config values through `APP_CONFIG`.
37
37
 
38
38
  ```ruby
39
- # when AppConfigLoader' env is not "production"
39
+ # when AppConfigLoader's env is not "production"
40
40
  APP_CONFIG['some_service.host'] # => 'dev.someservice.com'
41
41
 
42
- # when AppConfigLoader' env is set to "production"
42
+ # when AppConfigLoader's env is set to "production"
43
43
  APP_CONFIG['some_service.host'] # => 'prod.someservice.com'
44
44
  ```
45
45
 
@@ -1,3 +1,5 @@
1
+ require 'erb'
2
+
1
3
  module AppConfigLoader
2
4
  class Loader
3
5
  def initialize(config)
@@ -45,7 +47,7 @@ module AppConfigLoader
45
47
  private
46
48
 
47
49
  def parse_yml(path)
48
- @parser.parse ERB.new(File.read(path)).result
50
+ @parser.parse ::ERB.new(File.read(path)).result
49
51
  end
50
52
 
51
53
  # Expands the list of path entries into absolute paths for each matching files
@@ -1,3 +1,3 @@
1
1
  module AppConfigLoader
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -21,9 +21,9 @@ module AppConfigLoader
21
21
 
22
22
  def self.default_config
23
23
  cfg = AppConfigLoader::Config.new
24
- cfg.env = Rails.env
25
- cfg.config_paths << Rails.root.join('config', 'app_configs')
26
- cfg.local_overrides = Rails.root.join('config', 'app_configs', 'local_overrides.yml')
24
+ cfg.env = defined?(Rails) ? Rails.env : 'development'
25
+ cfg.config_paths << (defined?(Rails) ? Rails.root.join('config', 'app_configs') : File.join(__dir__, 'app_configs'))
26
+ cfg.local_overrides = defined? (Rails) ? Rails.root.join('config', 'app_configs', 'local_overrides.yml') : File.join(__dir__, 'config', 'local_overrides.yml')
27
27
  cfg
28
28
  end
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_config_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derrick Yeung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-11 00:00:00.000000000 Z
11
+ date: 2017-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -76,6 +76,7 @@ extra_rdoc_files: []
76
76
  files:
77
77
  - .gitignore
78
78
  - .travis.yml
79
+ - CHANGELOG.md
79
80
  - Gemfile
80
81
  - LICENSE.txt
81
82
  - README.md