Module: Kibo::Heroku
Overview
It would be great if we could just use Heroku.read_credentials or ‘heroku whoami` to check for a user’s current login. Well, we can’t:
-
since heroku aggressively pushes its heroku toolbelt people might be forced to uninstall the heroku gem.
-
‘heroku whoami` blocks for input, if the user is not logged in.
Hence this code, which is based on code from the heroku gem.
Copyright and licensing ==================================================
The heroku gem is licensed under the terms of the MIT license, see the file License.MIT.
The heroku gem has been created by Adam Wiggins, and is currently maintained by Wesley Beary.
Instance Method Summary collapse
-
#apps ⇒ Object
returns names of all apps for the current user on heroku.
- #whoami ⇒ Object
Instance Method Details
#apps ⇒ Object
returns names of all apps for the current user on heroku
83 84 85 86 87 88 |
# File 'lib/kibo/heroku.rb', line 83 def apps @apps ||= Kibo::System.heroku("apps", :quiet). split(/\n/). reject { |line| line.empty? || line =~ /=== / }. map { |line| line.split(" ").first } end |
#whoami ⇒ Object
22 23 24 |
# File 'lib/kibo/heroku.rb', line 22 def whoami (read_credentials || []).first end |