Class: ReleaseNotes::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
action/lib/release_notes.rb

Overview

Fetches GitHub releases by tag with fallback, caching, and circuit breaking.

Instance Method Summary collapse

Constructor Details

#initialize(client, limit: 10) ⇒ Fetcher

Returns a new instance of Fetcher.



60
61
62
63
64
65
# File 'action/lib/release_notes.rb', line 60

def initialize(client, limit: 10)
  @client = client
  @limit = limit
  @cache = {}
  @disabled = false
end

Instance Method Details

#fetch(repository_url, version) ⇒ Object



67
68
69
70
71
72
# File 'action/lib/release_notes.rb', line 67

def fetch(repository_url, version)
  lookup = Lookup.new(repository_url, version)
  return nil unless fetchable?(lookup)

  cached_release(lookup)
end