lib/faastruby/base.rb in faastruby-0.4.18 vs lib/faastruby/base.rb in faastruby-0.5.0

- old
+ new

@@ -1,7 +1,8 @@ module FaaStRuby ROOT_DOMAIN = ENV['FAASTRUBY_ROOT_DOMAIN'] || 'faastruby.io' + WORKSPACE_BASE_HOST = ENV['FAASTRUBY_WORKSPACE_BASE_HOST'] || 'faast.cloud' DEFAULT_REGION = 'tor1' REGIONS = [ 'tor1' ] class << self @@ -33,18 +34,11 @@ def self.api_host ENV['FAASTRUBY_HOST'] || "https://api.#{region}.#{ROOT_DOMAIN}" end - def self.credentials_file - return File.expand_path(ENV['FAASTRUBY_CREDENTIALS']) if ENV['FAASTRUBY_CREDENTIALS'] - if region == DEFAULT_REGION && File.file?(File.expand_path('~/.faastruby')) - return File.expand_path('~/.faastruby') - elsif region == DEFAULT_REGION - return File.expand_path("~/.faastruby.#{region}") - else - return File.expand_path("~/.faastruby.#{region}") - end + def self.workspace_host_for(workspace_name) + "https://#{workspace_name}.#{region}.#{WORKSPACE_BASE_HOST}" end class Configuration attr_accessor :api_key, :api_secret end