appydays 0.4.0 → 0.5.1
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 +4 -4
- data/lib/appydays/configurable.rb +11 -6
- data/lib/appydays/dotenviable.rb +11 -1
- data/lib/appydays/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80170682f5494542ea76d2d6fd4301acbbfd7c5b8388b3d431ae2c7daa7e03d0
|
4
|
+
data.tar.gz: 1dae7bcb7f56835bc39f8562d708fada45e3dd8e555f26246a3165bcd2970ab4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2110baac67b50e765f0b7d2306f71f007d75b89cbc25dde2f5602e25882a1ce01592c94919f1bff6f0093066f30e8983dd73e4b8b420a0ffde94ed301f72e78d
|
7
|
+
data.tar.gz: 98b244ba6540e6a53e437d32278db78e5451f74553924cf2d09df0237e089e44d1ce2922440faf6dc381a85d2ccbbdd415fc1f27dfb73537b9703efe0e012cc4
|
@@ -49,10 +49,14 @@ module Appydays::Configurable
|
|
49
49
|
end
|
50
50
|
|
51
51
|
##
|
52
|
-
# Restore all settings back to the values they were at config time
|
53
|
-
#
|
54
|
-
|
55
|
-
|
52
|
+
# Restore all settings back to the values they were at config time
|
53
|
+
# (undoes any manual attribute writes), and runs after_configured hooks.
|
54
|
+
#
|
55
|
+
# overrides can be passed, to apply new manual overrides
|
56
|
+
# before running after_configured hooks.
|
57
|
+
# This is very useful when testing classes that have an after_configured hook.
|
58
|
+
def reset_configuration(overrides={})
|
59
|
+
self._configuration_installer._reset(overrides)
|
56
60
|
end
|
57
61
|
|
58
62
|
##
|
@@ -154,9 +158,10 @@ module Appydays::Configurable
|
|
154
158
|
end
|
155
159
|
end
|
156
160
|
|
157
|
-
def _reset
|
161
|
+
def _reset(overrides)
|
158
162
|
@settings.each do |k, v|
|
159
|
-
|
163
|
+
real_v = overrides.fetch(k, v)
|
164
|
+
@target.send("#{k}=".to_sym, real_v)
|
160
165
|
end
|
161
166
|
self._run_after_configured
|
162
167
|
end
|
data/lib/appydays/dotenviable.rb
CHANGED
@@ -9,8 +9,17 @@ require "appydays/version"
|
|
9
9
|
# (by convention, .env.<env>.local, .env.<env>, and .env).
|
10
10
|
#
|
11
11
|
# It can be called multiple times for the same environment.
|
12
|
+
# There are a couple special cases for RACK_ENV and PORT variables:
|
12
13
|
#
|
13
|
-
#
|
14
|
+
# RACK_ENV variable: Dotenviable defaults the $RACK_ENV variable to whatever
|
15
|
+
# is used for dotfile loading (ie, the `rack_env` or `default_rack_env` value).
|
16
|
+
# This avoids the surprising behavior where a caller does not have RACK_ENV set,
|
17
|
+
# they call +Dotenviable.load+, and RACK_ENV is still not set,
|
18
|
+
# though it had some implied usage within this method.
|
19
|
+
# If for some reason you do not want +ENV['RACK_ENV']+ to be set,
|
20
|
+
# you can store its value before calling `load` and set it back after.
|
21
|
+
#
|
22
|
+
# PORT variable: Foreman assigns the $PORT environment variable BEFORE we load config
|
14
23
|
# (get to what is defined in worker, like puma.rb), so even if we have it in the .env files,
|
15
24
|
# it won't get used, because .env files don't stomp what is already in the environment
|
16
25
|
# (we don't want to use `overload`).
|
@@ -26,5 +35,6 @@ module Appydays::Dotenviable
|
|
26
35
|
]
|
27
36
|
Dotenv.load(*paths)
|
28
37
|
env["PORT"] ||= original_port
|
38
|
+
env["RACK_ENV"] ||= rack_env
|
29
39
|
end
|
30
40
|
end
|
data/lib/appydays/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appydays
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lithic Tech
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|