Class: Metanorma::Release::Platform::GitHub::TopicDiscoverer
- Inherits:
-
Object
- Object
- Metanorma::Release::Platform::GitHub::TopicDiscoverer
- Includes:
- RepoDiscoverer
- Defined in:
- lib/metanorma/release/platform/github/topic_discoverer.rb
Instance Method Summary collapse
- #discover ⇒ Object
-
#initialize(client:, organizations:, topic:) ⇒ TopicDiscoverer
constructor
A new instance of TopicDiscoverer.
Constructor Details
#initialize(client:, organizations:, topic:) ⇒ TopicDiscoverer
Returns a new instance of TopicDiscoverer.
10 11 12 13 14 |
# File 'lib/metanorma/release/platform/github/topic_discoverer.rb', line 10 def initialize(client:, organizations:, topic:) @client = client @organizations = organizations @topic = topic end |
Instance Method Details
#discover ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/metanorma/release/platform/github/topic_discoverer.rb', line 16 def discover @organizations.flat_map do |org| query = "topic:#{@topic} org:#{org}" results = @client.search_repositories(query) results[:items].map do |repo| RepoRef.new(owner: org, repo: repo[:name]) end end end |