configger_service 1.0.5 → 1.0.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 374fb69d45d7a4b3a751f508a593ab1c8a048e88
|
4
|
+
data.tar.gz: b37443f8b59aea13fd6a79f5ec0a37105362bc53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c78e135362e13cbb312722f13402f0c426aaa518d52a9af86759191785d6d88031fa2fdba00441899880c7df7f34f73b8227056c0ede0d2a41bc9f139e8c0206
|
7
|
+
data.tar.gz: 6c4649480798180bc457af97d01ff632c9674b50943782a47ffa1416259929a615b1a737d78de98edb7589fac7b9b09fe06b0e61e36fb81860c92a9448bec9bc
|
@@ -1,15 +1,15 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'configger_service'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.6'
|
4
4
|
s.summary = "A gem to load config yml files"
|
5
5
|
s.description = "A gem to load config yml files"
|
6
6
|
s.authors = ['Linh Chau', 'John Thomas']
|
7
7
|
s.email = 'thomas07vt@gmail.com'
|
8
8
|
s.files = [
|
9
|
-
'./
|
10
|
-
'lib/services/
|
9
|
+
'./configger_service.gemspec', 'lib/configger_service.rb',
|
10
|
+
'lib/services/configger_service.rb', 'lib/utils/hash_utils.rb'
|
11
11
|
]
|
12
|
-
s.homepage = 'https://github.com/thomas07vt/
|
12
|
+
s.homepage = 'https://github.com/thomas07vt/configger_service'
|
13
13
|
s.license = 'MIT'
|
14
14
|
s.add_runtime_dependency 'logging'
|
15
15
|
s.add_runtime_dependency 'activesupport'
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
require 'ostruct'
|
3
|
-
require_relative 'services/
|
3
|
+
require_relative 'services/configger_service'
|
4
4
|
|
5
5
|
def load_gem_lib(sub_path)
|
6
|
-
spec = Gem::Specification.find_by_name('
|
6
|
+
spec = Gem::Specification.find_by_name('configger_service')
|
7
7
|
rb_files = Dir.glob("#{spec.gem_dir}/lib/#{sub_path}/*.rb")
|
8
8
|
rb_files.each { |rb_file| require rb_file }
|
9
9
|
rescue Exception => error
|
@@ -13,5 +13,5 @@ end
|
|
13
13
|
['utils', 'services'].each do |sub_path|
|
14
14
|
load_gem_lib(sub_path)
|
15
15
|
rb_files = Dir.glob("#{File.expand_path('.')}/lib/#{sub_path}/*.rb")
|
16
|
-
rb_files.each { |rb_file| require rb_file }
|
17
|
-
end
|
16
|
+
rb_files.each { |rb_file| require rb_file }
|
17
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'active_support'
|
2
2
|
require 'active_support/core_ext'
|
3
3
|
|
4
|
-
class
|
4
|
+
class ConfiggerService
|
5
5
|
class << self
|
6
6
|
def load_config(config_file_name)
|
7
7
|
app_root = (defined? APP_ROOT)? APP_ROOT : File.expand_path('.')
|
8
|
-
|
8
|
+
|
9
9
|
config_file = nil
|
10
10
|
['conf', 'config'].each do |sub_path|
|
11
11
|
if File.exist?("#{app_root}/#{sub_path}/#{config_file_name}")
|
@@ -13,7 +13,7 @@ class ConfigService
|
|
13
13
|
break
|
14
14
|
end
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
raise("#{Time.now.strftime("%m/%d/%Y %H:%M:%S.%3N %z")} ERROR: ConfigService#load_config #{config_file_name} file not found.") unless config_file
|
18
18
|
|
19
19
|
HashUtils.hash_to_open_struct(YAML.load_file(config_file))
|
@@ -27,4 +27,7 @@ class ConfigService
|
|
27
27
|
'development'
|
28
28
|
end
|
29
29
|
end # class methods
|
30
|
-
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Backward compatibility
|
33
|
+
ConfigService = ConfiggerService
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configger_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linh Chau
|
@@ -59,11 +59,11 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- "./
|
63
|
-
- lib/
|
64
|
-
- lib/services/
|
62
|
+
- "./configger_service.gemspec"
|
63
|
+
- lib/configger_service.rb
|
64
|
+
- lib/services/configger_service.rb
|
65
65
|
- lib/utils/hash_utils.rb
|
66
|
-
homepage: https://github.com/thomas07vt/
|
66
|
+
homepage: https://github.com/thomas07vt/configger_service
|
67
67
|
licenses:
|
68
68
|
- MIT
|
69
69
|
metadata: {}
|