Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chefstyle fixes + test on Windows in Buildkite #43

Merged
merged 1 commit into from
Aug 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .expeditor/verify.pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
expeditor:
defaults:
buildkite:
timeout_in_minutes: 30

steps:

- label: run-lint-and-specs-ruby-2.4
Expand Down Expand Up @@ -32,3 +38,12 @@ steps:
executor:
docker:
image: ruby:2.6-stretch

- label: run-specs-windows
command:
- bundle install --jobs=7 --retry=3 --without docs debug
- bundle exec rake
expeditor:
executor:
docker:
host_os: windows
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Mixlib::Archive

[![Build status](https://badge.buildkite.com/96888f3b2f7a78af28fea0350cd3737011ab0f998627439e65.svg)](https://buildkite.com/chef-oss/chef-mixlib-archive-master-verify)
[![Gem Version](https://badge.fury.io/rb/mixlib-archive.svg)](https://badge.fury.io/rb/mixlib-archive)
[![Build status](https://badge.buildkite.com/96888f3b2f7a78af28fea0350cd3737011ab0f998627439e65.svg)](https://buildkite.com/chef-oss/chef-mixlib-archive-master-verify)

**Umbrella Project**: [Chef Foundation](https://github.com/chef/chef-oss-practices/blob/master/projects/chef-foundation.md)

Expand Down Expand Up @@ -69,7 +69,7 @@ For information on contributing to this project please see our [Contributing Doc

## License & Copyright

- Copyright:: Copyright (c) 2017-2018 Chef Software, Inc.
- Copyright:: Copyright (c) 2017-2019 Chef Software, Inc.
- License:: Apache License, Version 2.0

```text
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ task :console do
IRB.start
end

task default: [:spec, :style]
task default: %i{spec style}
46 changes: 0 additions & 46 deletions appveyor.yml

This file was deleted.

1 change: 1 addition & 0 deletions lib/mixlib/archive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def create_and_empty(destination)
if @empty
Dir.foreach(destination) do |entry|
next if entry == "." || entry == ".."

FileUtils.remove_entry_secure(File.join(destination, entry))
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/mixlib/archive_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@
end

it "runs the extractor" do
expect(archiver).to receive(:extract).with(destination, { perms: true, ignore: [/^\.$/, /\.{2}\//] })
expect(archiver).to receive(:extract).with(destination, { perms: true, ignore: [/^\.$/, %r{\.{2}/}] })
archive.extract(destination)
end

it "passes options to the extractor" do
expect(archiver).to receive(:extract).with(destination, { perms: false, ignore: [/^\.$/, /\.{2}\//] })
expect(archiver).to receive(:extract).with(destination, { perms: false, ignore: [/^\.$/, %r{\.{2}/}] })
archive.extract(destination, perms: false)
end

it "allows the user to ignore more patterns" do
expect(archiver).to receive(:extract).with(destination, { perms: false, ignore: [/^\.$/, /\.{2}\//, /^$/] })
expect(archiver).to receive(:extract).with(destination, { perms: false, ignore: [/^\.$/, %r{\.{2}/}, /^$/] })
archive.extract(destination, perms: false, ignore: [/^$/])
end

it "accepts a single ignore pattern" do
expect(archiver).to receive(:extract).with(destination, { perms: false, ignore: [/^\.$/, /\.{2}\//, /^$/] })
expect(archiver).to receive(:extract).with(destination, { perms: false, ignore: [/^\.$/, %r{\.{2}/}, /^$/] })
archive.extract(destination, perms: false, ignore: /^$/)
end
end
Expand Down