manageiq-cross_repo 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b38eb0b95370e949b880cb5f8b21c790fd351cbaa323aecb5ac5e92d981b61eb
4
- data.tar.gz: 657c13c434c3ea924479366261c10ee995772eb55ac3dc6a8edeb5ded0fcbd33
3
+ metadata.gz: 3ff6896410d55e14769981d4ee061c8557c409743968d191944476ea861c35d6
4
+ data.tar.gz: 78a605b9ea4cfe657219b957cd3ef9444c026209aa4e62ce5d5598664a5760f5
5
5
  SHA512:
6
- metadata.gz: 2943f4aec0723d7636e59096f0919d6fb9458e97dfebc5f12dff1e6fc143885f2c220608d93a210a307b969e08898575b961a7d3d477f31923ebd8b668937304
7
- data.tar.gz: 5fcf9c9822b685b53f099570081426c457d6cd6499bc76adfe682106102ea8012e66feb4b1dcbf4d27663a8b3fcfc39771b4d0c868e4e3e2ae3e01788c1b85ee
6
+ metadata.gz: 98dcd86001183007093fef2b42335af5975672dc8a3bda97eb16bb6d8daa89f9d6b9e0e610bb0795098a202c3ffbb3e00d4fb6420932b26065413322820dedd6
7
+ data.tar.gz: 6745a6f57b19d966f43b5684cc23a03c631f771f7610c8fe41da018b0acb1b65dc34f43e71dbadc483806b89256684e074b54beb968f006ff3fb959e4003b591
@@ -34,7 +34,7 @@ module ManageIQ::CrossRepo
34
34
  puts "Fetching #{tarball_url}"
35
35
 
36
36
  Dir.mktmpdir do |dir|
37
- Mixlib::Archive.new(open(tarball_url, "rb")).extract(dir)
37
+ Mixlib::Archive.new(open_tarball_url(tarball_url)).extract(dir)
38
38
 
39
39
  content_dir = Pathname.new(dir).children.detect(&:directory?)
40
40
  FileUtils.mkdir_p(path.dirname)
@@ -147,6 +147,19 @@ module ManageIQ::CrossRepo
147
147
  url && File.join(url, "tarball", sha)
148
148
  end
149
149
 
150
+ def open_tarball_url(url)
151
+ archive = open(tarball_url, "rb")
152
+
153
+ if archive.kind_of?(StringIO)
154
+ archive = Tempfile.new('cross_repo').tap do |f|
155
+ f.write(archive.string)
156
+ f.fsync
157
+ end.path
158
+ end
159
+
160
+ archive
161
+ end
162
+
150
163
  def git_branch_to_sha(url, branch)
151
164
  `git ls-remote #{url} #{branch}`.split("\t").first
152
165
  end
@@ -73,7 +73,11 @@ module ManageIQ::CrossRepo
73
73
  if gem_repos.empty?
74
74
  FileUtils.rm_f override_path
75
75
  else
76
- content = gem_repos.map { |gem| "ensure_gem \"#{gem.repo}\", :path => \"#{gem.path}\"" }.join("\n")
76
+ content = gem_repos.map do |gem|
77
+ # If there is a gemspec get the name of the gem from that instead of the repository
78
+ gem_name = gem.path.glob("*.gemspec")&.first&.basename(".gemspec") || gem.repo
79
+ "ensure_gem \"#{gem_name}\", :path => \"#{gem.path}\""
80
+ end.join("\n")
77
81
  FileUtils.mkdir_p(bundler_d_path)
78
82
 
79
83
  File.write(override_path, content)
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module CrossRepo
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-cross_repo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Authors
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-25 00:00:00.000000000 Z
11
+ date: 2020-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  requirements: []
155
- rubygems_version: 3.0.6
155
+ rubygems_version: 3.1.2
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: ManageIQ CrossRepo testing library