Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing some typos

  • Loading branch information...
commit 2ad0ee0ac21fdfcd6345dbce5e5fb93613ad1d94 1 parent e3ee8a4
@judofyr judofyr authored
Showing with 7 additions and 7 deletions.
  1. +2 −2 lib/oembed/errors.rb
  2. +5 −5 lib/oembed/provider.rb
View
4 lib/oembed/errors.rb
@@ -1,5 +1,5 @@
module OEmbed
NotFound = Class.new(StandardError)
- UnkownFormat = Class.new(StandardError)
- UnkownResponse = Class.new(StandardError)
+ UnknownFormat = Class.new(StandardError)
+ UnknownResponse = Class.new(StandardError)
end
View
10 lib/oembed/provider.rb
@@ -5,7 +5,7 @@ class Provider
def initialize(endpoint, format = :json)
@endpoint = endpoint
@urls = []
- @format = :json
+ @format = format
end
def <<(url)
@@ -16,7 +16,7 @@ def <<(url)
end
def build(url, options = {})
- raise NotFound, "No embeddable content at '#{url}'" unless include?(url)
+ raise OEmbed::NotFound, "No embeddable content at '#{url}'" unless include?(url)
query = options.merge({:url => url})
endpoint = @endpoint.clone
@@ -43,13 +43,13 @@ def raw(url, options = {})
case res
when Net::HTTPNotImplemented
- raise UnknownFormat, "The provider doesn't support the '#{format}' format"
+ raise OEmbed::UnknownFormat, "The provider doesn't support the '#{format}' format"
when Net::HTTPNotFound
- raise NotFound, "No embeddable content at '#{url}'"
+ raise OEmbed::NotFound, "No embeddable content at '#{url}'"
when Net::HTTPOK
res.body
else
- raise UnkownResponse, "Got unkown response (#{res.code}) from server"
+ raise OEmbed::UnknownResponse, "Got unkown response (#{res.code}) from server"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.