winrm 1.3.6 → 1.4.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 +4 -4
- data/.gitignore +10 -10
- data/.rspec +3 -3
- data/.rubocop.yml +9 -9
- data/.travis.yml +4 -4
- data/Gemfile +9 -9
- data/LICENSE +202 -202
- data/README.md +148 -148
- data/Rakefile +28 -28
- data/Vagrantfile +9 -9
- data/bin/rwinrm +97 -97
- data/changelog.md +49 -49
- data/lib/winrm.rb +42 -41
- data/lib/winrm/exceptions/exceptions.rb +57 -57
- data/lib/winrm/helpers/iso8601_duration.rb +58 -58
- data/lib/winrm/helpers/powershell_script.rb +37 -37
- data/lib/winrm/http/response_handler.rb +82 -82
- data/lib/winrm/http/transport.rb +294 -294
- data/lib/winrm/output.rb +43 -43
- data/lib/winrm/soap_provider.rb +40 -40
- data/lib/winrm/version.rb +7 -0
- data/lib/winrm/winrm_service.rb +490 -490
- data/preamble +17 -17
- data/spec/auth_timeout_spec.rb +16 -16
- data/spec/cmd_spec.rb +102 -102
- data/spec/config-example.yml +19 -19
- data/spec/exception_spec.rb +50 -50
- data/spec/issue_59_spec.rb +15 -15
- data/spec/matchers.rb +74 -74
- data/spec/output_spec.rb +110 -110
- data/spec/powershell_spec.rb +103 -103
- data/spec/response_handler_spec.rb +59 -59
- data/spec/spec_helper.rb +48 -48
- data/spec/stubs/responses/open_shell_v1.xml +19 -19
- data/spec/stubs/responses/open_shell_v2.xml +20 -20
- data/spec/stubs/responses/soap_fault_v1.xml +36 -36
- data/spec/stubs/responses/soap_fault_v2.xml +42 -42
- data/spec/stubs/responses/wmi_error_v2.xml +41 -41
- data/spec/winrm_options_spec.rb +76 -76
- data/spec/winrm_primitives_spec.rb +51 -51
- data/spec/wql_spec.rb +14 -14
- data/winrm.gemspec +40 -41
- metadata +4 -4
- data/VERSION +0 -1
@@ -1,51 +1,51 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
describe 'winrm client primitives' do
|
3
|
-
before(:all) do
|
4
|
-
@winrm = winrm_connection
|
5
|
-
end
|
6
|
-
|
7
|
-
describe 'open and close shell', integration: true do
|
8
|
-
it 'should #open_shell and #close_shell' do
|
9
|
-
sid = @winrm.open_shell
|
10
|
-
expect(sid).to be_a_uid
|
11
|
-
expect(@winrm.close_shell(sid)).to be true
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should #run_command and #cleanup_command' do
|
15
|
-
sid = @winrm.open_shell
|
16
|
-
|
17
|
-
cmd_id = @winrm.run_command(sid, 'ipconfig', %w(/all))
|
18
|
-
expect(sid).to be_a_uid
|
19
|
-
|
20
|
-
expect(@winrm.cleanup_command(sid, cmd_id)).to be true
|
21
|
-
@winrm.close_shell(sid)
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'should #get_command_output' do
|
25
|
-
sid = @winrm.open_shell
|
26
|
-
cmd_id = @winrm.run_command(sid, 'ipconfig', %w(/all))
|
27
|
-
|
28
|
-
output = @winrm.get_command_output(sid, cmd_id)
|
29
|
-
expect(output).to have_exit_code 0
|
30
|
-
expect(output).to have_stdout_match(/.+/)
|
31
|
-
expect(output).to have_no_stderr
|
32
|
-
|
33
|
-
@winrm.cleanup_command(sid, cmd_id)
|
34
|
-
@winrm.close_shell(sid)
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should #get_command_output with a block' do
|
38
|
-
sid = @winrm.open_shell
|
39
|
-
cmd_id = @winrm.run_command(sid, 'ipconfig', %w(/all))
|
40
|
-
|
41
|
-
outvar = ''
|
42
|
-
@winrm.get_command_output(sid, cmd_id) do |stdout, _stderr|
|
43
|
-
outvar << stdout
|
44
|
-
end
|
45
|
-
expect(outvar).to match(/Windows IP Configuration/)
|
46
|
-
|
47
|
-
@winrm.cleanup_command(sid, cmd_id)
|
48
|
-
@winrm.close_shell(sid)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
describe 'winrm client primitives' do
|
3
|
+
before(:all) do
|
4
|
+
@winrm = winrm_connection
|
5
|
+
end
|
6
|
+
|
7
|
+
describe 'open and close shell', integration: true do
|
8
|
+
it 'should #open_shell and #close_shell' do
|
9
|
+
sid = @winrm.open_shell
|
10
|
+
expect(sid).to be_a_uid
|
11
|
+
expect(@winrm.close_shell(sid)).to be true
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should #run_command and #cleanup_command' do
|
15
|
+
sid = @winrm.open_shell
|
16
|
+
|
17
|
+
cmd_id = @winrm.run_command(sid, 'ipconfig', %w(/all))
|
18
|
+
expect(sid).to be_a_uid
|
19
|
+
|
20
|
+
expect(@winrm.cleanup_command(sid, cmd_id)).to be true
|
21
|
+
@winrm.close_shell(sid)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should #get_command_output' do
|
25
|
+
sid = @winrm.open_shell
|
26
|
+
cmd_id = @winrm.run_command(sid, 'ipconfig', %w(/all))
|
27
|
+
|
28
|
+
output = @winrm.get_command_output(sid, cmd_id)
|
29
|
+
expect(output).to have_exit_code 0
|
30
|
+
expect(output).to have_stdout_match(/.+/)
|
31
|
+
expect(output).to have_no_stderr
|
32
|
+
|
33
|
+
@winrm.cleanup_command(sid, cmd_id)
|
34
|
+
@winrm.close_shell(sid)
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should #get_command_output with a block' do
|
38
|
+
sid = @winrm.open_shell
|
39
|
+
cmd_id = @winrm.run_command(sid, 'ipconfig', %w(/all))
|
40
|
+
|
41
|
+
outvar = ''
|
42
|
+
@winrm.get_command_output(sid, cmd_id) do |stdout, _stderr|
|
43
|
+
outvar << stdout
|
44
|
+
end
|
45
|
+
expect(outvar).to match(/Windows IP Configuration/)
|
46
|
+
|
47
|
+
@winrm.cleanup_command(sid, cmd_id)
|
48
|
+
@winrm.close_shell(sid)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/spec/wql_spec.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
describe 'winrm client wql', integration: true do
|
3
|
-
before(:all) do
|
4
|
-
@winrm = winrm_connection
|
5
|
-
end
|
6
|
-
|
7
|
-
it 'should query Win32_OperatingSystem' do
|
8
|
-
output = @winrm.run_wql('select * from Win32_OperatingSystem')
|
9
|
-
expect(output).to_not be_empty
|
10
|
-
output_caption = output[:win32_operating_system][0][:caption]
|
11
|
-
expect(output_caption).to include('Microsoft')
|
12
|
-
expect(output_caption).to include('Windows')
|
13
|
-
end
|
14
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
describe 'winrm client wql', integration: true do
|
3
|
+
before(:all) do
|
4
|
+
@winrm = winrm_connection
|
5
|
+
end
|
6
|
+
|
7
|
+
it 'should query Win32_OperatingSystem' do
|
8
|
+
output = @winrm.run_wql('select * from Win32_OperatingSystem')
|
9
|
+
expect(output).to_not be_empty
|
10
|
+
output_caption = output[:win32_operating_system][0][:caption]
|
11
|
+
expect(output_caption).to include('Microsoft')
|
12
|
+
expect(output_caption).to include('Windows')
|
13
|
+
end
|
14
|
+
end
|
data/winrm.gemspec
CHANGED
@@ -1,41 +1,40 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
require 'date'
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
s.
|
8
|
-
s.
|
9
|
-
s.
|
10
|
-
|
11
|
-
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
|
15
|
-
|
16
|
-
s.
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
s.
|
23
|
-
s.
|
24
|
-
s.
|
25
|
-
|
26
|
-
|
27
|
-
s.
|
28
|
-
s.
|
29
|
-
s.
|
30
|
-
s.add_runtime_dependency '
|
31
|
-
s.add_runtime_dependency '
|
32
|
-
s.add_runtime_dependency '
|
33
|
-
s.add_runtime_dependency '
|
34
|
-
s.add_runtime_dependency '
|
35
|
-
s.add_runtime_dependency '
|
36
|
-
s.add_runtime_dependency '
|
37
|
-
s.
|
38
|
-
s.add_development_dependency '
|
39
|
-
s.add_development_dependency '
|
40
|
-
|
41
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'date'
|
3
|
+
require File.expand_path('../lib/winrm/version', __FILE__)
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.platform = Gem::Platform::RUBY
|
7
|
+
s.name = 'winrm'
|
8
|
+
s.version = WinRM::VERSION
|
9
|
+
s.date = Date.today.to_s
|
10
|
+
|
11
|
+
s.author = ['Dan Wanek', 'Paul Morton']
|
12
|
+
s.email = ['dan.wanek@gmail.com', 'paul@themortonsonline.com']
|
13
|
+
s.homepage = 'https://github.com/WinRb/WinRM'
|
14
|
+
|
15
|
+
s.summary = 'Ruby library for Windows Remote Management'
|
16
|
+
s.description = <<-EOF
|
17
|
+
Ruby library for Windows Remote Management
|
18
|
+
EOF
|
19
|
+
s.license = 'Apache-2.0'
|
20
|
+
|
21
|
+
s.files = `git ls-files`.split(/\n/)
|
22
|
+
s.require_path = 'lib'
|
23
|
+
s.rdoc_options = %w(-x test/ -x examples/)
|
24
|
+
s.extra_rdoc_files = %w(README.md LICENSE)
|
25
|
+
|
26
|
+
s.bindir = 'bin'
|
27
|
+
s.executables = ['rwinrm']
|
28
|
+
s.required_ruby_version = '>= 1.9.0'
|
29
|
+
s.add_runtime_dependency 'gssapi', '~> 1.2'
|
30
|
+
s.add_runtime_dependency 'httpclient', '~> 2.2', '>= 2.2.0.2'
|
31
|
+
s.add_runtime_dependency 'rubyntlm', '~> 0.4.0'
|
32
|
+
s.add_runtime_dependency 'uuidtools', '~> 2.1.2'
|
33
|
+
s.add_runtime_dependency 'logging', ['>= 1.6.1', '< 3.0']
|
34
|
+
s.add_runtime_dependency 'nori', '~> 2.0'
|
35
|
+
s.add_runtime_dependency 'gyoku', '~> 1.0'
|
36
|
+
s.add_runtime_dependency 'builder', '>= 2.1.2'
|
37
|
+
s.add_development_dependency 'rspec', '~> 3.2'
|
38
|
+
s.add_development_dependency 'rake', '~> 10.3'
|
39
|
+
s.add_development_dependency 'rubocop', '~> 0.28'
|
40
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: winrm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Wanek
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-12-
|
12
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gssapi
|
@@ -197,7 +197,6 @@ files:
|
|
197
197
|
- LICENSE
|
198
198
|
- README.md
|
199
199
|
- Rakefile
|
200
|
-
- VERSION
|
201
200
|
- Vagrantfile
|
202
201
|
- bin/rwinrm
|
203
202
|
- changelog.md
|
@@ -209,6 +208,7 @@ files:
|
|
209
208
|
- lib/winrm/http/transport.rb
|
210
209
|
- lib/winrm/output.rb
|
211
210
|
- lib/winrm/soap_provider.rb
|
211
|
+
- lib/winrm/version.rb
|
212
212
|
- lib/winrm/winrm_service.rb
|
213
213
|
- preamble
|
214
214
|
- spec/auth_timeout_spec.rb
|
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
254
|
version: '0'
|
255
255
|
requirements: []
|
256
256
|
rubyforge_project:
|
257
|
-
rubygems_version: 2.4.
|
257
|
+
rubygems_version: 2.4.5
|
258
258
|
signing_key:
|
259
259
|
specification_version: 4
|
260
260
|
summary: Ruby library for Windows Remote Management
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.3.6
|