specinfra 2.82.20 → 2.82.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/backend/powershell/support/find_installed_gem.ps1 +1 -1
- data/lib/specinfra/backend/powershell/support/is_port_listening.ps1 +2 -1
- data/lib/specinfra/command/darwin/base/package.rb +2 -2
- data/lib/specinfra/command/darwin/base/service.rb +8 -0
- data/lib/specinfra/command/debian/base/port.rb +4 -3
- data/lib/specinfra/command/debian/base/service.rb +4 -3
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/debiantesting/port_spec.rb +8 -0
- data/spec/command/debiantesting/service_spec.rb +8 -0
- data/spec/command/debianunstable/port_spec.rb +8 -0
- data/spec/command/debianunstable/service_spec.rb +8 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2c62c946f1a72ca71e07015962d3fc25ef5957e4cfd39fd8e75939139302ec9
|
4
|
+
data.tar.gz: df9c322631f5080aa1be9c7ccbb012f03f72ec54632762e82c87d6fbb42d7cab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 717afa09a1d5bf1bd271efb86d727b634e017d71cb8d9d269460a1190f41beaf91a7afaf8fb48951b582c173a8684e7af3986cf878cc17899512cfda1c07d560
|
7
|
+
data.tar.gz: 42f0389ffad21c2befc5485276bf09ec1d391db0ab8d63b2587a5f8a2f04c72f5a5627283c05f1e467575173447cbfc7bdf16be515e07a74a04b2f06facb64ba
|
@@ -5,7 +5,7 @@ function FindInstalledGem
|
|
5
5
|
$nameVer = $(Invoke-Expression "gem list --local" | Select-String "^$gemName").Line
|
6
6
|
if ($nameVer.StartsWith($gemName)) {
|
7
7
|
if ($gemVersion) {
|
8
|
-
$versions = ($nameVer -split { $_ -eq "(" -or $_ -eq ")"})[1].split(" ")
|
8
|
+
$versions = ($nameVer -split { $_ -eq "(" -or $_ -eq ")"})[1].split(", ")
|
9
9
|
if ($versions.Contains($gemVersion)) {
|
10
10
|
$true
|
11
11
|
} else {
|
@@ -6,9 +6,10 @@ function IsPortListening
|
|
6
6
|
[array] $networkIPs += "0.0.0.0"
|
7
7
|
[array] $networkIPs += "127.0.0.1"
|
8
8
|
[array] $networkIPs += "[::1]"
|
9
|
+
[array] $networkIPs += "[::]"
|
9
10
|
foreach ($ipaddress in $networkIPs)
|
10
11
|
{
|
11
|
-
$matchExpression = ("$ipaddress" + ":" + $portNumber + ".*LISTENING")
|
12
|
+
$matchExpression = ("$ipaddress" + ":" + $portNumber + ".*(LISTENING|\*:\*)")
|
12
13
|
if ($protocol) { $matchExpression = ($protocol.toUpper() + "\s+$matchExpression") }
|
13
14
|
if ($netstatOutput -match $matchExpression) { return $true }
|
14
15
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class Specinfra::Command::Darwin::Base::Package < Specinfra::Command::Base::Package
|
2
2
|
class << self
|
3
3
|
def check_is_installed(package, version=nil)
|
4
|
-
escaped_package = escape(File.basename(package))
|
4
|
+
escaped_package = escape(::File.basename(package))
|
5
5
|
if version
|
6
6
|
cmd = %Q[brew info #{escaped_package} | grep -E "^$(brew --prefix)/Cellar/#{escaped_package}/#{escape(version)}"]
|
7
7
|
else
|
@@ -13,7 +13,7 @@ class Specinfra::Command::Darwin::Base::Package < Specinfra::Command::Base::Pack
|
|
13
13
|
alias :check_is_installed_by_homebrew :check_is_installed
|
14
14
|
|
15
15
|
def check_is_installed_by_homebrew_cask(package, version=nil)
|
16
|
-
escaped_package = escape(File.basename(package))
|
16
|
+
escaped_package = escape(::File.basename(package))
|
17
17
|
if version
|
18
18
|
cmd = "brew cask info #{escaped_package} | grep -E '^/opt/homebrew-cask/Caskroom/#{escaped_package}/#{escape(version)}'"
|
19
19
|
else
|
@@ -4,8 +4,16 @@ class Specinfra::Command::Darwin::Base::Service < Specinfra::Command::Base::Serv
|
|
4
4
|
"launchctl list | grep #{escape(service)}"
|
5
5
|
end
|
6
6
|
|
7
|
+
def check_is_enabled_under_homebrew(service)
|
8
|
+
"brew services list | grep #{escape(service)}"
|
9
|
+
end
|
10
|
+
|
7
11
|
def check_is_running(service)
|
8
12
|
"launchctl list | grep #{escape(service)} | grep -E '^[0-9]+'"
|
9
13
|
end
|
14
|
+
|
15
|
+
def check_is_running_under_homebrew(service)
|
16
|
+
"brew services list | grep #{escape(service)} | grep 'started'"
|
17
|
+
end
|
10
18
|
end
|
11
19
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
class Specinfra::Command::Debian::Base::Port < Specinfra::Command::Linux::Base::Port
|
2
2
|
class << self
|
3
3
|
def create(os_info=nil)
|
4
|
-
|
5
|
-
|
6
|
-
else
|
4
|
+
release = (os_info || os)[:release]
|
5
|
+
if ["testing", "unstable"].include?(release) || release.to_i >= 8
|
7
6
|
Specinfra::Command::Debian::V8::Port
|
7
|
+
else
|
8
|
+
self
|
8
9
|
end
|
9
10
|
end
|
10
11
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
class Specinfra::Command::Debian::Base::Service < Specinfra::Command::Linux::Base::Service
|
2
2
|
class << self
|
3
3
|
def create(os_info=nil)
|
4
|
-
|
5
|
-
|
6
|
-
else
|
4
|
+
release = (os_info || os)[:release]
|
5
|
+
if ["testing", "unstable"].include?(release) || release.to_i >= 8
|
7
6
|
Specinfra::Command::Debian::V8::Service
|
7
|
+
else
|
8
|
+
self
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
data/lib/specinfra/version.rb
CHANGED
@@ -0,0 +1,8 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
property[:os] = nil
|
4
|
+
set :os, :family => 'debian', :release => 'testing'
|
5
|
+
|
6
|
+
describe get_command(:check_service_is_enabled, 'apache') do
|
7
|
+
it { should eq 'systemctl --quiet is-enabled apache||ls /etc/rc[S5].d/S??apache >/dev/null 2>/dev/null' }
|
8
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
property[:os] = nil
|
4
|
+
set :os, :family => 'debian', :release => 'unstable'
|
5
|
+
|
6
|
+
describe get_command(:check_service_is_enabled, 'apache') do
|
7
|
+
it { should eq 'systemctl --quiet is-enabled apache||ls /etc/rc[S5].d/S??apache >/dev/null 2>/dev/null' }
|
8
|
+
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.82.
|
4
|
+
version: 2.82.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|
@@ -537,6 +537,10 @@ files:
|
|
537
537
|
- spec/command/debian8/port_spec.rb
|
538
538
|
- spec/command/debian9/port_spec.rb
|
539
539
|
- spec/command/debian9/service_spec.rb
|
540
|
+
- spec/command/debiantesting/port_spec.rb
|
541
|
+
- spec/command/debiantesting/service_spec.rb
|
542
|
+
- spec/command/debianunstable/port_spec.rb
|
543
|
+
- spec/command/debianunstable/service_spec.rb
|
540
544
|
- spec/command/esxi/package_spec.rb
|
541
545
|
- spec/command/factory_spec.rb
|
542
546
|
- spec/command/freebsd/file_spec.rb
|
@@ -674,6 +678,10 @@ test_files:
|
|
674
678
|
- spec/command/debian8/port_spec.rb
|
675
679
|
- spec/command/debian9/port_spec.rb
|
676
680
|
- spec/command/debian9/service_spec.rb
|
681
|
+
- spec/command/debiantesting/port_spec.rb
|
682
|
+
- spec/command/debiantesting/service_spec.rb
|
683
|
+
- spec/command/debianunstable/port_spec.rb
|
684
|
+
- spec/command/debianunstable/service_spec.rb
|
677
685
|
- spec/command/esxi/package_spec.rb
|
678
686
|
- spec/command/factory_spec.rb
|
679
687
|
- spec/command/freebsd/file_spec.rb
|