accounts.rb 670 B

12345678910111213141516171819202122232425262728293031
  1. # frozen_string_literal: true
  2. require 'yaml'
  3. require 'fog'
  4. require 'neo4j'
  5. # NeoInfra Account information
  6. module NeoInfra
  7. models_dir = File.join(
  8. File.dirname(File.expand_path(__FILE__)), '..', 'models'
  9. )
  10. $LOAD_PATH.unshift(models_dir) unless
  11. $LOAD_PATH.include?(models_dir) || $LOAD_PATH.include?(models_dir)
  12. # Provide informations about the accounts available
  13. class Accounts
  14. attr_reader :accounts
  15. def initialize(cfg = 'config.yaml')
  16. @accounts = YAML.load_file(
  17. File.join(File.dirname(File.expand_path(__FILE__)),
  18. '..', '..', cfg)
  19. )
  20. end
  21. def list
  22. accounts['accounts']
  23. end
  24. end
  25. end