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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e920f9df3ca076025d9c92638e3999cc0ba4b0f40f5c83b09cf035f6cfadf13
4
- data.tar.gz: b0c068c18c92efd330bf70deac78ecba681ccc9180f4cb68bcfa424086eee2a8
3
+ metadata.gz: a2c62c946f1a72ca71e07015962d3fc25ef5957e4cfd39fd8e75939139302ec9
4
+ data.tar.gz: df9c322631f5080aa1be9c7ccbb012f03f72ec54632762e82c87d6fbb42d7cab
5
5
  SHA512:
6
- metadata.gz: 3d72663ebafa14bef5258048ae013fb6e7a48f99bd388149eab199c66a7be552dfb371bf0d7152dfcd6ad0f1a6a91dadb184423c5bd5629f418d284fe8dc1064
7
- data.tar.gz: 4b269bc6079be199ab05e35d3c3fe72c02900f30accf53661ee61c01d9b9121a8668683858f94f55e33b63b47a925253c950de4bcac2bed8abfac1f262fcddc8
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
- if (os_info || os)[:release].to_i < 8
5
- self
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
- if (os_info || os)[:release].to_i < 8
5
- self
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
 
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.82.20"
2
+ VERSION = "2.82.25"
3
3
  end
@@ -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_port_is_listening, '80') do
7
+ it { should eq 'ss -tunl | grep -E -- :80\ ' }
8
+ end
@@ -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_port_is_listening, '80') do
7
+ it { should eq 'ss -tunl | grep -E -- :80\ ' }
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.20
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: 2020-10-10 00:00:00.000000000 Z
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