wolf_core 1.0.46 → 1.0.48

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 794e2a92f90d3d4ad22f51fed483e17f68643130fd9572320fb066971d0e92e3
4
- data.tar.gz: bda1a0b2a6fd8d6dcb677d6361de5779f4b969ac83551ce6c7ea954c95851a85
3
+ metadata.gz: 688d6ee6dd8934b902403a1db8d2cebece5c394cc2e878e6189b81ccb137189a
4
+ data.tar.gz: '09c55ea06ee8bf5cb8efee607ae076825648af14291e4007e2c9ea7fa050ecf3'
5
5
  SHA512:
6
- metadata.gz: b6069da749b4b0acd71a88da45aeb0096eff177aee4757d4c43faabf2d944f7c2232bf04b75028bcaef3ab1a5ac007faa2c8275101771f33204a3f79fa756389
7
- data.tar.gz: 62c2b45417d6764ff3053212f3f2a65c5da5b059222fee78ed1497784c8fcb9ed07923ea050c03f28db46ba66d82e224245b83e672331bc2509d759de46f7e35
6
+ metadata.gz: 223c44544b1f902dfdfb0e69d800b9fe7be1d68d6c76875162313fd9fd2bd2c3ad99b4ad3247888a0966196f404da4915efb1f515cdc0b8060563dbcb77a745e
7
+ data.tar.gz: 6dcfddc2a7246a92512513cb92bd6e25376aff158d503322cf5cd3a93879f54904eb3586a6b7fd354227fc2bbe31b3c79e2b6450dcd3ba717ad35a5418c10c83
@@ -15,10 +15,16 @@ module WolfCore
15
15
  'burnett/clients/export' => 'BurnettExportClient',
16
16
  }
17
17
 
18
- def route_event_request(path:, body:)
19
- environment = ENV['ENVIRONMENT'] || 'development'
18
+ def route_event_request(path:, body:, environment:, domain_url: nil)
19
+ environment ||= 'development'
20
+ environment = environment.downcase
20
21
  deployable_envs = ['production', 'staging', 'testing']
21
- if deployable_envs.include?(environment.downcase)
22
+ puts '-------------------------------------------------------'
23
+ puts "environment = #{environment}"
24
+ puts "deployable_envs = #{deployable_envs}"
25
+ puts "deployable_envs.include?(environment) = #{deployable_envs.include?(environment)}"
26
+ puts '-------------------------------------------------------'
27
+ if deployable_envs.include?(environment)
22
28
  function_name = "#{PATH_TO_FUNCTION_NAME_MAPPING[path]}#{environment.titleize}"
23
29
  raise_service_error("Function name not found for path: #{path}") if function_name.blank?
24
30
 
@@ -27,7 +33,7 @@ module WolfCore
27
33
  payload: body,
28
34
  )
29
35
  else
30
- domain_url = ENV['CURRENT_SAM_URL']
36
+ domain_url ||= ENV['CURRENT_SAM_URL']
31
37
  async_http_post(url: "#{domain_url}/#{path}", body: body)
32
38
  end
33
39
  end
@@ -128,7 +128,7 @@ module WolfCore
128
128
  end
129
129
 
130
130
  def validate_http_response(response:, message:, error_data: nil)
131
- return if response.code == 200
131
+ return if response_success?(response)
132
132
 
133
133
  error_data = {
134
134
  message: message,
@@ -149,5 +149,9 @@ module WolfCore
149
149
  message: response.message
150
150
  })
151
151
  end
152
+
153
+ def response_success?(response)
154
+ response.code >= 200 && response.code < 300
155
+ end
152
156
  end
153
157
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.46"
4
+ VERSION = "1.0.48"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.46
4
+ version: 1.0.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-03 00:00:00.000000000 Z
11
+ date: 2024-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty