add a helper script to update github_usernames.txt file in data dir from github poc json data we have stored in our db
This commit is contained in:
parent
81b290595d
commit
5e3e210f41
1 changed files with 13 additions and 0 deletions
13
lib/tasks/github_usernames_populate.rb
Normal file
13
lib/tasks/github_usernames_populate.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
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
|
Loading…
Add table
Reference in a new issue