module Josef::GoogleWorkspace::Config

Public Instance Methods

actor() click to toggle source
# File lib/josef/google_workspace/config.rb, line 13
def actor
  @_actor ||= actor!
end
actor!() click to toggle source
# File lib/josef/google_workspace/config.rb, line 17
def actor!
  if ENV["GOOGLE_WORKSPACE_ACTOR"].nil?
    print("input actor primary mail address:")
    return $stdin.gets.chomp!("\n")
  end

  ENV["GOOGLE_WORKSPACE_ACTOR"]
end
credential_path() click to toggle source
# File lib/josef/google_workspace/config.rb, line 5
def credential_path
  ENV["GOOGLE_WORKSPACE_CREDENTIAL_PATH"]
end
domains(domains_file_path: nil) click to toggle source
# File lib/josef/google_workspace/config.rb, line 26
def domains(domains_file_path: nil)
  path = domains_file_path || ENV["DOMAINS_FILE_PATH"]
  if path.nil?
    print "input your domains file path:"
    path = $stdin.gets.chomp!("\n")
  end
  YAML.load_file(path)["domains"]
end
token_path(path) click to toggle source
# File lib/josef/google_workspace/config.rb, line 9
def token_path(path)
  @_token_path ||= ENV["GOOGLE_WORKSPACE_TOKEN_PATH"] || path
end