Class: Metanorma::Release::Platform::GitHub::ReleaseFetcher

Inherits:
Object
  • Object
show all
Includes:
ReleaseFetcher
Defined in:
lib/metanorma/release/platform/github/release_fetcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:, download_cache_dir: nil) ⇒ ReleaseFetcher

Returns a new instance of ReleaseFetcher.



18
19
20
21
# File 'lib/metanorma/release/platform/github/release_fetcher.rb', line 18

def initialize(client:, download_cache_dir: nil)
  @client = client
  @download_cache_dir = download_cache_dir
end

Instance Method Details

#fetch(repo, etag: nil) ⇒ Object



23
24
25
26
27
28
# File 'lib/metanorma/release/platform/github/release_fetcher.rb', line 23

def fetch(repo, etag: nil)
  releases = paginate_releases(repo.to_s)
  parsed = releases.map { |r| parse_release(r) }
  FetchResult.new(releases: parsed, etag: "etag-#{repo}",
                  unchanged?: false)
end