specinfra 2.71.3 → 2.72.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: a81bee062c4fecdd2fb6f378644ea7bc5d0a8ef3
4
- data.tar.gz: f268f41467710403fba283d362da03658ce922e0
3
+ metadata.gz: f533368006b4d3ad7a874e0d34f112d78b6f07db
4
+ data.tar.gz: 695093bad03312f2ab92b4c4ce877378e8863e56
5
5
  SHA512:
6
- metadata.gz: 749cda56dd1345490109ac381e464b2e57eac2f7637ffa1aa6c270d2ad3c9c44b65c7aebd650f3a655c5e357e49319cedb0f1e7678df5c9cae36d397a5dac379
7
- data.tar.gz: e4a59f70f760825313796d32a6e91283f8146c55a316e8f1b43ee6a39a9deabb989388b7e0cc551b86963279ebc414499d1afbe0a3d22121c4436f15c87ed591
6
+ metadata.gz: 23ac28e62753099bf41ed396ec43450e0fba05cac9b9f3ec3fd57b2a7351df5a99b4f8de6052a41fc7c790516ff459ed4e48e0e7c4a3c866ae638be02172b7a5
7
+ data.tar.gz: ec969e86f08e1bfa984b15df356655ced79ac576c7c09adc8e1be5a258cd9ad1690a1edce923f4a68a6ae819f1f5c1f7c80f78db35bb00c3584f409ecba32365
@@ -0,0 +1,33 @@
1
+ class Specinfra::Command::Windows::Base::Firewall < Specinfra::Command::Windows::Base
2
+ class << self
3
+ def check_exists(displayName)
4
+ cmd = "(Get-NetFirewallRule -DisplayName '#{displayName}') -ne $null"
5
+ create_command cmd
6
+ end
7
+
8
+ def check_is_enabled(displayName)
9
+ cmd = "((Get-NetFirewallRule -DisplayName '#{displayName}') | where {$_.Enabled -eq 'True'}) -ne $null"
10
+ create_command cmd
11
+ end
12
+
13
+ def check_has_action(displayName, action)
14
+ cmd = "((Get-NetFirewallRule -DisplayName '#{displayName}') | where {$_.Action -eq '#{action}'}) -ne $null"
15
+ create_command cmd
16
+ end
17
+
18
+ def check_has_protocol(displayName, protocol)
19
+ cmd = "((Get-NetFirewallRule -DisplayName '#{displayName}') | Get-NetFirewallPortFilter | where {$_.Protocol -eq '#{protocol}'}) -ne $null"
20
+ create_command cmd
21
+ end
22
+
23
+ def check_has_localport(displayName, localport)
24
+ cmd = "((Get-NetFirewallRule -DisplayName '#{displayName}') | Get-NetFirewallPortFilter | where {$_.LocalPort -eq '#{localport}'}) -ne $null"
25
+ create_command cmd
26
+ end
27
+
28
+ def check_has_direction(displayName, direction)
29
+ cmd = "((Get-NetFirewallRule -DisplayName '#{displayName}') | where {$_.Direction -eq '#{direction}'}) -ne $null"
30
+ create_command cmd
31
+ end
32
+ end
33
+ end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.71.3"
2
+ VERSION = "2.72.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: 2.71.3
4
+ version: 2.72.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: 2017-09-25 00:00:00.000000000 Z
11
+ date: 2017-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp
@@ -453,6 +453,7 @@ files:
453
453
  - lib/specinfra/command/windows/base.rb
454
454
  - lib/specinfra/command/windows/base/feature.rb
455
455
  - lib/specinfra/command/windows/base/file.rb
456
+ - lib/specinfra/command/windows/base/firewall.rb
456
457
  - lib/specinfra/command/windows/base/group.rb
457
458
  - lib/specinfra/command/windows/base/host.rb
458
459
  - lib/specinfra/command/windows/base/hot_fix.rb