Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. def pick_app(&block)
  2. require_user
  3.  
  4. if app = app_from_dot_ninefold_file || app_from_env_id
  5. block.call app
  6. else
  7. load_apps do |apps|
  8.  
  9. if apps.count > 1
  10. if app = interaction(:pickapp, apps)
  11. save_app_in_dot_ninefold_file(app)
  12. block.call app
  13. end
  14. elsif apps.count == 1
  15. say "▸ You have only one app (#{apps[0].name}) proceeding...", :yellow
  16. block.call apps.first
  17. else
  18. puts "You don't have any apps"
  19. end
  20. end
  21. end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement