Skip to content

Commit 43e806e

Browse files
authored
Merge pull request #267 from cjmartian/update-rake
Update rake to 12.3.3
2 parents 483bcdc + ff8cd97 commit 43e806e

23 files changed

+11
-6
lines changed

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
source 'https://rubygems.org'
22

3+
gem 'rake', '12.3.3'
4+
gem 'httparty', '0.16.3'
5+
36
gemspec
Binary file not shown.

spec/octocatalog-diff/tests/catalog-util/cached_master_directory_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
require 'json'
88
require 'open3'
99
require 'rugged'
10+
require 'tmpdir'
1011

1112
describe OctocatalogDiff::CatalogUtil::CachedMasterDirectory do
1213
before(:all) do

spec/octocatalog-diff/tests/spec_helper.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
require 'logger'
33
require 'rspec'
44
require 'rspec/retry'
5+
require 'rubygems/package'
56
require 'tempfile'
7+
require 'tmpdir'
68

79
# Enable SimpleCov coverage testing?
810
if ENV['COVERAGE']
@@ -209,23 +211,22 @@ def self.test_command(command)
209211
# Check out fixture repo. The repository is a tarball; this extracts it to a temporary directory and returns
210212
# the path where it was checked out. If the checkout fails, returns nil. Note: Be sure to include code in the
211213
# caller to clean up the temporary directory upon exit.
212-
# @param repo [String] Name of repository (in fixtures/git-repos/{repo}.tar)
214+
# @param repo [String] Name of repository (in fixtures/git-repos/{repo}.tgz)
213215
# @return [String] Path to checkout
214216
def self.extract_fixture_repo(repo)
215217
# If tar isn't here, don't do this
216218
has_tar = test_command('tar --version')
217219
return nil unless has_tar.nil?
218220

219221
# Make sure tarball is there
220-
repo_tarball = fixture_path("git-repos/#{repo}.tar")
222+
repo_tarball = fixture_path("git-repos/#{repo}.tgz")
221223
raise Errno::ENOENT, "Repo tarball for #{repo} not found in #{repo_tarball}" unless File.file?(repo_tarball)
222224

223225
# Extract to temporary directory
224226
extract_dir = Dir.mktmpdir
225-
cmd = "tar -xf #{Shellwords.escape(repo_tarball)}"
226-
extract_result, extract_code = Open3.capture2e(cmd, chdir: extract_dir)
227-
return extract_dir if extract_code.exitstatus.zero?
228-
raise "Failed to extract #{repo_tarball}: #{extract_result} (#{extract_code.exitstatus})"
227+
io = File.open(repo_tarball, 'rb')
228+
Gem::Package.new("").extract_tar_gz(io, extract_dir)
229+
return extract_dir
229230
end
230231

231232
# Clean up a temporary directory. This does nothing if the directory doesn't exist, or if it's nil.

vendor/cache/ast-2.4.2.gem

11.5 KB
Binary file not shown.

vendor/cache/diff-lcs-1.5.0.gem

51.5 KB
Binary file not shown.

vendor/cache/diffy-3.4.2.gem

17.5 KB
Binary file not shown.

vendor/cache/facter-2.5.7.gem

242 KB
Binary file not shown.

vendor/cache/hashdiff-1.1.0.gem

20.5 KB
Binary file not shown.

vendor/cache/hiera-3.12.0.gem

40 KB
Binary file not shown.

0 commit comments

Comments
 (0)