winrm-fs 1.3.2 → 1.3.3
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/bin/rwinrmcp +2 -0
- data/lib/winrm-fs.rb +2 -0
- data/lib/winrm-fs/core/file_transporter.rb +9 -6
- data/lib/winrm-fs/core/tmp_zip.rb +2 -0
- data/lib/winrm-fs/exceptions.rb +2 -0
- data/lib/winrm-fs/file_manager.rb +2 -0
- data/lib/winrm-fs/scripts/scripts.rb +18 -2
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50955d22b742357863bd9beb397749584b1b046c9518aac1f9f2b3e0de00a52d
|
4
|
+
data.tar.gz: f6db619ac3e5ec8de7548bc952873db08adb037ca857229d732f1bf2a4e68b38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb205cc374f1984460ae1df012da09f2736316e9a59574178406cc6cf3521ba236bfb913d2b05b644be8c10aa510819b510978af59071710a6905f2fa825f1c5
|
7
|
+
data.tar.gz: 00cfc7deebc434e296eef58cb0fa4e8321f645b7c5f503d68bf6ca3064f9d42aaaa6a1d49f9890f9d0c631ca146343926b25a6249fb014ccfb3eb91f390445ae
|
data/bin/rwinrmcp
CHANGED
data/lib/winrm-fs.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
|
1
3
|
#
|
2
4
|
# Author:: Fletcher (<fnichol@nichol.ca>)
|
3
5
|
#
|
@@ -31,7 +33,7 @@ module WinRM
|
|
31
33
|
#
|
32
34
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
33
35
|
class FileTransporterFailed < ::WinRM::WinRMError; end
|
34
|
-
# rubocop:disable MethodLength, AbcSize, ClassLength
|
36
|
+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/ClassLength
|
35
37
|
|
36
38
|
# Exception for the case where upload source contains more than one
|
37
39
|
# StringIO object, or a combination of file/directory paths and StringIO object
|
@@ -449,8 +451,9 @@ module WinRM
|
|
449
451
|
read_size = ((max_encoded_write - dest.length) / 4) * 3
|
450
452
|
chunk = 1
|
451
453
|
bytes = 0
|
454
|
+
# Do not freeze this string
|
452
455
|
buffer = ''
|
453
|
-
shell.run(<<-
|
456
|
+
shell.run(<<-PS
|
454
457
|
$to = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("#{dest}")
|
455
458
|
$parent = Split-Path $to
|
456
459
|
if(!(Test-path $parent)) { mkdir $parent | Out-Null }
|
@@ -469,7 +472,7 @@ module WinRM
|
|
469
472
|
# ClearScriptBlockCache to clear it.
|
470
473
|
$bindingFlags= [Reflection.BindingFlags] "NonPublic,Static"
|
471
474
|
$method = [scriptblock].GetMethod("ClearScriptBlockCache", $bindingFlags)
|
472
|
-
|
475
|
+
PS
|
473
476
|
)
|
474
477
|
|
475
478
|
while input_io.read(read_size, buffer)
|
@@ -486,11 +489,11 @@ module WinRM
|
|
486
489
|
end
|
487
490
|
|
488
491
|
def stream_command(encoded_bytes)
|
489
|
-
<<-
|
492
|
+
<<-PS
|
490
493
|
if($method) { $method.Invoke($Null, $Null) }
|
491
494
|
$bytes=[Convert]::FromBase64String('#{encoded_bytes}')
|
492
495
|
$fileStream.Write($bytes, 0, $bytes.length)
|
493
|
-
|
496
|
+
PS
|
494
497
|
end
|
495
498
|
|
496
499
|
# Uploads a local file.
|
@@ -560,7 +563,7 @@ module WinRM
|
|
560
563
|
size / 3 * 4
|
561
564
|
end
|
562
565
|
end
|
563
|
-
# rubocop:enable MethodLength, AbcSize, ClassLength
|
566
|
+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/ClassLength
|
564
567
|
end
|
565
568
|
end
|
566
569
|
end
|
data/lib/winrm-fs/exceptions.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Copyright 2015 Shawn Neal <sneal@sneal.net>
|
3
5
|
#
|
@@ -13,18 +15,32 @@
|
|
13
15
|
# See the License for the specific language governing permissions and
|
14
16
|
# limitations under the License.
|
15
17
|
|
16
|
-
require '
|
18
|
+
require 'erubi'
|
17
19
|
|
18
20
|
module WinRM
|
19
21
|
module FS
|
20
22
|
# PS1 scripts
|
21
23
|
module Scripts
|
24
|
+
# rubocop:disable Metrics/MethodLength
|
22
25
|
def self.render(template, context)
|
26
|
+
# rubocop:enable Metrics/MethodLength
|
23
27
|
template_path = File.expand_path(
|
24
28
|
"#{File.dirname(__FILE__)}/#{template}.ps1.erb"
|
25
29
|
)
|
26
30
|
template = File.read(template_path)
|
27
|
-
|
31
|
+
case context
|
32
|
+
when Hash
|
33
|
+
b = binding
|
34
|
+
locals = context.collect { |k, _| "#{k} = context[#{k.inspect}]; " }
|
35
|
+
b.eval(locals.join)
|
36
|
+
when Binding
|
37
|
+
b = context
|
38
|
+
when NilClass
|
39
|
+
b = binding
|
40
|
+
else
|
41
|
+
raise ArgumentError
|
42
|
+
end
|
43
|
+
b.eval(Erubi::Engine.new(template).src)
|
28
44
|
end
|
29
45
|
end
|
30
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: winrm-fs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shawn Neal
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-11-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: erubi
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '1.8'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '1.8'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: logging
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,14 +127,14 @@ dependencies:
|
|
127
127
|
requirements:
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
130
|
+
version: 0.68.0
|
131
131
|
type: :development
|
132
132
|
prerelease: false
|
133
133
|
version_requirements: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version:
|
137
|
+
version: 0.68.0
|
138
138
|
description: " Ruby library for file system operations via Windows Remote Management\n"
|
139
139
|
email:
|
140
140
|
- sneal@sneal.net
|
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
186
|
version: '0'
|
187
187
|
requirements: []
|
188
188
|
rubyforge_project:
|
189
|
-
rubygems_version: 2.7.
|
189
|
+
rubygems_version: 2.7.8
|
190
190
|
signing_key:
|
191
191
|
specification_version: 4
|
192
192
|
summary: WinRM File System
|