figjam 1.6.2 → 2.0.0
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/README.md +0 -1
- data/lib/figjam/application.rb +17 -1
- data/lib/figjam/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55c2096d3563d9a156139d88703c45f17e2cb3cd536f5bd9960303f60c3b9cbd
|
4
|
+
data.tar.gz: bb0645a2230a3c3d62cac73d5906286cf15585763de94a60b08b6a8e71001c82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3f639082d171d22c083d3efc10e36c9d45c9499e626c6275edd6d34f3addbe4779b9437da84de1af4625a64b425f5ffbcd575a83cec55e425a8f041b2d93f8d
|
7
|
+
data.tar.gz: bc0c7f4e7b3db6bfd7e54778114e7eae540af4854959fb376c687bdea1c0a045ee8a4d26c075f5fd3b51d33132e75818bc166f57d7d3b71aec2a3055fd12f8da
|
data/README.md
CHANGED
@@ -7,7 +7,6 @@ figjam
|
|
7
7
|
[](https://github.com/hlascelles/figjam/actions)
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
9
9
|
|
10
|
-
|
11
10
|
Figjam makes it easy to configure ruby and Rails apps `ENV` values by just using a single YAML file.
|
12
11
|
|
13
12
|
PRs to applications often need to come with default configuration values, but hardcoding these into
|
data/lib/figjam/application.rb
CHANGED
@@ -3,6 +3,8 @@ require "yaml"
|
|
3
3
|
require "figjam/figaro_alias"
|
4
4
|
|
5
5
|
module Figjam
|
6
|
+
class InvalidKeyNameError < StandardError; end
|
7
|
+
|
6
8
|
# :reek:TooManyMethods
|
7
9
|
class Application
|
8
10
|
FIGARO_ENV_PREFIX = "_FIGARO_".freeze
|
@@ -40,7 +42,13 @@ module Figjam
|
|
40
42
|
|
41
43
|
def load
|
42
44
|
each do |key, value|
|
43
|
-
|
45
|
+
if !valid_key_name?(key)
|
46
|
+
invalid_key_name(key)
|
47
|
+
elsif skip?(key)
|
48
|
+
key_skipped(key)
|
49
|
+
else
|
50
|
+
set(key, value)
|
51
|
+
end
|
44
52
|
end
|
45
53
|
end
|
46
54
|
|
@@ -110,5 +118,13 @@ module Figjam
|
|
110
118
|
private def key_skipped(key)
|
111
119
|
puts "INFO: Skipping key #{key.inspect}. Already set in ENV."
|
112
120
|
end
|
121
|
+
|
122
|
+
private def valid_key_name?(key)
|
123
|
+
key.to_s == key.to_s.upcase
|
124
|
+
end
|
125
|
+
|
126
|
+
private def invalid_key_name(key)
|
127
|
+
raise InvalidKeyNameError, "Environment variable names must be uppercase: #{key.inspect}"
|
128
|
+
end
|
113
129
|
end
|
114
130
|
end
|
data/lib/figjam/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: figjam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harry Lascelles
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-04-12 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: thor
|
@@ -263,7 +262,6 @@ metadata:
|
|
263
262
|
source_code_uri: https://github.com/hlascelles/figjam/
|
264
263
|
bug_tracker_uri: https://github.com/hlascelles/figjam/issues
|
265
264
|
rubygems_mfa_required: 'true'
|
266
|
-
post_install_message:
|
267
265
|
rdoc_options: []
|
268
266
|
require_paths:
|
269
267
|
- lib
|
@@ -278,8 +276,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
278
276
|
- !ruby/object:Gem::Version
|
279
277
|
version: '0'
|
280
278
|
requirements: []
|
281
|
-
rubygems_version: 3.
|
282
|
-
signing_key:
|
279
|
+
rubygems_version: 3.6.6
|
283
280
|
specification_version: 4
|
284
281
|
summary: ENV configuration for ruby using yaml files
|
285
282
|
test_files: []
|