diff --git a/Gemfile b/Gemfile index fa75df15..76de7e78 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,6 @@ source 'https://rubygems.org' +gem 'rake', '12.3.3' +gem 'httparty', '0.16.3' + gemspec diff --git a/spec/octocatalog-diff/fixtures/git-repos/simple-repo.tgz b/spec/octocatalog-diff/fixtures/git-repos/simple-repo.tgz new file mode 100644 index 00000000..4e676d00 Binary files /dev/null and b/spec/octocatalog-diff/fixtures/git-repos/simple-repo.tgz differ diff --git a/spec/octocatalog-diff/tests/catalog-util/cached_master_directory_spec.rb b/spec/octocatalog-diff/tests/catalog-util/cached_master_directory_spec.rb index c3e3b916..dbce58ce 100644 --- a/spec/octocatalog-diff/tests/catalog-util/cached_master_directory_spec.rb +++ b/spec/octocatalog-diff/tests/catalog-util/cached_master_directory_spec.rb @@ -7,6 +7,7 @@ require 'json' require 'open3' require 'rugged' +require 'tmpdir' describe OctocatalogDiff::CatalogUtil::CachedMasterDirectory do before(:all) do diff --git a/spec/octocatalog-diff/tests/spec_helper.rb b/spec/octocatalog-diff/tests/spec_helper.rb index b5f13c2b..4cef0918 100644 --- a/spec/octocatalog-diff/tests/spec_helper.rb +++ b/spec/octocatalog-diff/tests/spec_helper.rb @@ -2,7 +2,9 @@ require 'logger' require 'rspec' require 'rspec/retry' +require 'rubygems/package' require 'tempfile' +require 'tmpdir' # Enable SimpleCov coverage testing? if ENV['COVERAGE'] @@ -209,7 +211,7 @@ def self.test_command(command) # Check out fixture repo. The repository is a tarball; this extracts it to a temporary directory and returns # the path where it was checked out. If the checkout fails, returns nil. Note: Be sure to include code in the # caller to clean up the temporary directory upon exit. - # @param repo [String] Name of repository (in fixtures/git-repos/{repo}.tar) + # @param repo [String] Name of repository (in fixtures/git-repos/{repo}.tgz) # @return [String] Path to checkout def self.extract_fixture_repo(repo) # If tar isn't here, don't do this @@ -217,15 +219,14 @@ def self.extract_fixture_repo(repo) return nil unless has_tar.nil? # Make sure tarball is there - repo_tarball = fixture_path("git-repos/#{repo}.tar") + repo_tarball = fixture_path("git-repos/#{repo}.tgz") raise Errno::ENOENT, "Repo tarball for #{repo} not found in #{repo_tarball}" unless File.file?(repo_tarball) # Extract to temporary directory extract_dir = Dir.mktmpdir - cmd = "tar -xf #{Shellwords.escape(repo_tarball)}" - extract_result, extract_code = Open3.capture2e(cmd, chdir: extract_dir) - return extract_dir if extract_code.exitstatus.zero? - raise "Failed to extract #{repo_tarball}: #{extract_result} (#{extract_code.exitstatus})" + io = File.open(repo_tarball, 'rb') + Gem::Package.new("").extract_tar_gz(io, extract_dir) + return extract_dir end # Clean up a temporary directory. This does nothing if the directory doesn't exist, or if it's nil. diff --git a/vendor/cache/ast-2.4.2.gem b/vendor/cache/ast-2.4.2.gem new file mode 100644 index 00000000..abe16436 Binary files /dev/null and b/vendor/cache/ast-2.4.2.gem differ diff --git a/vendor/cache/diff-lcs-1.5.0.gem b/vendor/cache/diff-lcs-1.5.0.gem new file mode 100644 index 00000000..3a258520 Binary files /dev/null and b/vendor/cache/diff-lcs-1.5.0.gem differ diff --git a/vendor/cache/diffy-3.4.2.gem b/vendor/cache/diffy-3.4.2.gem new file mode 100644 index 00000000..f6c83e44 Binary files /dev/null and b/vendor/cache/diffy-3.4.2.gem differ diff --git a/vendor/cache/facter-2.5.7.gem b/vendor/cache/facter-2.5.7.gem new file mode 100644 index 00000000..0c49e7c5 Binary files /dev/null and b/vendor/cache/facter-2.5.7.gem differ diff --git a/vendor/cache/hashdiff-1.1.0.gem b/vendor/cache/hashdiff-1.1.0.gem new file mode 100644 index 00000000..137674c1 Binary files /dev/null and b/vendor/cache/hashdiff-1.1.0.gem differ diff --git a/vendor/cache/hiera-3.12.0.gem b/vendor/cache/hiera-3.12.0.gem new file mode 100644 index 00000000..2a01d965 Binary files /dev/null and b/vendor/cache/hiera-3.12.0.gem differ diff --git a/vendor/cache/httparty-0.21.0.gem b/vendor/cache/httparty-0.21.0.gem new file mode 100644 index 00000000..7c216b03 Binary files /dev/null and b/vendor/cache/httparty-0.21.0.gem differ diff --git a/vendor/cache/json-2.7.1.gem b/vendor/cache/json-2.7.1.gem new file mode 100644 index 00000000..804bba30 Binary files /dev/null and b/vendor/cache/json-2.7.1.gem differ diff --git a/vendor/cache/locale-2.1.3.gem b/vendor/cache/locale-2.1.3.gem new file mode 100644 index 00000000..a12851cd Binary files /dev/null and b/vendor/cache/locale-2.1.3.gem differ diff --git a/vendor/cache/mini_mime-1.1.5.gem b/vendor/cache/mini_mime-1.1.5.gem new file mode 100644 index 00000000..b16e88f5 Binary files /dev/null and b/vendor/cache/mini_mime-1.1.5.gem differ diff --git a/vendor/cache/multi_json-1.15.0.gem b/vendor/cache/multi_json-1.15.0.gem new file mode 100644 index 00000000..8348d7b7 Binary files /dev/null and b/vendor/cache/multi_json-1.15.0.gem differ diff --git a/vendor/cache/parallel-1.24.0.gem b/vendor/cache/parallel-1.24.0.gem new file mode 100644 index 00000000..f2b99ea2 Binary files /dev/null and b/vendor/cache/parallel-1.24.0.gem differ diff --git a/vendor/cache/parser-2.7.2.0.gem b/vendor/cache/parser-2.7.2.0.gem new file mode 100644 index 00000000..66f82f11 Binary files /dev/null and b/vendor/cache/parser-2.7.2.0.gem differ diff --git a/vendor/cache/powerpack-0.1.3.gem b/vendor/cache/powerpack-0.1.3.gem new file mode 100644 index 00000000..c8c1496e Binary files /dev/null and b/vendor/cache/powerpack-0.1.3.gem differ diff --git a/vendor/cache/puppet-5.5.22.gem b/vendor/cache/puppet-5.5.22.gem new file mode 100644 index 00000000..66fc27d9 Binary files /dev/null and b/vendor/cache/puppet-5.5.22.gem differ diff --git a/vendor/cache/rake-12.3.3.gem b/vendor/cache/rake-12.3.3.gem new file mode 100644 index 00000000..e21bbafe Binary files /dev/null and b/vendor/cache/rake-12.3.3.gem differ diff --git a/vendor/cache/ruby-progressbar-1.13.0.gem b/vendor/cache/ruby-progressbar-1.13.0.gem new file mode 100644 index 00000000..c50b94b2 Binary files /dev/null and b/vendor/cache/ruby-progressbar-1.13.0.gem differ diff --git a/vendor/cache/rugged-1.7.1.gem b/vendor/cache/rugged-1.7.1.gem new file mode 100644 index 00000000..67bd447b Binary files /dev/null and b/vendor/cache/rugged-1.7.1.gem differ diff --git a/vendor/cache/unicode-display_width-1.8.0.gem b/vendor/cache/unicode-display_width-1.8.0.gem new file mode 100644 index 00000000..75166d4d Binary files /dev/null and b/vendor/cache/unicode-display_width-1.8.0.gem differ