mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
Add archive_path helper to Tar and Url fetchers
Eventually I think we'll want this as part of the fetcher API generally. Signed-off-by: Steven Danna <steve@chef.io>
This commit is contained in:
parent
a6ec345eac
commit
02d611e68c
3 changed files with 9 additions and 1 deletions
|
@ -19,6 +19,10 @@ module Fetchers
|
|||
new(target)
|
||||
end
|
||||
|
||||
def archive_path
|
||||
target
|
||||
end
|
||||
|
||||
def initialize(target)
|
||||
@target = target
|
||||
@contents = {}
|
||||
|
|
|
@ -103,6 +103,10 @@ module Fetchers
|
|||
@archive = self.class.download_archive(url, opts)
|
||||
end
|
||||
|
||||
def archive_path
|
||||
@archive.path
|
||||
end
|
||||
|
||||
def url
|
||||
@target
|
||||
end
|
||||
|
|
|
@ -108,7 +108,7 @@ module Inspec
|
|||
if fetcher.class == Fetchers::Local || @vendor_index.exists?(@name, source_url)
|
||||
local_path
|
||||
else
|
||||
@vendor_index.add(@name, source_url, fetcher.archive.path)
|
||||
@vendor_index.add(@name, source_url, fetcher.archive_path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue