film_snob 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/README.md +6 -2
- data/Rakefile +4 -1
- data/lib/film_snob/version.rb +1 -1
- data/lib/film_snob/video_sites/instagram.rb +1 -17
- data/lib/film_snob.rb +8 -16
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3025fad3bbbada894a2398cf004a184c5181faa8
|
4
|
+
data.tar.gz: c358d7f2ce46b156b7e39b18a97f279c634994b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aab9cf9e456fa00244539cdcccd550bab0fb557096ded066e43428ed0f0a3f2b865aef62ea9b9f7705379decd7655762a48e20f4c307d44354f6e169937d520e
|
7
|
+
data.tar.gz: d072bee20078a497e5cfa877ec9544e0d3744fe7fbc825833b70a6346deb793629ea15aab0a9edc71babc593885d4486c3ebe04a65129c9ba6cb78039b4ff8d3
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -59,11 +59,15 @@ The same methods work with all of these providers.
|
|
59
59
|
|
60
60
|
## Testing
|
61
61
|
|
62
|
-
Run `rake` to run all of the
|
62
|
+
Run `rake spec` to run all of the tests.
|
63
63
|
|
64
64
|
## Code Style
|
65
65
|
|
66
|
-
Run `
|
66
|
+
Run `rake style` to confirm the codebase is looking stylish.
|
67
|
+
|
68
|
+
## Continous Integration
|
69
|
+
|
70
|
+
Run `rake ci` to run both the tests and the style checks, which will be run on Travis; both should pass to have a green build.
|
67
71
|
|
68
72
|
## Questions?
|
69
73
|
|
data/Rakefile
CHANGED
data/lib/film_snob/version.rb
CHANGED
@@ -10,28 +10,12 @@ class FilmSnob
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.oembed_endpoint
|
13
|
-
"http://api.instagram.com/oembed"
|
13
|
+
"http://api.instagram.com/publicapi/oembed/"
|
14
14
|
end
|
15
15
|
|
16
16
|
def clean_url
|
17
17
|
@clean_url ||= "http://instagram.com/p/#{id}"
|
18
18
|
end
|
19
|
-
|
20
|
-
def html
|
21
|
-
# instagram's oembed response does not include html,
|
22
|
-
# so we need to construct it
|
23
|
-
# but first we need to ensure that the response was good
|
24
|
-
# which we do by checking for the presence of the title,
|
25
|
-
# which will raise an exception if it"s not present
|
26
|
-
title && constructed_html
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def constructed_html
|
32
|
-
"<iframe src='//instagram.com/p/#{id}/embed/' width='612' height='710' " \
|
33
|
-
"frameborder='0' scrolling='no' allowtransparency='true'></iframe>"
|
34
|
-
end
|
35
19
|
end
|
36
20
|
end
|
37
21
|
|
data/lib/film_snob.rb
CHANGED
@@ -4,9 +4,15 @@ require "film_snob/exceptions"
|
|
4
4
|
require "film_snob/deprecated"
|
5
5
|
|
6
6
|
class FilmSnob
|
7
|
-
|
7
|
+
extend Deprecated, Forwardable
|
8
|
+
|
9
|
+
VIDEO_METHODS = [:site, :id, :clean_url, :title, :html]
|
8
10
|
|
9
|
-
|
11
|
+
def_delegators :video, *VIDEO_METHODS
|
12
|
+
|
13
|
+
deprecated_alias :watchable?, :embeddable?, removed_in: "v1.0.0"
|
14
|
+
|
15
|
+
attr_reader :url
|
10
16
|
|
11
17
|
def initialize(url, options = {})
|
12
18
|
@url = url
|
@@ -17,16 +23,6 @@ class FilmSnob
|
|
17
23
|
!@video.nil?
|
18
24
|
end
|
19
25
|
|
20
|
-
deprecated_alias :watchable?, :embeddable?, removed_in: "v1.0.0"
|
21
|
-
|
22
|
-
def method_missing(message)
|
23
|
-
if delegated_video_methods.include?(message)
|
24
|
-
video.send(message)
|
25
|
-
else
|
26
|
-
super
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
26
|
private
|
31
27
|
|
32
28
|
def video
|
@@ -36,9 +32,5 @@ class FilmSnob
|
|
36
32
|
raise NotSupportedURLError, "#{url} is not a supported URL"
|
37
33
|
end
|
38
34
|
end
|
39
|
-
|
40
|
-
def delegated_video_methods
|
41
|
-
[:site, :id, :clean_url, :title, :html]
|
42
|
-
end
|
43
35
|
end
|
44
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: film_snob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Jacobson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.4.
|
192
|
+
rubygems_version: 2.4.8
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: Fetch embed codes for videos
|