diff --git a/Gemfile b/Gemfile index fd39b75..0222bcf 100644 --- a/Gemfile +++ b/Gemfile @@ -28,3 +28,18 @@ instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"] # If you want to load debugging tools into the bundle exec sandbox, # add these additional dependencies into Gemfile.local eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local") + +# These lines added for Windows (x64) development only. +# For ffi-libarchive to function during development on Windows we need the +# binaries in the RbConfig::CONFIG["bindir"] +# +# We copy (and overwrite) these files every time "bundle " is +# executed, just in case they have changed. +if RUBY_PLATFORM =~ /mswin|mingw|windows/ + instance_eval do + ruby_exe_dir = RbConfig::CONFIG["bindir"] + assemblies = Dir.glob(File.expand_path("distro/ruby_bin_folder", Dir.pwd) + "/*.dll") + FileUtils.cp_r assemblies, ruby_exe_dir, verbose: false unless ENV["_BUNDLER_LIBARCHIVE_DLLS_COPIED"] + ENV["_BUNDLER_LIBARCHIVE_DLLS_COPIED"] = "1" + end +end diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..f93e4f9 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,31 @@ +version: "master-{build}" + +os: Visual Studio 2017 +platform: + - x64 + +environment: + matrix: + - ruby_version: "25-x64" + +clone_folder: c:\projects\mixlib-archive +clone_depth: 1 +skip_tags: true +branches: + only: + - master + +install: + - SET PATH=C:\Ruby%ruby_version%\bin;%PATH% + - echo %PATH% + - ruby --version + - gem --version + - gem update --system + - gem install bundler --quiet --no-ri --no-rdoc + - bundler --version + +build_script: + - bundle install + +test_script: + - bundle exec rake \ No newline at end of file diff --git a/distro/ruby_bin_folder/libarchive.dll b/distro/ruby_bin_folder/libarchive.dll new file mode 100644 index 0000000..974e5a7 Binary files /dev/null and b/distro/ruby_bin_folder/libarchive.dll differ diff --git a/distro/ruby_bin_folder/liblzma-5.dll b/distro/ruby_bin_folder/liblzma-5.dll new file mode 100644 index 0000000..4036f49 Binary files /dev/null and b/distro/ruby_bin_folder/liblzma-5.dll differ diff --git a/distro/ruby_bin_folder/libxml2-2.dll b/distro/ruby_bin_folder/libxml2-2.dll new file mode 100644 index 0000000..37e6f79 Binary files /dev/null and b/distro/ruby_bin_folder/libxml2-2.dll differ diff --git a/lib/mixlib/archive.rb b/lib/mixlib/archive.rb index e7bac82..476c0e6 100644 --- a/lib/mixlib/archive.rb +++ b/lib/mixlib/archive.rb @@ -49,14 +49,8 @@ def extract(destination, perms: true, ignore: []) private - BACKSLASH = '\\'.freeze - def path_separator - if Gem.win_platform? - File::ALT_SEPARATOR || BACKSLASH - else - File::SEPARATOR - end + File::SEPARATOR end def create_and_empty(destination)