15 lines
369 B
Ruby
15 lines
369 B
Ruby
# frozen_string_literal: true
|
|
|
|
class GithubUsernamesPopulate
|
|
def self.usernames_from_pocs
|
|
GithubPoc.pluck(:owner).map { |h| h['login'] }.sort.uniq
|
|
end
|
|
|
|
def self.update_file
|
|
fp = '/data_importer/data/github_usernames.txt'
|
|
File.open(fp, 'w+') do |f|
|
|
puts "Updating username file found at #{fp}"
|
|
f.puts(usernames_from_pocs)
|
|
end
|
|
end
|
|
end
|