Hello community,
here is the log from the commit of package rubygem-winrm-fs for
openSUSE:Factory checked in at 2019-01-21 10:53:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-winrm-fs (Old)
and /work/SRC/openSUSE:Factory/.rubygem-winrm-fs.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-winrm-fs"
Mon Jan 21 10:53:59 2019 rev:7 rq:666048 version:1.3.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-winrm-fs/rubygem-winrm-fs.changes
2018-11-26 10:33:01.848836420 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-winrm-fs.new.28833/rubygem-winrm-fs.changes
2019-01-21 10:54:18.943731435 +0100
@@ -1,0 +2,6 @@
+Mon Jan 14 14:02:28 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to version 1.3.2
+ changelog.md removed upstream
+
+-------------------------------------------------------------------
Old:
----
winrm-fs-1.3.1.gem
New:
----
winrm-fs-1.3.2.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-winrm-fs.spec ++++++
--- /var/tmp/diff_new_pack.wCx0TZ/_old 2019-01-21 10:54:19.739730475 +0100
+++ /var/tmp/diff_new_pack.wCx0TZ/_new 2019-01-21 10:54:19.743730470 +0100
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-winrm-fs
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
#
Name: rubygem-winrm-fs
-Version: 1.3.1
+Version: 1.3.2
Release: 0
%define mod_name winrm-fs
%define mod_full_name %{mod_name}-%{version}
@@ -52,7 +52,7 @@
%install
%gem_install \
--symlink-binaries \
- --doc-files="LICENSE README.md changelog.md" \
+ --doc-files="LICENSE README.md" \
-f
%gem_packages
++++++ winrm-fs-1.3.1.gem -> winrm-fs-1.3.2.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.gitignore new/.gitignore
--- old/.gitignore 2018-10-15 04:01:34.000000000 +0200
+++ new/.gitignore 1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-*.swp
-*.gem
-pkg/*
-.rvmrc
-.idea
-.bundle
-spec/spec/creds*.json
-spec/config.yml
-traces/
-Gemfile.lock
-.vagrant
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.rspec new/.rspec
--- old/.rspec 2018-10-15 04:01:34.000000000 +0200
+++ new/.rspec 1970-01-01 01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
---color
---require spec_helper
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.rubocop.yml new/.rubocop.yml
--- old/.rubocop.yml 2018-10-15 04:01:34.000000000 +0200
+++ new/.rubocop.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,17 +0,0 @@
-inherit_from: .rubocop_todo.yml
-
-Naming/FileName:
- Exclude:
- - 'lib/winrm-fs.rb'
-
-Style/Encoding:
- Enabled: true
-
-Layout/EndOfLine:
- Enabled: false
-
-Metrics/LineLength:
- Max: 120
-
-Metrics/AbcSize:
- Max: 25
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.rubocop_todo.yml new/.rubocop_todo.yml
--- old/.rubocop_todo.yml 2018-10-15 04:01:34.000000000 +0200
+++ new/.rubocop_todo.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,65 +0,0 @@
-# This configuration was generated by
-# `rubocop --auto-gen-config`
-# on 2017-12-12 22:48:53 +0100 using RuboCop version 0.52.0.
-# The point is for the user to remove these configuration records
-# one by one as the offenses are removed from the code base.
-# Note that changes in the inspected code, or installation of new
-# versions of RuboCop, may require this file to be generated again.
-
-# Offense count: 1
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: auto_detection, squiggly, active_support, powerpack,
unindent
-Layout/IndentHeredoc:
- Exclude:
- - 'spec/matchers.rb'
-
-# Offense count: 6
-# Configuration parameters: CountComments, ExcludedMethods.
-Metrics/BlockLength:
- Max: 185
-
-# Offense count: 3
-# Configuration parameters: AllowHeredoc, AllowURI, URISchemes,
IgnoreCopDirectives, IgnoredPatterns.
-# URISchemes: http, https
-Metrics/LineLength:
- Max: 106
-
-# Offense count: 4
-# Configuration parameters: Blacklist.
-# Blacklist: END, (?-mix:EO[A-Z]{1})
-Naming/HeredocDelimiterNaming:
- Exclude:
- - 'lib/winrm-fs/core/file_transporter.rb'
- - 'spec/matchers.rb'
- - 'winrm-fs.gemspec'
-
-# Offense count: 1
-# Configuration parameters: .
-# SupportedStyles: annotated, template, unannotated
-Style/FormatStringToken:
- EnforcedStyle: unannotated
-
-# Offense count: 4
-# Cop supports --auto-correct.
-# Configuration parameters: AutoCorrect, EnforcedStyle.
-# SupportedStyles: predicate, comparison
-Style/NumericPredicate:
- Exclude:
- - 'spec/**/*'
- - 'lib/winrm-fs/core/file_transporter.rb'
- - 'lib/winrm-fs/file_manager.rb'
-
-# Offense count: 1
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
-# SupportedStyles: slashes, percent_r, mixed
-Style/RegexpLiteral:
- Exclude:
- - 'lib/winrm-fs/core/tmp_zip.rb'
-
-# Offense count: 3
-# Configuration parameters: AllowHeredoc, AllowURI, URISchemes,
IgnoreCopDirectives, IgnoredPatterns.
-# URISchemes: http, https
-Metrics/LineLength:
- Max: 106
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.travis.yml new/.travis.yml
--- old/.travis.yml 2018-10-15 04:01:35.000000000 +0200
+++ new/.travis.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-language: ruby
-rvm:
- - 2.2.0
- - 2.3.4
- - 2.4.1
-
-# This prevents testing branches that are created just for PRs
-branches:
- only:
- - master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Gemfile new/Gemfile
--- old/Gemfile 2018-10-15 04:01:35.000000000 +0200
+++ new/Gemfile 1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-source 'https://rubygems.org'
-gemspec
-
-gem 'rb-readline'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile 2018-10-15 04:01:35.000000000 +0200
+++ new/Rakefile 1970-01-01 01:00:00.000000000 +0100
@@ -1,27 +0,0 @@
-require 'rubygems'
-require 'bundler/setup'
-require 'rspec/core/rake_task'
-require 'rubocop/rake_task'
-
-# Change to the directory of this file.
-Dir.chdir(File.expand_path(__dir__))
-
-# For gem creation and bundling
-require 'bundler/gem_tasks'
-
-RSpec::Core::RakeTask.new(:spec) do |task|
- task.pattern = 'spec/unit/*_spec.rb'
- task.rspec_opts = ['--color', '-f documentation']
-end
-
-# Run the integration test suite
-RSpec::Core::RakeTask.new(:integration) do |task|
- task.pattern = 'spec/integration/*_spec.rb'
- task.rspec_opts = ['--color', '-f documentation']
-end
-
-RuboCop::RakeTask.new
-
-task default: %i[spec rubocop]
-
-task all: %i[default integration]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/VERSION new/VERSION
--- old/VERSION 2018-10-15 04:01:35.000000000 +0200
+++ new/VERSION 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-1.3.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Vagrantfile new/Vagrantfile
--- old/Vagrantfile 2018-10-15 04:01:35.000000000 +0200
+++ new/Vagrantfile 1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-VAGRANTFILE_API_VERSION = '2'.freeze
-
-Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
- config.vm.box = 'mwrock/WindowsNano'
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/appveyor.yml new/appveyor.yml
--- old/appveyor.yml 2018-10-15 04:01:35.000000000 +0200
+++ new/appveyor.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,38 +0,0 @@
-version: "master-{build}"
-
-os: Windows Server 2012 R2
-platform:
- - x64
-
-environment:
- winrm_user: test_user
- winrm_password: Pass@word1
-
- matrix:
- - ruby_version: "22"
- winrm_endpoint: http://localhost:5985/wsman
-
-clone_folder: c:\projects\winrm-fs
-clone_depth: 1
-branches:
- only:
- - master
-
-install:
- - ps: net user /add $env:winrm_user $env:winrm_password
- - ps: net localgroup administrators $env:winrm_user /add
- - ps: winrm set winrm/config/client/auth '@{Basic="true"}'
- - ps: winrm set winrm/config/service/auth '@{Basic="true"}'
- - ps: winrm set winrm/config/service '@{AllowUnencrypted="true"}'
- - ps: $env:PATH="C:\Ruby$env:ruby_version\bin;$env:PATH"
- - ps: Write-Host $env:PATH
- - ps: ruby --version
- - ps: gem --version
- - ps: bundler --version
-
-build_script:
- - bundle install || bundle install || bundle install
-
-test_script:
- - SET SPEC_OPTS=--format progress
- - bundle exec rake integration
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/changelog.md new/changelog.md
--- old/changelog.md 2018-10-15 04:01:35.000000000 +0200
+++ new/changelog.md 1970-01-01 01:00:00.000000000 +0100
@@ -1,74 +0,0 @@
-# WinRM-fs Gem Changelog
-# 1.3.1
-- Download files in chunks
-
-# 1.3.0
-- Upload from StringIO object
-- Add missing winrm/exceptions require in file_transporter
-- Use correct way to relativize paths of Zip entries
-
-# 1.2.1
-- Correctly handle unicode filenames
-
-# 1.2.0
-- Add ability to download directories
-
-# 1.1.1
-- Remove empty items from powershell pipeline when extracting zip files
-
-# 1.1.0
-- Convert MD5 hashes to SHA1.
-
-# 1.0.2
-- Fix `Pathname.glob` expansion of shortnames.
-
-# 1.0.1
-- Call ClearScriptBlockCache to prevent OutOfMemoryExceptions
ClearScriptBlockCache
-
-# 1.0.0
-- Using winrm v2. File uploads just got a whole lot faster!
-
-# 0.4.3
-- Fix error handling with wmf5, filtering out progress output from inspected
stderr.
-
-# 0.4.2
-- Improved Powershell error handling in metadata checking.
-
-# 0.4.1
-- Fixes a regression on Windows 2008 R2/Windows 7 and below where the WinRM
service corrupts the check files metadata resulting in malformed destination
paths.
-
-# 0.4.0
-- Correct the destination path of individual files. Always assume it is the
full destination path unless it is an existing directory. This may potentialy
break some callers expecting the remote path to be a directory that winrm-fs
will create if missing as the destination of the local file. A new directory
will not be created and the local file will be uploaded directly to the remote
path.
-
-# 0.3.2
-- Fix re-extraction of cached directories from temp folder when there is more
than one "clean" directory deleted from destination
-
-# 0.3.1
-- Widen logging version constraints to include 2.0 (matching WinRM core gem)
-
-# 0.3.0
-- Jetisons `CommandExecutor` now living in the core WinRM gem and swaps in
implementation currently used in the winrm-transport gem. These changes should
have little visible effect on current consumers of the `FileManager` class with
these exceptions:
- - BREAKING CHANGE: When uploading a directory and the destination directory
exists on the endpoint, the source base directory will be created below the
destination directory on the endpoint and the source directory contents will be
unzipped to that location. Prior to this release, the contents of the source
directory would be unzipped to an existing destination directory without
creating the source base directory. This new behavior is more consistent with
SCP and other well known shell copy commands.
- - `Upload` may now receive an array of source files and directories rather
than just a single file or directory path.
-
-# 0.2.4
-- Fix issue 21, downloading files is extremely slow.
-- Add zip file creation debug logging.
-
-# 0.2.3
-- Fix yielding progress data, issue #23
-
-# 0.2.2
-- Fix powershell streams leaking to standard error breaking Windows 10, issue
#18
-
-# 0.2.1
-- Fixed issue 16 creating zip file on Windows
-
-# 0.2.0
-- Redesigned temp zip file creation system
-- Fixed lots of small edge case issues especially with directory uploads
-- Simplified file manager upload method API to take only a single source file
or directory
-- Expanded acceptable username and hostnames for rwinrmcp
-
-# 0.1.0
-- Initial alpha quality release
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/winrm-fs/core/file_transporter.rb
new/lib/winrm-fs/core/file_transporter.rb
--- old/lib/winrm-fs/core/file_transporter.rb 2018-10-15 04:01:35.000000000
+0200
+++ new/lib/winrm-fs/core/file_transporter.rb 2018-12-20 01:31:25.000000000
+0100
@@ -179,12 +179,12 @@
zip_sha1 = sha1sum(zip_io.path)
hash[zip_sha1] = {
- 'src' => dir,
+ 'src' => dir,
'src_zip' => zip_io.path.to_s,
- 'zip_io' => zip_io,
- 'tmpzip' => "#{TEMP_UPLOAD_DIRECTORY}\\tmpzip-#{zip_sha1}.zip",
- 'dst' => "#{remote}\\#{File.basename(dir)}",
- 'size' => File.size(zip_io.path)
+ 'zip_io' => zip_io,
+ 'tmpzip' => "#{TEMP_UPLOAD_DIRECTORY}\\tmpzip-#{zip_sha1}.zip",
+ 'dst' => "#{remote}\\#{File.basename(dir)}",
+ 'size' => File.size(zip_io.path)
}
end
@@ -197,9 +197,9 @@
def add_file_hash!(hash, local, remote)
logger.debug "creating hash for file #{remote}"
hash[sha1sum(local)] = {
- 'src' => local,
- 'dst' => remote,
- 'size' => local.is_a?(StringIO) ? local.size : File.size(local)
+ 'src' => local,
+ 'dst' => remote,
+ 'size' => local.is_a?(StringIO) ? local.size : File.size(local)
}
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2018-10-15 04:01:34.000000000 +0200
+++ new/metadata 2018-12-20 01:31:25.000000000 +0100
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: winrm-fs
version: !ruby/object:Gem::Version
- version: 1.3.1
+ version: 1.3.2
platform: ruby
authors:
- Shawn Neal
@@ -9,7 +9,7 @@
autorequire:
bindir: bin
cert_chain: []
-date: 2018-10-14 00:00:00.000000000 Z
+date: 2018-12-19 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: erubis
@@ -91,16 +91,22 @@
name: rake
requirement: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ">="
- !ruby/object:Gem::Version
version: '10.3'
+ - - "<"
+ - !ruby/object:Gem::Version
+ version: '13'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - "~>"
+ - - ">="
- !ruby/object:Gem::Version
version: '10.3'
+ - - "<"
+ - !ruby/object:Gem::Version
+ version: '13'
- !ruby/object:Gem::Dependency
name: rspec
requirement: !ruby/object:Gem::Requirement
@@ -140,20 +146,9 @@
- README.md
- LICENSE
files:
-- ".gitignore"
-- ".rspec"
-- ".rubocop.yml"
-- ".rubocop_todo.yml"
-- ".travis.yml"
-- Gemfile
- LICENSE
- README.md
-- Rakefile
-- VERSION
-- Vagrantfile
-- appveyor.yml
- bin/rwinrmcp
-- changelog.md
- lib/winrm-fs.rb
- lib/winrm-fs/core/file_transporter.rb
- lib/winrm-fs/core/tmp_zip.rb
@@ -167,15 +162,9 @@
- lib/winrm-fs/scripts/exists.ps1.erb
- lib/winrm-fs/scripts/extract_files.ps1.erb
- lib/winrm-fs/scripts/scripts.rb
-- spec/config-example.yml
-- spec/integration/file_manager_spec.rb
-- spec/integration/tmp_zip_spec.rb
-- spec/matchers.rb
-- spec/spec_helper.rb
-- spec/unit/tmp_zip_spec.rb
-- winrm-fs.gemspec
homepage: http://github.com/WinRb/winrm-fs
-licenses: []
+licenses:
+- Apache-2.0
metadata: {}
post_install_message:
rdoc_options:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/config-example.yml new/spec/config-example.yml
--- old/spec/config-example.yml 2018-10-15 04:01:35.000000000 +0200
+++ new/spec/config-example.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-endpoint: "http://localhost:55985/wsman"
-user: vagrant
-password: vagrant
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/integration/file_manager_spec.rb
new/spec/integration/file_manager_spec.rb
--- old/spec/integration/file_manager_spec.rb 2018-10-15 04:01:35.000000000
+0200
+++ new/spec/integration/file_manager_spec.rb 1970-01-01 01:00:00.000000000
+0100
@@ -1,303 +0,0 @@
-require 'pathname'
-
-# rubocop:disable BlockLength
-describe WinRM::FS::FileManager do
- let(:upload_dir) { "winrm_#{rand(2**16)}" }
- let(:dest_dir) { File.join(subject.temp_dir, upload_dir) }
- let(:temp_upload_dir) { '$env:TEMP/winrm-upload' }
- let(:spec_dir) { File.expand_path(File.dirname(File.dirname(__FILE__))) }
- let(:this_file) { Pathname.new(__FILE__) }
- let(:service) { winrm_connection }
-
- subject { WinRM::FS::FileManager.new(service) }
-
- before(:each) do
- expect(subject.delete(dest_dir)).to be true
- expect(subject.delete(temp_upload_dir)).to be true
- end
-
- context 'exists?' do
- it 'should exist' do
- expect(subject.exists?('c:/windows')).to be true
- expect(subject.exists?('c:/foobar')).to be false
- end
- end
-
- context 'create and delete dir' do
- it 'should create the directory recursively' do
- subdir = File.join(dest_dir, 'subdir1', 'subdir2')
- expect(subject.create_dir(subdir)).to be true
- expect(subject.exists?(subdir)).to be true
- expect(subject.create_dir(subdir)).to be true
- expect(subject.delete(subdir)).to be true
- expect(subject.exists?(subdir)).to be false
- end
- end
-
- context 'temp_dir' do
- it 'should return the remote users temp dir' do
- expect(subject.temp_dir).to match(%r{C:/Users/\S+/AppData/Local/Temp})
- end
- end
-
- context 'download file' do
- let(:download_dir) { File.join(spec_dir, 'temp') }
- let(:dest_file) { Pathname.new(File.join(dest_dir,
File.basename(this_file))) }
- let(:download_file) { Pathname.new(File.join(download_dir,
File.basename(this_file))) }
-
- before(:each) do
- expect(subject.delete(dest_dir)).to be true
- FileUtils.rm_rf(Dir.glob("#{download_dir}/*"))
- FileUtils.mkdir_p(download_dir)
- end
-
- it 'should download the specified file' do
- subject.upload(this_file, dest_file)
- subject.download(dest_file, download_file)
- expect(File.open(download_file).read).to eq(File.open(this_file).read)
- end
- end
-
- context 'download file chunked' do
- let(:download_dir) { File.join(spec_dir, 'temp') }
- let(:dest_file) { Pathname.new(File.join(dest_dir,
File.basename(this_file))) }
- let(:download_file) { Pathname.new(File.join(download_dir,
File.basename(this_file))) }
-
- before(:each) do
- expect(subject.delete(dest_dir)).to be true
- FileUtils.rm_rf(Dir.glob("#{download_dir}/*"))
- FileUtils.mkdir_p(download_dir)
- end
-
- it 'should download the specified file in 1000 byte chunks' do
- subject.upload(this_file, dest_file)
- subject.download(dest_file, download_file, 1000)
- expect(File.open(download_file).read).to eq(File.open(this_file).read)
- end
- end
-
- context 'download directory' do
- let(:download_dir) { File.join(spec_dir, 'temp') }
- let(:dest_file) { Pathname.new(File.join(dest_dir,
File.basename(this_file))) }
- let(:root_dir) { File.expand_path('../../', File.dirname(__FILE__)) }
- let(:winrm_fs_dir) { File.join(root_dir, 'lib/winrm-fs') }
-
- before(:each) do
- expect(subject.delete(dest_dir)).to be true
- FileUtils.rm_rf(Dir.glob("#{download_dir}/*"))
- FileUtils.mkdir_p(download_dir)
- end
-
- it 'downloads the directory contents recursively' do
- subject.upload(winrm_fs_dir, dest_dir)
- subject.download(dest_dir, download_dir)
-
- Dir.glob(winrm_fs_dir + '/**/*.rb').each do |host_file|
- host_file_rel = Pathname.new(host_file).relative_path_from(
- Pathname.new(winrm_fs_dir)
- ).to_s
- download_file = File.join(download_dir, upload_dir, host_file_rel)
- expect(File.open(download_file).read).to eq(File.open(host_file).read)
- end
- end
- end
-
- context 'upload file' do
- let(:dest_file) { Pathname.new(File.join(dest_dir,
File.basename(this_file))) }
- let(:from_memory) { StringIO.new('Upload From Memory') }
-
- before(:each) do
- expect(subject.delete(dest_dir)).to be true
- end
-
- it 'should upload a single StringIO object to a remote file' do
- subject.upload(from_memory, dest_file)
- expect(subject).to
have_created(dest_file).with_content(from_memory.string)
- end
-
- it 'should error if multiple StringIO objects passed to upload' do
- expect { subject.upload([from_memory, from_memory], dest_file) }
- .to raise_error(WinRM::FS::Core::UploadSourceError)
- end
-
- it 'should error if both a StringIO object and a file path passed to
upload' do
- expect { subject.upload([from_memory, this_file], dest_file) }
- .to raise_error(WinRM::FS::Core::UploadSourceError)
- end
-
- it 'should upload the specified file' do
- subject.upload(this_file, dest_file)
- expect(subject).to have_created(dest_file).with_content(this_file)
- end
-
- it 'should upload to root of the c: drive' do
- subject.upload(this_file, 'c:/winrmtest.rb')
- expect(subject).to
have_created('c:/winrmtest.rb').with_content(this_file)
- subject.delete('c:/winrmtest.rb')
- end
-
- it 'should upload just filename' do
- subject.upload(this_file, 'winrmtest.rb')
- expect(subject).to have_created('winrmtest.rb').with_content(this_file)
- subject.delete('winrmtest.rb')
- end
-
- it 'should upload using relative file path' do
- subject.upload('./spec/integration/file_manager_spec.rb', dest_file)
- expect(subject).to have_created(dest_file).with_content(this_file)
- end
-
- it 'should upload to the specified directory' do
- subject.create_dir(dest_dir)
- subject.upload(this_file, dest_dir)
- expect(subject).to have_created(dest_file).with_content(this_file)
- end
-
- it 'should treat extensionless target as file if not an existing
directory' do
- subject.upload(this_file, dest_dir)
- expect(subject).to have_created(dest_dir).with_content(this_file)
- end
-
- it 'should create extensionless source under target dir if target dir
exists' do
- subject.create_dir(dest_dir)
- src_file = File.expand_path('../../Gemfile', File.dirname(__FILE__))
- subject.upload(src_file, dest_dir)
- expect(subject).to have_created(File.join(dest_dir,
'Gemfile')).with_content(src_file)
- end
-
- it 'should upload to the specified directory with env var' do
- subject.upload(this_file, '$env:Temp')
- expected_dest_file = File.join(subject.temp_dir,
File.basename(this_file))
- expect(subject).to
have_created(expected_dest_file).with_content(this_file)
- end
-
- it 'should upload to Program Files sub dir' do
- subject.create_dir('$env:ProgramFiles/foo')
- subject.upload(this_file, '$env:ProgramFiles/foo')
- expect(subject).to have_created('c:/Program
Files/foo/file_manager_spec.rb') \
- .with_content(this_file)
- end
-
- it 'should upload to the specified nested directory' do
- dest_sub_dir = File.join(dest_dir, 'subdir')
- subject.create_dir(dest_sub_dir)
- dest_sub_dir_file = File.join(dest_sub_dir, File.basename(this_file))
- subject.upload(this_file, dest_sub_dir)
- expect(subject).to
have_created(dest_sub_dir_file).with_content(this_file)
- end
-
- it 'yields progress data' do
- block_called = false
- total_bytes_copied = 0
- total = subject.upload(this_file, dest_file) do |bytes_copied,
total_bytes, local_path, remote_path|
- expect(total_bytes).to be > 0
- total_bytes_copied = bytes_copied
- expect(local_path).to eq(this_file.to_s)
- expect(remote_path).to eq(dest_file.to_s)
- block_called = true
- end
- expect(total_bytes_copied).to eq(total)
- expect(block_called).to be true
- expect(total).to be > 0
- end
-
- it 'should not upload when content matches' do
- subject.upload(this_file, dest_dir)
- bytes_uploaded = subject.upload(this_file, dest_dir)
- expect(bytes_uploaded).to eq 0
- end
-
- it 'should upload when content differs' do
- matchers_file = File.join(spec_dir, 'matchers.rb')
- subject.upload(matchers_file, dest_file)
- bytes_uploaded = subject.upload(this_file, dest_file)
- expect(bytes_uploaded).to be > 0
- end
-
- it 'raises WinRMUploadError when a bad source path is specified' do
- expect { subject.upload('c:/some/non-existant/path/foo', dest_file) }.to
raise_error
- end
- end
-
- context 'upload empty file' do
- let(:empty_src_file) { Tempfile.new('empty') }
- let(:dest_file) { File.join(dest_dir, 'emptyfile.txt') }
-
- it 'creates a new empty file' do
- expect(subject.upload(empty_src_file.path, dest_file)).to be 0
- expect(subject).to have_created(dest_file).with_content('')
- end
-
- it 'overwrites an existing file' do
- expect(subject.upload(this_file, dest_file)).to be > 0
- expect(subject.upload(empty_src_file.path, dest_file)).to be 0
- expect(subject).to have_created(dest_file).with_content('')
- end
- end
-
- context 'upload directory' do
- let(:root_dir) { File.expand_path('../../', File.dirname(__FILE__)) }
- let(:winrm_fs_dir) { File.join(root_dir, 'lib/winrm-fs') }
- let(:core_dir) { File.join(root_dir, 'lib/winrm-fs/core') }
- let(:scripts_dir) { File.join(root_dir, 'lib/winrm-fs/scripts') }
-
- it 'copies the directory contents recursively when directory does not
exist' do
- bytes_uploaded = subject.upload(winrm_fs_dir, dest_dir)
- expect(bytes_uploaded).to be > 0
-
- Dir.glob(winrm_fs_dir + '/**/*.rb').each do |host_file|
- host_file_rel = Pathname.new(host_file).relative_path_from(
- Pathname.new(winrm_fs_dir)
- ).to_s
- remote_file = File.join(dest_dir, host_file_rel)
- expect(subject).to have_created(remote_file).with_content(host_file)
- end
- end
-
- it 'copies the directory recursively when directory does exist' do
- subject.create_dir(dest_dir)
- bytes_uploaded = subject.upload(winrm_fs_dir, dest_dir)
- expect(bytes_uploaded).to be > 0
-
- Dir.glob(winrm_fs_dir + '/**/*.rb').each do |host_file|
- host_file_rel = Pathname.new(host_file).relative_path_from(
- Pathname.new(winrm_fs_dir).dirname
- ).to_s
- remote_file = File.join(dest_dir, host_file_rel)
- expect(subject).to have_created(remote_file).with_content(host_file)
- end
- end
-
- it 'does not copy the directory when content is the same' do
- subject.upload(winrm_fs_dir, dest_dir)
- bytes_uploaded = subject.upload(winrm_fs_dir, dest_dir)
- expect(bytes_uploaded).to eq 0
- end
-
- it 'unzips the directory when cached content is the same' do
- subject.upload(winrm_fs_dir, dest_dir)
- subject.delete(dest_dir)
- expect(subject.exists?(dest_dir)).to be false
- subject.upload(winrm_fs_dir, dest_dir)
- expect(subject.exists?(dest_dir)).to be true
- end
-
- it 'unzips multiple directories when cached content is the same for all' do
- subject.create_dir(dest_dir)
- subject.upload([core_dir, scripts_dir], dest_dir)
- subject.delete(dest_dir)
- expect(subject.exists?(dest_dir)).to be false
- subject.create_dir(dest_dir)
- subject.upload([core_dir, scripts_dir], dest_dir)
- expect(subject.exists?(File.join(dest_dir, 'core'))).to be true
- expect(subject.exists?(File.join(dest_dir, 'scripts'))).to be true
- end
-
- it 'copies the directory when content differs' do
- subject.upload(winrm_fs_dir, dest_dir)
- bytes_uploaded = subject.upload(core_dir, dest_dir)
- expect(bytes_uploaded).to be > 0
- end
- end
-end
-# rubocop:enable BlockLength
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/integration/tmp_zip_spec.rb
new/spec/integration/tmp_zip_spec.rb
--- old/spec/integration/tmp_zip_spec.rb 2018-10-15 04:01:35.000000000
+0200
+++ new/spec/integration/tmp_zip_spec.rb 1970-01-01 01:00:00.000000000
+0100
@@ -1,26 +0,0 @@
-require_relative '../../lib/winrm-fs/core/tmp_zip'
-
-describe WinRM::FS::Core::TmpZip do
- let(:winrm_fs_dir) { File.expand_path('../../lib/winrm-fs',
File.dirname(__FILE__)) }
-
- subject { WinRM::FS::Core::TmpZip.new(winrm_fs_dir) }
-
- context 'temp file creation' do
- it 'should create a temp file on disk' do
- path = subject.path
- expect(File.exist?(path)).to be true
- subject.unlink
- expect(File.exist?(path)).to be false
- end
- end
-
- context 'create zip' do
- it 'should add all files in directory to the zip recursively' do
- expect(subject).to contain_zip_entries([
- 'exceptions.rb',
- 'core/tmp_zip.rb',
- 'scripts/checksum.ps1.erb'
- ])
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/matchers.rb new/spec/matchers.rb
--- old/spec/matchers.rb 2018-10-15 04:01:35.000000000 +0200
+++ new/spec/matchers.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,57 +0,0 @@
-require 'rspec/expectations'
-
-RSpec::Matchers.define :have_created do |remote_file|
- match do |file_manager|
- if @expected_content
- downloaded_file = Tempfile.new('downloaded')
- downloaded_file.close
-
- subject.download(remote_file, downloaded_file.path)
- @actual_content = File.read(downloaded_file.path)
- downloaded_file.delete
-
- file_manager.exists?(remote_file) && \
- @actual_content == @expected_content
- else
- file_manager.exists?(remote_file)
- end
- end
- chain :with_content do |expected_content|
- expected_content = File.read(expected_content) if
File.file?(expected_content)
- @expected_content = expected_content
- end
- failure_message do
- if @expected_content
- <<-EOH
-Expected file '#{remote_file}' to exist with content:
-
-#{@expected_content}
-
-but instead got content:
-
-#{@actual_content}
- EOH
- else
- "Expected file '#{remote_file}' to exist"
- end
- end
-end
-
-RSpec::Matchers.define :contain_zip_entries do |zip_entries|
- match do |temp_zip_file|
- zip_entries = [zip_entries] if zip_entries.is_a? String
- @zip_file = Zip::File.open(temp_zip_file.path)
- @missing_entries = []
- zip_entries.each do |entry|
- @missing_entries << entry unless @zip_file.find_entry(entry)
- end
- @missing_entries.empty?
- end
- failure_message do |temp_zip_file|
- msg = "Expected #{temp_zip_file.path} to contain zip entries:
#{@missing_entries}\n Got: "
- @zip_file.each do |entry|
- msg << entry.name << ', '
- end
- msg
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/spec_helper.rb new/spec/spec_helper.rb
--- old/spec/spec_helper.rb 2018-10-15 04:01:35.000000000 +0200
+++ new/spec/spec_helper.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,66 +0,0 @@
-require 'rubygems'
-require 'bundler/setup'
-require 'winrm-fs'
-require 'json'
-require_relative 'matchers'
-
-# Creates a WinRM connection for integration tests
-module ConnectionHelper
- def winrm_connection
- WinRM::Connection.new(config)
- end
-
- def config
- @config ||= begin
- cfg = symbolize_keys(YAML.safe_load(File.read(winrm_config_path)))
- cfg[:basic_auth_only] = true unless cfg[:transport].eql? :kerberos
- merge_environment!(cfg)
- cfg
- end
- end
-
- def merge_environment!(config)
- merge_config_option_from_environment(config, 'user')
- merge_config_option_from_environment(config, 'password')
- merge_config_option_from_environment(config, 'no_ssl_peer_verification')
- config[:options][:ssl_peer_fingerprint] = ENV['winrm_cert'] if
ENV['use_ssl_peer_fingerprint']
- config[:endpoint] = ENV['winrm_endpoint'] if ENV['winrm_endpoint']
- config[:transport] = ENV['winrm_transport'] if ENV['winrm_transport']
- end
-
- def merge_config_option_from_environment(config, key)
- env_key = 'winrm_' + key
- config[key.to_sym] = ENV[env_key] if ENV[env_key]
- end
-
- def winrm_config_path
- # Copy config-example.yml to config.yml and edit for your local
configuration
- path = File.expand_path("#{File.dirname(__FILE__)}/config.yml")
- unless File.exist?(path)
- # user hasn't done this, so use sane defaults for unit tests
- path = File.expand_path("#{File.dirname(__FILE__)}/config-example.yml")
- end
- path
- end
-
- # rubocop:disable Metrics/MethodLength
- def symbolize_keys(hash)
- hash.each_with_object({}) do |(key, value), result|
- new_key = case key
- when String then key.to_sym
- else key
- end
- new_value = case value
- when Hash then symbolize_keys(value)
- else value
- end
- result[new_key] = new_value
- result
- end
- end
- # rubocop:enable Metrics/MethodLength
-end
-
-RSpec.configure do |config|
- config.include(ConnectionHelper)
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/unit/tmp_zip_spec.rb
new/spec/unit/tmp_zip_spec.rb
--- old/spec/unit/tmp_zip_spec.rb 2018-10-15 04:01:35.000000000 +0200
+++ new/spec/unit/tmp_zip_spec.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,78 +0,0 @@
-#
-# Author:: Fletcher (<[email protected]>)
-#
-# Copyright (C) 2015, Fletcher Nichol
-#
-# Licensed under the Apache License, Version 2.0 (the 'License');
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an 'AS IS' BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-require 'winrm-fs/core/tmp_zip'
-
-describe WinRM::FS::Core::TmpZip do
- let(:src_dir) do
- tmpdir = Pathname.new(Dir.mktmpdir)
- @tmpdirs << tmpdir
- src_dir = tmpdir.join('src')
- sub_dir = src_dir.join('veggies')
-
- src_dir.mkpath
- create_local_file(src_dir.join('apple.txt'), 'appleapple')
- create_local_file(src_dir.join('banana.txt'), 'bananabanana')
- create_local_file(src_dir.join('cherry.txt'), 'cherrycherry')
- sub_dir.mkpath
- create_local_file(sub_dir.join('carrot.txt'), 'carrotcarrot')
- src_dir
- end
-
- let(:tmp_zip) { WinRM::FS::Core::TmpZip.new(src_dir) }
-
- before { @tmpdirs = [] }
-
- after do
- @tmpdirs.each(&:rmtree)
- tmp_zip.unlink if tmp_zip.path
- end
-
- it '#path returns path to created zip file' do
- expect(tmp_zip.path.file?).to eq true
- end
-
- it '#unlink removes the file' do
- path = tmp_zip.path
- expect(path.file?).to eq true
-
- tmp_zip.unlink
-
- expect(path.file?).to eq false
- expect(tmp_zip.path).to eq nil
- end
-
- describe 'for a zip file containing the base directory' do
- let(:tmp_zip) { WinRM::FS::Core::TmpZip.new(src_dir) }
-
- it 'contains the input entries' do
- zip = Zip::File.new(tmp_zip.path)
-
- expect(zip.map(&:name).sort).to eq(
- ['apple.txt', 'banana.txt', 'cherry.txt', 'veggies/carrot.txt']
- )
- expect(zip.read('apple.txt')).to eq 'appleapple'
- expect(zip.read('banana.txt')).to eq 'bananabanana'
- expect(zip.read('cherry.txt')).to eq 'cherrycherry'
- expect(zip.read('veggies/carrot.txt')).to eq 'carrotcarrot'
- end
- end
-
- def create_local_file(path, content)
- path.open('wb') { |file| file.write(content) }
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/winrm-fs.gemspec new/winrm-fs.gemspec
--- old/winrm-fs.gemspec 2018-10-15 04:01:35.000000000 +0200
+++ new/winrm-fs.gemspec 1970-01-01 01:00:00.000000000 +0100
@@ -1,36 +0,0 @@
-require 'date'
-
-version = File.read(File.expand_path('VERSION', __dir__)).strip
-
-Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = 'winrm-fs'
- s.version = version
- s.date = Date.today.to_s
-
- s.author = ['Shawn Neal', 'Matt Wrock']
- s.email = ['[email protected]', '[email protected]']
- s.homepage = 'http://github.com/WinRb/winrm-fs'
-
- s.summary = 'WinRM File System'
- s.description = <<-EOF
- Ruby library for file system operations via Windows Remote Management
- EOF
-
- s.files = `git ls-files`.split(/\n/)
- s.require_path = 'lib'
- s.rdoc_options = %w[-x test/ -x examples/]
- s.extra_rdoc_files = %w[README.md LICENSE]
-
- s.bindir = 'bin'
- s.executables = ['rwinrmcp']
- s.required_ruby_version = '>= 2.2.0'
- s.add_runtime_dependency 'erubis', '~> 2.7'
- s.add_runtime_dependency 'logging', ['>= 1.6.1', '< 3.0']
- s.add_runtime_dependency 'rubyzip', '~> 1.1'
- s.add_runtime_dependency 'winrm', '~> 2.0'
- s.add_development_dependency 'pry'
- s.add_development_dependency 'rake', '~> 10.3'
- s.add_development_dependency 'rspec', '~> 3.0'
- s.add_development_dependency 'rubocop', '~> 0.51'
-end