Skip to content

Commit

Permalink
#64 show query string
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Sep 18, 2023
1 parent a854f49 commit 204f091
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions discover-repos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,19 @@
end
names = []
page = 0
query = [
"stars:#{opts['min-stars']}..#{opts['max-stars']}",
"size:>=#{opts['min-size']}",
'language:java',
'is:public',
'mirror:false',
'archived:false',
'NOT',
'android'
].join(' ')
loop do
json = github.search_repositories(
[
"stars:#{opts['min-stars']}..#{opts['max-stars']}",
"size:>=#{opts['min-size']}",
'language:java',
'is:public',
'mirror:false',
'archived:false',
'NOT',
'android'
].join(' '),
query,
per_page: size,
page: page
)
Expand All @@ -85,10 +86,12 @@

File.write(
opts[:tex],
'The following search criteria have been used: ' + [
[
' The following search criteria have been used:',
"at least #{opts['min-stars']} and at most #{opts['max-stars']} stars",
"at least #{opts['min-size']}Kb size of Git repo"
].join(', ') + ".\n"
"at least #{opts['min-size']}Kb size of Git repo.",
"The exact query string for GitHub API was the following: ``\\texttt{#{query}}''.\n"
].join
)

path = File.expand_path(opts[:path])
Expand Down

0 comments on commit 204f091

Please sign in to comment.