Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Commit 852072e

Browse files
author
Bob Corsaro
committed
Merge branch 'master' of github.com:embedly/embedly-ruby
2 parents 29ad907 + adbde73 commit 852072e

File tree

7 files changed

+17
-18
lines changed

7 files changed

+17
-18
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
*embedly-0.3.3 (20 Feb 2011)
2+
20 Feb 2011: Bob Corsaro <[email protected]>
3+
Fixes namespace issue
4+
15
*embedly-0.3.0 (04 Feb 2011)
26

37
04 Feb 2011: Bob Corsaro <[email protected]>

README.rdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To install the official latest stable version, please use rubygems.
1212

1313
If you would like cutting edge, then you can clone and install HEAD.
1414

15-
git clone git@github.com:embedly/embedly-ruby.git
15+
git clone git://github.com/embedly/embedly-ruby.git
1616
cd embedly-ruby
1717
rake install
1818

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.0
1+
0.3.3

features/objectify.feature

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ Feature: Objectify
44
I want to call the the embedly api
55
Because I want to objectify a url
66

7-
Scenario Outline: Get the meta description
8-
Given an embedly endpoint
9-
When objectify is called with the <url> URL
10-
Then the meta.description should start with <metadesc>
11-
And objectify api_version is 1
12-
13-
Examples:
14-
| url | metadesc |
15-
| http://tweetphoto.com/14784358 | Plixi allows user to ins |
16-
177
Scenario Outline: Get the meta description with pro
188
Given an embedly endpoint with key
199
When objectify is called with the <url> URL

features/oembed.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Feature: OEmbed
7474
| url |
7575
| http://www.youtube.com/watch/is/a/bad/url |
7676
| http://www.scribd.com/doc/zfldsf/asdfkljlas/klajsdlfkasdf |
77-
| http://tweetphoto.com/alsdfldsf/asdfkljlas/klajsdlfkasdf |
77+
| http://fav.me/alsfsdf |
7878

7979

8080
Scenario Outline: Attempt multi get 404 URLs

lib/embedly/api.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
require 'embedly/model'
55
require 'querystring'
66

7-
include ::Embedly
87

98
# Performs api calls to embedly.
109
#
@@ -37,6 +36,10 @@
3736
class Embedly::API
3837
attr_reader :key, :endpoint, :api_version, :user_agent
3938

39+
def logger *args
40+
Embedly.logger *args
41+
end
42+
4043
# === Options
4144
#
4245
# [:+endpoint+] Hostname of embedly server. Defaults to api.embed.ly if no key is provided, pro.embed.ly if key is provided.
@@ -45,10 +48,10 @@ class Embedly::API
4548
def initialize opts={}
4649
@key = opts[:key]
4750
@api_version = Hash.new('1')
51+
@api_version.merge!({:objectify => '2'})
4852
if @key
4953
logger.debug('using pro')
5054
@endpoint = opts[:endpoint] || 'pro.embed.ly'
51-
@api_version.merge!({:objectify => '2'})
5255
else
5356
@endpoint = opts[:endpoint] || 'api.embed.ly'
5457
end
@@ -81,7 +84,7 @@ def apicall opts
8184
params[:urls].reject!.with_index do |url, i|
8285
if url !~ services_regex
8386
rejects << [i,
84-
EmbedlyObject.new(
87+
Embedly::EmbedlyObject.new(
8588
:type => 'error',
8689
:error_code => 401,
8790
:error_message => 'This service requires an Embedly Pro account'
@@ -109,7 +112,9 @@ def apicall opts
109112
if response.code.to_i == 200
110113
logger.debug { response.body }
111114
# [].flatten is to be sure we have an array
112-
objs = [JSON.parse(response.body)].flatten.collect {|o| EmbedlyObject.new(o)}
115+
objs = [JSON.parse(response.body)].flatten.collect do |o|
116+
Embedly::EmbedlyObject.new(o)
117+
end
113118
else
114119
logger.error { response.inspect }
115120
raise 'An unexpected error occurred'

lib/embedly/model.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def type
2222
def marshal_dump
2323
o = @table.clone
2424
o.each do |k,v|
25-
if v.is_a?EmbedlyObject
25+
if v.is_a?Embedly::EmbedlyObject
2626
o[k] = v.marshal_dump
2727
end
2828
end

0 commit comments

Comments
 (0)