hooks-ruby 0.6.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95eac66108bc8b0c7daacff27a2ef89370a4bd7853b7f43173eb40a9872c109c
4
- data.tar.gz: 385cc5359905ba780ea6cddff9dce6c4a7a2bfaecf391232a54ce395ba98326a
3
+ metadata.gz: b834bc0fcf2aeae21b60f043da8bdb008a47f0a35eca903de5809bffb2da26a6
4
+ data.tar.gz: c4f1a43547f6fbe5fc15385acecee443b7b30ae0f012ed1e8285dadf23797561
5
5
  SHA512:
6
- metadata.gz: 0efb78d712745ee54b38616d741c5a8d99cbf9f9b6e6310e71f255ddc9294aad5a8b8ad0f3500d92a00668a54549ec02edda65b6c3431300107cc336240d3385
7
- data.tar.gz: 7da1c9915a825b7ccdbe8504f4a8805d1982cd68550f8324b7fbcf2d2be9fe649fee64b0596bdf9e97614e480f0f33f676d9813f518a783fa3a3ca74f0102012
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 config[:production]
161
- error_response[:message] = e.message unless config[:production]
162
- error_response[:handler] = handler_class_name unless config[:production]
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 config[:production]
107
- error_response[:message] = e.message unless config[:production]
108
- error_response[:handler] = handler_class_name unless config[:production]
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
@@ -37,6 +37,8 @@ module Hooks
37
37
  )
38
38
  end
39
39
 
40
+ @log.debug("global config loaded: #{config.inspect}")
41
+
40
42
  Hooks::Log.instance = @log
41
43
 
42
44
  # Register user-defined components globally
@@ -55,7 +57,6 @@ module Hooks
55
57
  @log.info "starting hooks server v#{Hooks::VERSION}"
56
58
  @log.info "config: #{endpoints.size} endpoints loaded"
57
59
  @log.info "environment: #{config[:environment]}"
58
- @log.info "production mode: #{config[:production]}"
59
60
  @log.info "available endpoints: #{endpoints.map { |e| e[:path] }.join(', ')}"
60
61
 
61
62
  # Build and return Grape API class
@@ -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].downcase == "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
@@ -4,5 +4,5 @@
4
4
  module Hooks
5
5
  # Current version of the Hooks webhook framework
6
6
  # @return [String] The version string following semantic versioning
7
- VERSION = "0.6.2".freeze
7
+ VERSION = "0.6.3".freeze
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooks-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - github