tp_common 0.4.3.pre2 → 0.4.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dff90dbcae8e77f5b4134c0f6e6f4e3262dd9322d016608f1ac9539121159995
|
4
|
+
data.tar.gz: 820f9673201b594b22303de7c9733651a79360ef878ec9fd7b6ea0afcafd774d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba4f5345766b402aca620aca594996a3a7e7b7632778783f9f11fd3d0a9e4c55ff5def0fbd94a16f3e8d88ba6f7292085603c49f12816c60da914dc4f79f6dbe
|
7
|
+
data.tar.gz: f88a0d981a1060b82add6104311e80fc8834b850c9ce9339bdd5d900d68021323988aef193ce311aee5a929de54713dbef9d8a981d561229f9c9bb0a55a696bc
|
data/lib/tp_common/app_config.rb
CHANGED
@@ -39,6 +39,11 @@ module TpCommon
|
|
39
39
|
@app_config[key]
|
40
40
|
end
|
41
41
|
|
42
|
+
# Clear @app_config, use for testing only
|
43
|
+
def clear!
|
44
|
+
@app_config = nil
|
45
|
+
end
|
46
|
+
|
42
47
|
private
|
43
48
|
|
44
49
|
def load_config
|
@@ -59,11 +64,7 @@ module TpCommon
|
|
59
64
|
end
|
60
65
|
|
61
66
|
def load_yaml_config
|
62
|
-
file_path =
|
63
|
-
File.join(Rails.root,'config/app_config.yml')
|
64
|
-
else
|
65
|
-
File.join(File.dirname(__FILE__),'app_config.yml')
|
66
|
-
end
|
67
|
+
file_path = File.join(project_root, 'config', 'app_config.yml')
|
67
68
|
|
68
69
|
yaml = Pathname.new(file_path)
|
69
70
|
if yaml.exist?
|
@@ -88,6 +89,18 @@ module TpCommon
|
|
88
89
|
end
|
89
90
|
end
|
90
91
|
end
|
92
|
+
|
93
|
+
def project_root
|
94
|
+
if defined?(Rails)
|
95
|
+
return Rails.root
|
96
|
+
end
|
97
|
+
|
98
|
+
if defined?(Bundler)
|
99
|
+
return Bundler.root
|
100
|
+
end
|
101
|
+
|
102
|
+
Dir.pwd
|
103
|
+
end
|
91
104
|
end
|
92
105
|
end
|
93
106
|
end
|
data/lib/tp_common/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tp_common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.3
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TINYpulse Devops
|
@@ -265,9 +265,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
265
265
|
version: '0'
|
266
266
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
267
|
requirements:
|
268
|
-
- - "
|
268
|
+
- - ">="
|
269
269
|
- !ruby/object:Gem::Version
|
270
|
-
version:
|
270
|
+
version: '0'
|
271
271
|
requirements: []
|
272
272
|
rubygems_version: 3.0.3
|
273
273
|
signing_key:
|