hybrid_platforms_conductor 33.2.1 → 33.2.2

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: f311db8004c9c9bce51821d58c9cee66e36b73565a70e990d5d56269a758ef07
4
- data.tar.gz: 232be58c9d26f1821afea89a55421514c8f97becd2b316acf62c2e51c5e29b8c
3
+ metadata.gz: 90e31431abb4e4924342d8057fbb2d2f54d780975ef7079498045a7897262067
4
+ data.tar.gz: 3bfcb046a30115a681d407559f9395766439ada582a0d57070d5bae067776292
5
5
  SHA512:
6
- metadata.gz: d2c2fe3c9d0f5fccceb5a2a2b9759316730c536a5de99e63b5ecc32ef857b4f33a5aef5c4494c4b42f54a1b17a620af7a06526a953a095a8ac3e8fdc7d6fcd8e
7
- data.tar.gz: 6d15f57eae1683425b64871b0234a33a6a98cf3300a3c481d98b88a525809c8ad277836a228565675b5bcd76bc23a130b5392431a045bbe18ec6cd032eeea27d
6
+ metadata.gz: c532fc150a6ac25db61a70de51b88332728cb93b27f1275fda6cf15b0fce03d2fce9b90f7ea1c65134c0475e10708d075235e9abc2ec5710bf8e4823a98dc2e7
7
+ data.tar.gz: d081b32a30c854f0445f98669ba417ee80256f65558b1d274e476b20bd6a0c35133f0f711adae65c9e118a027136caaffce91cd179a2202ae32623b2469d6b54
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [v33.2.2](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.2.1...v33.2.2) (2021-06-21 12:41:35)
2
+
3
+ ## Global changes
4
+ ### Patches
5
+
6
+ * [[Hotfix(cmd_runner)] Retain dynamically set environment while executing commands](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/d709d5d2871e43196cc1f5f9eaf5b2155b34ed4e)
7
+
8
+ ## Changes for cmd_runner
9
+ ### Patches
10
+
11
+ * [[Hotfix(cmd_runner)] Retain dynamically set environment while executing commands](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/d709d5d2871e43196cc1f5f9eaf5b2155b34ed4e)
12
+
1
13
  # [v33.2.1](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.2.0...v33.2.1) (2021-06-21 10:23:51)
2
14
 
3
15
  ## Global changes
@@ -130,7 +130,7 @@ module HybridPlatformsConductor
130
130
  (log_to_stdout ? [@logger_stderr] : []) +
131
131
  (file_output.nil? ? [] : [file_output])
132
132
  ) do
133
- Bundler.with_unbundled_env do
133
+ Bundler.without_bundled_env do
134
134
  cmd_result = TTY::Command.new(
135
135
  printer: :null,
136
136
  pty: true,
@@ -0,0 +1,37 @@
1
+ # Add a way to clean the current env from Bundler variables
2
+ module Bundler
3
+
4
+ class << self
5
+
6
+ # Run block with all bundler-related variables removed from the current environment
7
+ def without_bundled_env(&block)
8
+ with_env(current_unbundled_env, &block)
9
+ end
10
+
11
+ # @return [Hash] Environment with all bundler-related variables removed
12
+ def current_unbundled_env
13
+ env = ENV.clone.to_hash
14
+
15
+ env['MANPATH'] = env['BUNDLER_ORIG_MANPATH'] if env.key?('BUNDLER_ORIG_MANPATH')
16
+
17
+ env.delete_if { |k, _| k[0, 7] == 'BUNDLE_' }
18
+
19
+ if env.key?('RUBYOPT')
20
+ rubyopt = env['RUBYOPT'].split
21
+ rubyopt.delete("-r#{File.expand_path('bundler/setup', __dir__)}")
22
+ rubyopt.delete('-rbundler/setup')
23
+ env['RUBYOPT'] = rubyopt.join(' ')
24
+ end
25
+
26
+ if env.key?('RUBYLIB')
27
+ rubylib = env['RUBYLIB'].split(File::PATH_SEPARATOR)
28
+ rubylib.delete(File.expand_path(__dir__))
29
+ env['RUBYLIB'] = rubylib.join(File::PATH_SEPARATOR)
30
+ end
31
+
32
+ env
33
+ end
34
+
35
+ end
36
+
37
+ end
@@ -1,4 +1,6 @@
1
1
  require 'English'
2
+ require 'bundler'
3
+ require 'hybrid_platforms_conductor/core_extensions/bundler/without_bundled_env'
2
4
  require 'optparse'
3
5
  require 'logger'
4
6
  require 'hybrid_platforms_conductor/config'
@@ -1,5 +1,5 @@
1
1
  module HybridPlatformsConductor
2
2
 
3
- VERSION = '33.2.1'
3
+ VERSION = '33.2.2'
4
4
 
5
5
  end
@@ -51,6 +51,14 @@ describe HybridPlatformsConductor::CmdRunner do
51
51
  end
52
52
  end
53
53
 
54
+ it 'keeps dynamically set environment' do
55
+ with_repository do
56
+ value = ('a'..'z').to_a.sample(8).join
57
+ ENV['hpc_test_new_variable'] = value
58
+ expect(test_cmd_runner.run_cmd('echo "${hpc_test_new_variable}"')).to eq [0, "#{value}\n", '']
59
+ end
60
+ end
61
+
54
62
  it 'fails when the command does not exit 0' do
55
63
  with_repository do
56
64
  expect { test_cmd_runner.run_cmd 'exit 1' }.to raise_error(HybridPlatformsConductor::CmdRunner::UnexpectedExitCodeError, 'Command \'exit 1\' returned error code 1 (expected 0).')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hybrid_platforms_conductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 33.2.1
4
+ version: 33.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muriel Salvan
@@ -695,6 +695,7 @@ files:
695
695
  - lib/hybrid_platforms_conductor/config.rb
696
696
  - lib/hybrid_platforms_conductor/confluence.rb
697
697
  - lib/hybrid_platforms_conductor/connector.rb
698
+ - lib/hybrid_platforms_conductor/core_extensions/bundler/without_bundled_env.rb
698
699
  - lib/hybrid_platforms_conductor/core_extensions/cleanroom/fix_kwargs.rb
699
700
  - lib/hybrid_platforms_conductor/core_extensions/symbol/zero.rb
700
701
  - lib/hybrid_platforms_conductor/credentials.rb