From 581f2fdaf86bc537b84c0293601cdaa56b0c11ae Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Wed, 9 Jun 2021 10:10:38 +1000 Subject: [PATCH] fix: hardcode file requires Fixes: https://github.com/pact-foundation/pact_broker-client/issues/88 --- lib/pact_broker/client/deployments.rb | 7 ++++--- lib/pact_broker/client/environments.rb | 9 ++++++--- lib/pact_broker/client/pacticipants.rb | 6 +++--- lib/pact_broker/client/versions.rb | 7 ++----- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/pact_broker/client/deployments.rb b/lib/pact_broker/client/deployments.rb index c891ccd1..cd097b34 100644 --- a/lib/pact_broker/client/deployments.rb +++ b/lib/pact_broker/client/deployments.rb @@ -1,3 +1,4 @@ -Dir.glob(File.join(__FILE__.gsub(".rb", "/**/*.rb"))).sort.each do | path | - require path -end +require 'pact_broker/client/deployments/record_deployment' +require 'pact_broker/client/deployments/record_release' +require 'pact_broker/client/deployments/record_undeployment' + diff --git a/lib/pact_broker/client/environments.rb b/lib/pact_broker/client/environments.rb index c891ccd1..7645728c 100644 --- a/lib/pact_broker/client/environments.rb +++ b/lib/pact_broker/client/environments.rb @@ -1,3 +1,6 @@ -Dir.glob(File.join(__FILE__.gsub(".rb", "/**/*.rb"))).sort.each do | path | - require path -end +require 'pact_broker/client/environments/create_environment' +require 'pact_broker/client/environments/delete_environment' +require 'pact_broker/client/environments/describe_environment' +require 'pact_broker/client/environments/list_environments' +require 'pact_broker/client/environments/update_environment' + diff --git a/lib/pact_broker/client/pacticipants.rb b/lib/pact_broker/client/pacticipants.rb index 834b94aa..c793a3b2 100644 --- a/lib/pact_broker/client/pacticipants.rb +++ b/lib/pact_broker/client/pacticipants.rb @@ -1,7 +1,7 @@ # New code -Dir.glob(File.join(__FILE__.gsub(".rb", "/**/*.rb"))).sort.each do | path | - require path -end +require 'pact_broker/client/pacticipants/create' +require 'pact_broker/client/pacticipants/describe' +require 'pact_broker/client/pacticipants/list' # Old code require 'pact_broker/client/base_client' diff --git a/lib/pact_broker/client/versions.rb b/lib/pact_broker/client/versions.rb index 5333f64f..65e63c20 100644 --- a/lib/pact_broker/client/versions.rb +++ b/lib/pact_broker/client/versions.rb @@ -1,8 +1,5 @@ -require_relative 'base_client' - -Dir.glob(File.join(__FILE__.gsub(".rb", "/**/*.rb"))).sort.each do | path | - require path -end +require 'pact_broker/client/base_client' +require 'pact_broker/client/versions/describe' # Old code require 'pact_broker/client/pacts'