tp_common 0.4.3.pre2 → 0.4.3

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
  SHA256:
3
- metadata.gz: 65d4bd6ac845522f0e2e8535de63543f6b96405ca6cf039eaf186dfae390322d
4
- data.tar.gz: e6e0df92af5db1cdab297d72d2d7dd6709020db43c37c1a25ae809504f496602
3
+ metadata.gz: dff90dbcae8e77f5b4134c0f6e6f4e3262dd9322d016608f1ac9539121159995
4
+ data.tar.gz: 820f9673201b594b22303de7c9733651a79360ef878ec9fd7b6ea0afcafd774d
5
5
  SHA512:
6
- metadata.gz: 46e93abb7eaad65f3fc99436ced2b264bf2e6e3073a0fdd9398f610eec8967dd2f311a44387639694b70a9a01f1f9f9154b3850fc4853c226e2cb80d10383a5b
7
- data.tar.gz: e4480c23da83713b298b99091ad37e2d6169829d005a459c4c34783d598bb01c2d02215311a03cd25a8645e5c7b76574351ab33ad983f6519c99135da79dde1d
6
+ metadata.gz: ba4f5345766b402aca620aca594996a3a7e7b7632778783f9f11fd3d0a9e4c55ff5def0fbd94a16f3e8d88ba6f7292085603c49f12816c60da914dc4f79f6dbe
7
+ data.tar.gz: f88a0d981a1060b82add6104311e80fc8834b850c9ce9339bdd5d900d68021323988aef193ce311aee5a929de54713dbef9d8a981d561229f9c9bb0a55a696bc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- tp_common (0.4.3.pre2)
4
+ tp_common (0.4.3)
5
5
  activesupport (>= 4.2.0, < 6.0)
6
6
  aws-sdk-s3 (~> 1.19)
7
7
  fog-aws (~> 2.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- tp_common (0.4.3.pre2)
4
+ tp_common (0.4.3)
5
5
  activesupport (>= 4.2.0, < 6.0)
6
6
  aws-sdk-s3 (~> 1.19)
7
7
  fog-aws (~> 2.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- tp_common (0.4.3.pre2)
4
+ tp_common (0.4.3)
5
5
  activesupport (>= 4.2.0, < 6.0)
6
6
  aws-sdk-s3 (~> 1.19)
7
7
  fog-aws (~> 2.0)
@@ -1 +1,9 @@
1
1
  require "tp_common/app_config/environment"
2
+
3
+ module TpCommon
4
+ module AppConfig
5
+ def self.[](key)
6
+ TpCommon::AppConfig::Environment.fetch(key)
7
+ end
8
+ end
9
+ end
@@ -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 = if defined?(Rails)
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
@@ -1,3 +1,3 @@
1
1
  module TpCommon
2
- VERSION = "0.4.3.pre2"
2
+ VERSION = "0.4.3"
3
3
  end
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.pre2
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: 1.3.1
270
+ version: '0'
271
271
  requirements: []
272
272
  rubygems_version: 3.0.3
273
273
  signing_key: