specinfra 1.4.0 → 1.5.0

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
  SHA1:
3
- metadata.gz: b548e8f643d9527287040b11a7599cc51c56d57f
4
- data.tar.gz: b169d8328b68007758c12d6f8af34db7e98ed627
3
+ metadata.gz: dd002869a5b2ac8aa39ebc0ace0eebc1be011c43
4
+ data.tar.gz: b0708483cde31a4427f95b5cd32f50dbc7d3e641
5
5
  SHA512:
6
- metadata.gz: a438b642d651c0d743cdcb8bb5f6a220610ee83021a2b0e9dfc1d57294f235caf658cfec17dc645679d62c2c872f278576e3d8999dfac138676dfeb788f79386
7
- data.tar.gz: ee4fcf7d5284b9fa305fa45e4c53e0c61ef372a6f57256417b7909111e9f73357546a746d8514c31bc8e6aa18e046b930281ee91443451ddc590e3f8b8de1574
6
+ metadata.gz: 158103396176f08af8ea9ff270c9b154f501cafa5bba54386dcc57d98eba9de784500b20ecc6b83c8583197b688691eeea922a01a302cdc73133666ef7e1898d
7
+ data.tar.gz: 16afa2126298127a89d2c0424e69e17357995ff78fc537902a4258722bdf37b610eb6e3c2dd0ba3a89f034df98e21fb723eef7a166c469e550dab2b6c5c7db6e
@@ -0,0 +1,18 @@
1
+ function FindInstalledHotFix
2
+ {
3
+ param($description, $hotFixId)
4
+
5
+ Write-Host "Num Args:" $args.Length;
6
+ foreach ($arg in $args)
7
+ {
8
+ Write-Host "Arg: $arg";
9
+ }
10
+
11
+ Write-Host $description
12
+ Write-Host $hotFixId
13
+
14
+ $keys= (Get-WmiObject -Class WIN32_QuickFixEngineering)
15
+
16
+ @($keys | Where-Object {$_.HotFixID -like $hotFixId}).Length -gt 0
17
+
18
+ }
@@ -9,9 +9,9 @@ module SpecInfra
9
9
  def check_installed(package, version=nil)
10
10
  escaped_package = escape(package)
11
11
  if version
12
- cmd = "dpkg-query -f '${Status} ${Version}' -W #{escaped_package} | grep -E '^\\(install\\|hold\\) ok installed #{escape(version)}$'"
12
+ cmd = "dpkg-query -f '${Status} ${Version}' -W #{escaped_package} | grep -E '^(install|hold) ok installed #{escape(version)}$'"
13
13
  else
14
- cmd = "dpkg-query -f '${Status}' -W #{escaped_package} | grep '^\\(install\\|hold\\) ok installed$'"
14
+ cmd = "dpkg-query -f '${Status}' -W #{escaped_package} | grep '^(install|hold) ok installed$'"
15
15
  end
16
16
  cmd
17
17
  end
@@ -235,6 +235,22 @@ module SpecInfra
235
235
  end
236
236
  end
237
237
 
238
+ def check_windows_hot_fix_installed(description, hot_fix_id=nil)
239
+ hot_fix_id_match = /(KB\d+)/i.match(description)
240
+ hot_fix_id = hot_fix_id_match ? hot_fix_id_match[1] : description if hot_fix_id.nil?
241
+
242
+ args = [
243
+ '-description', "'#{description}'",
244
+ '-hotFixId', "'#{hot_fix_id}'"
245
+ ]
246
+
247
+ cmd = "(FindInstalledHotFix #{args.join(' ')})"
248
+ Backend::PowerShell::Command.new do
249
+ using 'find_installed_hot_fix.ps1'
250
+ exec "#{cmd} -eq $true"
251
+ end
252
+ end
253
+
238
254
  def check_file_version(name,version)
239
255
  cmd = "((Get-Command '#{name}').FileVersionInfo.ProductVersion -eq '#{version}') -or ((Get-Command '#{name}').FileVersionInfo.FileVersion -eq '#{version}')"
240
256
  Backend::PowerShell::Command.new { exec cmd }
@@ -1,3 +1,3 @@
1
1
  module SpecInfra
2
- VERSION = "1.4.0"
2
+ VERSION = "1.5.0"
3
3
  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: 1.4.0
4
+ version: 1.5.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: 2014-04-20 00:00:00.000000000 Z
11
+ date: 2014-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -109,6 +109,7 @@ files:
109
109
  - lib/specinfra/backend/powershell/support/find_group.ps1
110
110
  - lib/specinfra/backend/powershell/support/find_iis_component.ps1
111
111
  - lib/specinfra/backend/powershell/support/find_installed_application.ps1
112
+ - lib/specinfra/backend/powershell/support/find_installed_hot_fix.ps1
112
113
  - lib/specinfra/backend/powershell/support/find_service.ps1
113
114
  - lib/specinfra/backend/powershell/support/find_user.ps1
114
115
  - lib/specinfra/backend/powershell/support/find_usergroup.ps1