hooks-ruby 0.6.1 → 0.6.3
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/hooks/app/api.rb +4 -3
- data/lib/hooks/app/endpoints/catchall.rb +3 -3
- data/lib/hooks/core/builder.rb +2 -0
- data/lib/hooks/core/config_loader.rb +0 -6
- data/lib/hooks/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: b834bc0fcf2aeae21b60f043da8bdb008a47f0a35eca903de5809bffb2da26a6
|
4
|
+
data.tar.gz: c4f1a43547f6fbe5fc15385acecee443b7b30ae0f012ed1e8285dadf23797561
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffec0cb68b5e86c15631fbcdcca5c6eadfe087ef1b1874d5d921db4e60ec891f62c0e403ecd7c945e08590b163db3bd9199c8e9b914b80d81b1784fb961b2865
|
7
|
+
data.tar.gz: 284a4210a09028d0dd51d771ef00423ae65230f4bab7b6415a559edb2e6fb36e7fed010afd974d406b7348eedcfa5c665cb3ffc940e6e4d9723e4e1e2fff5d72
|
data/lib/hooks/app/api.rb
CHANGED
@@ -31,6 +31,7 @@ module Hooks
|
|
31
31
|
# Create a new configured API class
|
32
32
|
def self.create(config:, endpoints:, log:)
|
33
33
|
# :nocov:
|
34
|
+
@production = config[:environment].downcase.strip == "production"
|
34
35
|
@server_start_time = Time.now
|
35
36
|
|
36
37
|
api_class = Class.new(Grape::API) do
|
@@ -157,9 +158,9 @@ module Hooks
|
|
157
158
|
}
|
158
159
|
|
159
160
|
# enrich the error response with details if not in production
|
160
|
-
error_response[:backtrace] = e.backtrace.join("\n") unless
|
161
|
-
error_response[:message] = e.message unless
|
162
|
-
error_response[:handler] = handler_class_name unless
|
161
|
+
error_response[:backtrace] = e.backtrace.join("\n") unless @production
|
162
|
+
error_response[:message] = e.message unless @production
|
163
|
+
error_response[:handler] = handler_class_name unless @production
|
163
164
|
|
164
165
|
status determine_error_code(e)
|
165
166
|
error_response
|
@@ -103,9 +103,9 @@ module Hooks
|
|
103
103
|
}
|
104
104
|
|
105
105
|
# enrich the error response with details if not in production
|
106
|
-
error_response[:backtrace] = e.backtrace.join("\n") unless
|
107
|
-
error_response[:message] = e.message unless
|
108
|
-
error_response[:handler] = handler_class_name unless
|
106
|
+
error_response[:backtrace] = e.backtrace.join("\n") unless @production
|
107
|
+
error_response[:message] = e.message unless @production
|
108
|
+
error_response[:handler] = handler_class_name unless @production
|
109
109
|
|
110
110
|
status determine_error_code(e)
|
111
111
|
error_response
|
data/lib/hooks/core/builder.rb
CHANGED
@@ -69,12 +69,6 @@ module Hooks
|
|
69
69
|
# Convert string keys to symbols for consistency
|
70
70
|
config = symbolize_keys(config)
|
71
71
|
|
72
|
-
if config[:environment] == "production"
|
73
|
-
config[:production] = true
|
74
|
-
else
|
75
|
-
config[:production] = false
|
76
|
-
end
|
77
|
-
|
78
72
|
# Log overrides if any were made
|
79
73
|
if overrides.any?
|
80
74
|
puts "INFO: Configuration overrides applied from: #{overrides.join(', ')}" unless SILENCE_CONFIG_LOADER_MESSAGES
|
data/lib/hooks/version.rb
CHANGED