Class: Metanorma::Release::Platform::Local::Fetcher
- Inherits:
-
Object
- Object
- Metanorma::Release::Platform::Local::Fetcher
- Includes:
- ReleaseFetcher
- Defined in:
- lib/metanorma/release/platform/local/fetcher.rb
Instance Method Summary collapse
- #fetch(repo, etag: nil) ⇒ Object
-
#initialize(base_path:) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(base_path:) ⇒ Fetcher
Returns a new instance of Fetcher.
18 19 20 |
# File 'lib/metanorma/release/platform/local/fetcher.rb', line 18 def initialize(base_path:) @base_path = base_path end |
Instance Method Details
#fetch(repo, etag: nil) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/metanorma/release/platform/local/fetcher.rb', line 22 def fetch(repo, etag: nil) dir = File.join(@base_path, repo.repo) return FetchResult.new(releases: [], etag: nil, unchanged?: false) unless Dir.exist?(dir) releases = Dir.glob(File.join(dir, '*.meta.json')).filter_map do || build_release(dir, ) end FetchResult.new(releases: releases, etag: nil, unchanged?: false) end |