ravioli 0.1.7 → 0.1.8

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: a42c50f1ae58ea21c70956c3a2fda57084dc20042efc3e163c26b80a8ecc8c58
4
- data.tar.gz: 2fafc358079f1bab16f25e36563dc5f843fedd7d85e32b8e34ca337b2c3c23ee
3
+ metadata.gz: e56ab68185fd144f082af7ecf11f18725ad872ffab08684d72c1bdff8a4d3672
4
+ data.tar.gz: a304ea94ee11385fad332140b8b521ca1d2f3fb1ba71e8baf0c46a3e73054b89
5
5
  SHA512:
6
- metadata.gz: bf02967cc19dfba1c24a0db7da932999896c278635a8be0c45d6966d4d9e76d2517290770a8d608842b4978beb9c05621b532023ffd2bbd8eed484155c3327b8
7
- data.tar.gz: 77bdfbaeb3210f7033e9837d7c52003118fc45edaec020595276f455260cb13a186c1c1239c3bf96e5e4965acb3c3f1b250fc0766e1f5d6957c89d662c633d5e
6
+ metadata.gz: 307d77cdd70599a9c81d19eec6fc8206fb4a524a05e42d0a2a20edac514b4287be510be6708aefb5b18c61444f1e21e5816aca58355693c801a8fd627d00cd39
7
+ data.tar.gz: 3436f7252744290a5cc7242d501c1751b79c0ca7e9266b5d39c5e11efbf57269c81822819e77d2760ad8957a85f83cdaec24c4a6ebdec4c790bd8e3154c4d0ab
@@ -213,7 +213,7 @@ module Ravioli
213
213
  @reload_credentials.add(@current_credentials)
214
214
  end
215
215
 
216
- configuration.fetch_env_key_for(args) { configuration.send(*args, &block) }
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 args.empty? && method.to_s.ends_with?("?")
97
- super
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ravioli
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ravioli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flip Sasser