Skip to content

Commit

Permalink
Merge pull request #2 from derikolsson/cache-endpoint
Browse files Browse the repository at this point in the history
Updates high-performance endpoint to cdn-api.ooyala.com
  • Loading branch information
Pepegasca committed Jul 24, 2014
2 parents 2f76902 + ddd12b1 commit c7036dd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions gem-ooyala-v2-api/lib/ooyala-v2-api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ module Ooyala
class API
SUPPORTED_HTTP_METHODS = %w{GET POST PUT PATCH DELETE}
DEFAULT_BASE_URL = 'https://api.ooyala.com'
DEFAULT_CACHE_BASE_URL = 'https://cdn.api.ooyala.com'
DEFAULT_CACHE_BASE_URL = 'https://cdn-api.ooyala.com'
DEFAULT_EXPIRATION_WINDOW = 15
ROUND_UP_TIME = 300

# Sets the String base URL (default: "https://api.ooyala.com").
attr_writer :base_url

# Sets the String cache base URL (default: "https://cdn.api.ooyala.com").
# Sets the String cache base URL (default: "https://cdn-api.ooyala.com").
attr_writer :cache_base_url

# Sets the Number with the expiration window. This is added to the current
Expand Down
6 changes: 3 additions & 3 deletions gem-ooyala-v2-api/test/test_ooyala-v2-api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_generate_signature_with_payload

def test_build_url
url = @ooyala_api.build_url 'GET', '/v2/players/HbxJKM'
assert url.include?('https://cdn.api.ooyala.com/')
assert url.include?('https://cdn-api.ooyala.com/')
assert url.include?('/v2/players/HbxJKM')
url = @ooyala_api.build_url 'POST', '/v2/players/HbxJKM',
{:test => true, 'a' => 'b'}
Expand Down Expand Up @@ -101,7 +101,7 @@ def test_send_request_should_escape_query_parameters
res = RestClient::Response
mock(RestClient::Request).new.with_any_args do |*args|
assert args.first[:url].include?(
"https://cdn.api.ooyala.com/v2/players/HbxJKM")
"https://cdn-api.ooyala.com/v2/players/HbxJKM")
assert args.first[:url].include?("test=%27tr+ue%27")
assert args.first[:url].include?("other=1")
req
Expand All @@ -117,7 +117,7 @@ def test_send_request_should_complete_the_route
res = RestClient::Response
mock(RestClient::Request).new.with_any_args do |*args|
assert args.first[:url].include?(
"https://cdn.api.ooyala.com/v2/players/HbxJKM")
"https://cdn-api.ooyala.com/v2/players/HbxJKM")
req
end
mock(req).execute { res }
Expand Down
4 changes: 2 additions & 2 deletions ooyala_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ module Ooyala
class API
SUPPORTED_HTTP_METHODS = %w{GET POST PUT PATCH DELETE}
DEFAULT_BASE_URL = 'https://api.ooyala.com'
DEFAULT_CACHE_BASE_URL = 'https://cdn.api.ooyala.com'
DEFAULT_CACHE_BASE_URL = 'https://cdn-api.ooyala.com'
DEFAULT_EXPIRATION_WINDOW = 15
ROUND_UP_TIME = 300

# Sets the String base URL (default: "https://api.ooyala.com").
attr_writer :base_url

# Sets the String cache base URL (default: "https://cdn.api.ooyala.com").
# Sets the String cache base URL (default: "https://cdn-api.ooyala.com").
attr_writer :cache_base_url

# Sets the Number with the expiration window. This is added to the current
Expand Down
6 changes: 3 additions & 3 deletions test/test_ooyala_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_generate_signature_with_payload

def test_build_url
url = @ooyala_api.build_url 'GET', '/v2/players/HbxJKM'
assert url.include?('https://cdn.api.ooyala.com/')
assert url.include?('https://cdn-api.ooyala.com/')
assert url.include?('/v2/players/HbxJKM')
url = @ooyala_api.build_url 'POST', '/v2/players/HbxJKM',
{:test => true, 'a' => 'b'}
Expand Down Expand Up @@ -100,7 +100,7 @@ def test_send_request_should_escape_query_parameters
res = RestClient::Response
mock(RestClient::Request).new.with_any_args do |*args|
assert args.first[:url].include?(
"https://cdn.api.ooyala.com/v2/players/HbxJKM")
"https://cdn-api.ooyala.com/v2/players/HbxJKM")
assert args.first[:url].include?("test=%27tr+ue%27")
assert args.first[:url].include?("other=1")
req
Expand All @@ -116,7 +116,7 @@ def test_send_request_should_complete_the_route
res = RestClient::Response
mock(RestClient::Request).new.with_any_args do |*args|
assert args.first[:url].include?(
"https://cdn.api.ooyala.com/v2/players/HbxJKM")
"https://cdn-api.ooyala.com/v2/players/HbxJKM")
req
end
mock(req).execute { res }
Expand Down

0 comments on commit c7036dd

Please sign in to comment.