specinfra 2.91.0 → 2.93.0

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: 97394d4373eb3883902aa11db2af73d48f90fd12fcce2f232a6f343c8909b41b
4
- data.tar.gz: a0c5cdead4225a5e8d35989a07ac009414835ff215d98bf47e5da0c2404f3caf
3
+ metadata.gz: e321cef299b5304cbd2be799da02c91b6f8f27eb0e262874b6277641e54becf7
4
+ data.tar.gz: 520fa85f14e29cce1e7d902854eabbabbf7151db348432cd41ace8b0803ce8b7
5
5
  SHA512:
6
- metadata.gz: cee153ac43581df36767f934669cee337c5320c7dac025bb16bb538fddacee7a79877a4e95875087cb48f43de04c2accae6efcf3333f16b167ae5e386acdbf78
7
- data.tar.gz: 3b9d90ccc47adb67253d09b4f8cb5c20b9610e0871981818222f862844008f33f625f8d8322b8c03ded7583b2d2bda33e5264c29830bfa9af06d44f942de335e
6
+ metadata.gz: 4013fb3be50562a79f109b4e50caead9171b8d0cae3dbb966016c24c8c0148a940ea894ef62e961a12143765ed9dbb284899563b1639b68e254ad219962d241c
7
+ data.tar.gz: ca5897fa506bedeadb3ef834ca4353713a747688c2d91d5758b0b61d54b07429872fc31fbf6ba079bcd7bdcb088eae745c90bdf90e66c0308a10dfe11b85301d
@@ -141,7 +141,7 @@ module Specinfra
141
141
  end
142
142
 
143
143
  def with_env
144
- keys = %w[BUNDLER_EDITOR BUNDLE_BIN_PATH BUNDLE_GEMFILE
144
+ keys = %w[BUNDLER_EDITOR BUNDLE_BIN_PATH BUNDLE_GEMFILE BUNDLER_SETUP
145
145
  RUBYOPT GEM_HOME GEM_PATH GEM_CACHE]
146
146
 
147
147
  keys.each { |key| ENV["_SPECINFRA_#{key}"] = ENV[key] ; ENV.delete(key) }
@@ -13,13 +13,20 @@ class Specinfra::Helper::DetectOs::Debian < Specinfra::Helper::DetectOs
13
13
  distro = line.split('=').last.strip if line =~ /^DISTRIB_ID=/
14
14
  release = line.split('=').last.strip if line =~ /^DISTRIB_RELEASE=/
15
15
  end
16
- else
17
- if debian_version.stdout.chomp =~ /^[[:digit:]]+\.[[:digit:]]+$/
18
- release = debian_version.stdout.chomp
19
- end
20
16
  end
21
17
  distro ||= 'debian'
22
- release ||= nil
18
+ # lsb-release not available or reported no version number:
19
+ if release.nil? || release == 'n/a'
20
+ release = case debian_version.stdout.chomp
21
+ when /^[[:digit:]]+\.[[:digit:]]+$/
22
+ debian_version.stdout.chomp
23
+ when %r{^\w+/sid$}
24
+ # a number larger than any normal Debian version ever:
25
+ 2**32 - 1.0
26
+ else
27
+ nil
28
+ end
29
+ end
23
30
  { :family => distro.gsub(/[^[:alnum:]]/, '').downcase, :release => release }
24
31
  end
25
32
  end
@@ -1,5 +1,5 @@
1
1
  module Specinfra
2
- VERSION = "2.91.0"
2
+ VERSION = "2.93.0"
3
3
 
4
4
  def self.ruby_is_older_than?(*version)
5
5
  (RUBY_VERSION.split('.').map(&:to_i) <=> version) < 0
@@ -6,7 +6,7 @@ describe Specinfra.backend.run_command('echo $LANG').stdout.strip do
6
6
  it { should eq 'C' }
7
7
  end
8
8
 
9
- describe do
9
+ describe "override ENV with config(:env)" do
10
10
  before do
11
11
  set :backend, :exec
12
12
 
@@ -18,3 +18,11 @@ describe do
18
18
  it { expect(ENV['LANG']).to eq 'C' }
19
19
  end
20
20
 
21
+ describe "clear env for BUNDLER" do
22
+ before do
23
+ set :backend, :exec
24
+
25
+ ENV['BUNDLER_SETUP'] = 'any-value'
26
+ end
27
+ it { expect(Specinfra.backend.run_command('printenv BUNDLER_SETUP').stdout).to eq '' }
28
+ end
@@ -64,4 +64,19 @@ describe Specinfra::Helper::DetectOs::Debian do
64
64
  :release => '16.04'
65
65
  )
66
66
  end
67
+ it 'Should return debian testing when lsb_release says release = n/a' do
68
+ allow(debian).to receive(:run_command).with('cat /etc/debian_version') {
69
+ CommandResult.new(:stdout => "bookworm/sid", :exit_status => 0)
70
+ }
71
+ allow(debian).to receive(:run_command).with('lsb_release -ir') {
72
+ CommandResult.new(:stdout => "Distributor ID: Debian\nRelease: n/a\n", :exit_status => 0)
73
+ }
74
+ allow(debian).to receive(:run_command).with('cat /etc/lsb-release') {
75
+ CommandResult.new(:stdout => "", :exit_status => 1)
76
+ }
77
+ expect(debian.detect).to include(
78
+ :family => 'debian',
79
+ :release => 4294967295.0
80
+ )
81
+ end
67
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.91.0
4
+ version: 2.93.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-24 00:00:00.000000000 Z
11
+ date: 2025-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64