ravioli 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ravioli/builder.rb +1 -1
- data/lib/ravioli/configuration.rb +11 -7
- data/lib/ravioli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e56ab68185fd144f082af7ecf11f18725ad872ffab08684d72c1bdff8a4d3672
|
4
|
+
data.tar.gz: a304ea94ee11385fad332140b8b521ca1d2f3fb1ba71e8baf0c46a3e73054b89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 307d77cdd70599a9c81d19eec6fc8206fb4a524a05e42d0a2a20edac514b4287be510be6708aefb5b18c61444f1e21e5816aca58355693c801a8fd627d00cd39
|
7
|
+
data.tar.gz: 3436f7252744290a5cc7242d501c1751b79c0ca7e9266b5d39c5e11efbf57269c81822819e77d2760ad8957a85f83cdaec24c4a6ebdec4c790bd8e3154c4d0ab
|
data/lib/ravioli/builder.rb
CHANGED
@@ -213,7 +213,7 @@ module Ravioli
|
|
213
213
|
@reload_credentials.add(@current_credentials)
|
214
214
|
end
|
215
215
|
|
216
|
-
configuration.
|
216
|
+
configuration.send(*args, &block)
|
217
217
|
end
|
218
218
|
# rubocop:enable Style/MissingRespondToMissing
|
219
219
|
# rubocop:enable Style/MethodMissingSuper
|
@@ -45,11 +45,6 @@ module Ravioli
|
|
45
45
|
dig(*keys) || yield
|
46
46
|
end
|
47
47
|
|
48
|
-
def fetch_env_key_for(keys, &block)
|
49
|
-
env_key = key_path_for(keys).join("_").upcase
|
50
|
-
ENV.fetch(env_key, &block)
|
51
|
-
end
|
52
|
-
|
53
48
|
def pretty_print(printer = nil)
|
54
49
|
table.pretty_print(printer)
|
55
50
|
end
|
@@ -85,6 +80,11 @@ module Ravioli
|
|
85
80
|
end
|
86
81
|
end
|
87
82
|
|
83
|
+
def fetch_env_key_for(keys, &block)
|
84
|
+
env_key = key_path_for(keys).join("_").upcase
|
85
|
+
ENV.fetch(env_key, &block)
|
86
|
+
end
|
87
|
+
|
88
88
|
def key_path_for(keys)
|
89
89
|
Array(key_path) + Array(keys)
|
90
90
|
end
|
@@ -92,9 +92,13 @@ module Ravioli
|
|
92
92
|
# rubocop:disable Style/MethodMissingSuper
|
93
93
|
# rubocop:disable Style/MissingRespondToMissing
|
94
94
|
def method_missing(method, *args, &block)
|
95
|
+
return super unless args.empty?
|
96
|
+
|
95
97
|
# Return proper booleans from query methods
|
96
|
-
return send(method.to_s.chomp("?")).present? if
|
97
|
-
|
98
|
+
return send(method.to_s.chomp("?")).present? if method.to_s.ends_with?("?")
|
99
|
+
|
100
|
+
# Try to find a matching ENV key
|
101
|
+
fetch_env_key_for(method) { super(method, *args, &block) }
|
98
102
|
end
|
99
103
|
# rubocop:enable Style/MissingRespondToMissing
|
100
104
|
# rubocop:enable Style/MethodMissingSuper
|
data/lib/ravioli/version.rb
CHANGED