embedly 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +7 -0
- data/VERSION +1 -1
- data/bin/embedly_objectify +1 -1
- data/bin/embedly_oembed +1 -1
- data/bin/embedly_preview +1 -1
- data/features/objectify.feature +11 -0
- data/features/steps/api_steps.rb +4 -0
- data/lib/embedly/api.rb +3 -2
- metadata +4 -2
data/ChangeLog
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/bin/embedly_objectify
CHANGED
data/bin/embedly_oembed
CHANGED
data/bin/embedly_preview
CHANGED
data/features/objectify.feature
CHANGED
@@ -8,6 +8,17 @@ Feature: Objectify
|
|
8
8
|
Given an embedly endpoint
|
9
9
|
When objectify is called with the <url> URL
|
10
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
|
+
|
17
|
+
Scenario Outline: Get the meta description with pro
|
18
|
+
Given an embedly endpoint with key
|
19
|
+
When objectify is called with the <url> URL
|
20
|
+
Then the meta.description should start with <metadesc>
|
21
|
+
And objectify api_version is 2
|
11
22
|
|
12
23
|
Examples:
|
13
24
|
| url | metadesc |
|
data/features/steps/api_steps.rb
CHANGED
@@ -38,6 +38,10 @@ Then /an? (\w+) error should get thrown/ do |error|
|
|
38
38
|
@error.class.to_s.should == error
|
39
39
|
end
|
40
40
|
|
41
|
+
Then /objectify api_version is (\d+)$/ do |version|
|
42
|
+
@api.api_version[:objectify].should == version
|
43
|
+
end
|
44
|
+
|
41
45
|
Then /([^\s]+) should be (.+)$/ do |key, value|
|
42
46
|
raise @error if @error
|
43
47
|
logger = Embedly.logger('api_steps')
|
data/lib/embedly/api.rb
CHANGED
@@ -30,7 +30,7 @@ include ::Embedly
|
|
30
30
|
# api_version hash. Here is an example.
|
31
31
|
#
|
32
32
|
# api = Embedly::API.new
|
33
|
-
# api.api_version[
|
33
|
+
# api.api_version[:new_method] = 3
|
34
34
|
# api.new_method :arg1 => '1', :arg2 => '2'
|
35
35
|
#
|
36
36
|
class Embedly::API
|
@@ -43,13 +43,14 @@ class Embedly::API
|
|
43
43
|
# [:+user_agent+] Your User-Agent header. Defaults to Mozilla/5.0 (compatible; embedly-ruby/VERSION;)
|
44
44
|
def initialize opts={}
|
45
45
|
@key = opts[:key]
|
46
|
+
@api_version = Hash.new('1')
|
46
47
|
if @key
|
47
48
|
logger.debug('using pro')
|
48
49
|
@endpoint = opts[:endpoint] || 'pro.embed.ly'
|
50
|
+
@api_version.merge!({:objectify => '2'})
|
49
51
|
else
|
50
52
|
@endpoint = opts[:endpoint] || 'api.embed.ly'
|
51
53
|
end
|
52
|
-
@api_version = Hash.new('1').merge!({'objectify' => '2'})
|
53
54
|
@user_agent = opts[:user_agent] || "Mozilla/5.0 (compatible; embedly-ruby/#{Embedly::VERSION};)"
|
54
55
|
end
|
55
56
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Bob Corsaro
|
@@ -65,9 +65,11 @@ executables:
|
|
65
65
|
extensions: []
|
66
66
|
|
67
67
|
extra_rdoc_files:
|
68
|
+
- ChangeLog
|
68
69
|
- README.rdoc
|
69
70
|
files:
|
70
71
|
- .rvmrc
|
72
|
+
- ChangeLog
|
71
73
|
- MIT-LICENSE
|
72
74
|
- README.rdoc
|
73
75
|
- Rakefile
|