Class: FetchEmails
- Inherits:
-
Object
- Object
- FetchEmails
- Defined in:
- lib/renuo/cli/app/fetch_emails.rb
Instance Method Summary collapse
- #fetch_emails ⇒ Object
-
#initialize ⇒ FetchEmails
constructor
A new instance of FetchEmails.
- #run(_args) ⇒ Object
Constructor Details
#initialize ⇒ FetchEmails
Returns a new instance of FetchEmails.
5 |
# File 'lib/renuo/cli/app/fetch_emails.rb', line 5 def initialize; end |
Instance Method Details
#fetch_emails ⇒ Object
7 8 9 10 11 |
# File 'lib/renuo/cli/app/fetch_emails.rb', line 7 def fetch_emails uri = URI.parse('https://docs.google.com/spreadsheets/d/1rJFJQCgpz6GajMlGf0anKwVl5AY6TrYjMnJ4W-_0MK4/pub?gid=703649940&single=true&output=csv') response = Net::HTTP.get_response(uri) response.body.gsub(/\r\n/, "\n").split("\n").reject { |add| add == 'n/a' } end |
#run(_args) ⇒ Object
13 14 15 16 |
# File 'lib/renuo/cli/app/fetch_emails.rb', line 13 def run(_args) say '# Here is a complete lit of Renuo email addresses'.colorize :green say fetch_emails.join("\n") end |