film_snob 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -50
- data/.travis.yml +2 -1
- data/Gemfile +0 -1
- data/Rakefile +2 -3
- data/film_snob.gemspec +0 -1
- data/lib/film_snob.rb +2 -3
- data/lib/film_snob/deprecated.rb +0 -1
- data/lib/film_snob/exceptions.rb +0 -1
- data/lib/film_snob/url_to_video.rb +0 -1
- data/lib/film_snob/version.rb +1 -2
- data/lib/film_snob/video_site.rb +2 -3
- data/lib/film_snob/video_sites/coub.rb +0 -1
- data/lib/film_snob/video_sites/dailymotion.rb +0 -1
- data/lib/film_snob/video_sites/funny_or_die.rb +0 -1
- data/lib/film_snob/video_sites/hulu.rb +0 -1
- data/lib/film_snob/video_sites/instagram.rb +1 -2
- data/lib/film_snob/video_sites/rutube.rb +1 -2
- data/lib/film_snob/video_sites/soundcloud.rb +1 -2
- data/lib/film_snob/video_sites/vimeo.rb +0 -1
- data/lib/film_snob/video_sites/vine.rb +0 -1
- data/lib/film_snob/video_sites/youtube.rb +0 -1
- data/spec/deprecated_spec.rb +1 -2
- data/spec/film_snob/video_sites/coub_spec.rb +0 -1
- data/spec/film_snob/video_sites/dailymotion_spec.rb +2 -3
- data/spec/film_snob/video_sites/funny_or_die_spec.rb +0 -1
- data/spec/film_snob/video_sites/hulu_spec.rb +0 -1
- data/spec/film_snob/video_sites/instagram_spec.rb +0 -1
- data/spec/film_snob/video_sites/rutube_spec.rb +0 -1
- data/spec/film_snob/video_sites/soundcloud_spec.rb +2 -3
- data/spec/film_snob/video_sites/vimeo_spec.rb +2 -3
- data/spec/film_snob/video_sites/vine_spec.rb +0 -1
- data/spec/film_snob/video_sites/youtube_spec.rb +0 -1
- data/spec/film_snob_spec.rb +0 -1
- data/spec/spec_helper.rb +0 -1
- 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: 8cf290744ac7770ce7b8d8f0ebdde751b4428557
|
4
|
+
data.tar.gz: 0df2231616cbd058bea30b5480708f1c795e1d83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56540292bb66647af0749970dd8a9e28b6a09de560e3b1f7d8365f68c3ae613e48aa95d8fcf6b0bda984a5c0de7c7464ae7aa2faec3451e81a155324480498fe
|
7
|
+
data.tar.gz: 5d132d9626ea0fe6852938748ba813539fdbd5626e5513f13d24d0e2a7dac1d4cc7b6b30868d75be63da772468a180bc1eed76ba6b8b3770a7efe14fbfbf0ad8
|
data/.rubocop.yml
CHANGED
@@ -1,60 +1,15 @@
|
|
1
|
-
Style/CollectionMethods:
|
2
|
-
# Mapping from undesired method to desired_method
|
3
|
-
# e.g. to use `detect` over `find`:
|
4
|
-
#
|
5
|
-
# CollectionMethods:
|
6
|
-
# PreferredMethods:
|
7
|
-
# find: detect
|
8
|
-
PreferredMethods:
|
9
|
-
collect: 'map'
|
10
|
-
collect!: 'map!'
|
11
|
-
reduce: 'inject'
|
12
|
-
detect: 'find'
|
13
|
-
select: 'find_all'
|
14
|
-
|
15
|
-
# Disabling this because I don't love using the return keyword
|
16
|
-
# and sometimes lines get long and difficult to read that way
|
17
|
-
Style/GuardClause:
|
18
|
-
Description: "Check for conditionals that can be replaced with guard clauses"
|
19
|
-
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals"
|
20
|
-
Enabled: false
|
21
|
-
|
22
1
|
# I don't want to write documentation for every class
|
23
2
|
Style/Documentation:
|
24
|
-
Description: "Document classes and non-namespace modules."
|
25
3
|
Enabled: false
|
26
4
|
|
27
|
-
# I
|
28
|
-
Style/RegexpLiteral:
|
29
|
-
Description: >-
|
30
|
-
Use %r for regular expressions matching more than
|
31
|
-
`MaxSlashes` "/" characters.
|
32
|
-
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#percent-r"
|
33
|
-
Enabled: true
|
34
|
-
|
35
|
-
# I prefer raise to fail, so I'm disabling this one
|
5
|
+
# I prefer raise to fail
|
36
6
|
Style/SignalException:
|
37
|
-
|
38
|
-
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#fail-method"
|
39
|
-
Enabled: false
|
7
|
+
EnforcedStyle: only_raise
|
40
8
|
|
41
9
|
# I prefer double quotes
|
42
10
|
Style/StringLiterals:
|
43
|
-
Description: "Checks if uses of quotes match the configured preference."
|
44
|
-
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#consistent-string-literals"
|
45
|
-
Enabled: true
|
46
11
|
EnforcedStyle: double_quotes
|
47
12
|
|
48
|
-
#
|
49
|
-
Style/
|
50
|
-
|
51
|
-
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#newline-eof"
|
52
|
-
Enabled: true
|
53
|
-
EnforcedStyle: final_blank_line
|
54
|
-
|
55
|
-
# I like to use assignment in conditions
|
56
|
-
Lint/AssignmentInCondition:
|
57
|
-
Description: "Don't use assignment in conditions."
|
58
|
-
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition"
|
59
|
-
Enabled: false
|
60
|
-
|
13
|
+
# I prefer hash rockets
|
14
|
+
Style/HashSyntax:
|
15
|
+
EnforcedStyle: hash_rockets
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/film_snob.gemspec
CHANGED
data/lib/film_snob.rb
CHANGED
@@ -11,8 +11,8 @@ class FilmSnob
|
|
11
11
|
|
12
12
|
def_delegators :video, *VIDEO_METHODS
|
13
13
|
|
14
|
-
# TODO(2015-
|
15
|
-
deprecated_alias :watchable?, :embeddable?, removed_in
|
14
|
+
# TODO(2015-11-15): actually remove this method
|
15
|
+
deprecated_alias :watchable?, :embeddable?, :removed_in => "v1.0.0"
|
16
16
|
|
17
17
|
attr_reader :url
|
18
18
|
|
@@ -35,4 +35,3 @@ class FilmSnob
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
data/lib/film_snob/deprecated.rb
CHANGED
data/lib/film_snob/exceptions.rb
CHANGED
data/lib/film_snob/version.rb
CHANGED
data/lib/film_snob/video_site.rb
CHANGED
@@ -2,7 +2,7 @@ require "net/http"
|
|
2
2
|
require "json"
|
3
3
|
|
4
4
|
class FilmSnob
|
5
|
-
# TODO(2015-
|
5
|
+
# TODO(2015-11-15): rename to something more general
|
6
6
|
# we're using this for things like Instagram
|
7
7
|
class VideoSite
|
8
8
|
attr_reader :url, :options
|
@@ -90,9 +90,8 @@ class FilmSnob
|
|
90
90
|
|
91
91
|
def uri
|
92
92
|
URI(self.class.oembed_endpoint).tap do |uri|
|
93
|
-
uri.query = URI.encode_www_form({ url
|
93
|
+
uri.query = URI.encode_www_form({ :url => clean_url }.merge(options))
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
98
|
-
|
@@ -3,7 +3,7 @@ require "film_snob/video_site"
|
|
3
3
|
class FilmSnob
|
4
4
|
class Rutube < VideoSite
|
5
5
|
def initialize(url, options = {})
|
6
|
-
super(url, options.merge(format
|
6
|
+
super(url, options.merge(:format => :json))
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.valid_url_patterns
|
@@ -21,4 +21,3 @@ class FilmSnob
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
@@ -3,7 +3,7 @@ require "film_snob/video_site"
|
|
3
3
|
class FilmSnob
|
4
4
|
class Soundcloud < VideoSite
|
5
5
|
def initialize(url, options = {})
|
6
|
-
super(url, options.merge(format
|
6
|
+
super(url, options.merge(:format => :json))
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.valid_url_patterns
|
@@ -22,4 +22,3 @@ class FilmSnob
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
25
|
-
|
data/spec/deprecated_spec.rb
CHANGED
@@ -28,7 +28,7 @@ describe FilmSnob::Dailymotion do
|
|
28
28
|
it "should allow oembed configuration" do
|
29
29
|
snob = FilmSnob.new(
|
30
30
|
"http://www.dailymotion.com/video/xf02xp_uffie-difficult_music",
|
31
|
-
maxwidth
|
31
|
+
:maxwidth => 400
|
32
32
|
)
|
33
33
|
VCR.use_cassette("dailymotion/music1") do
|
34
34
|
expect(snob.html).to match(/width="400"/)
|
@@ -36,11 +36,10 @@ describe FilmSnob::Dailymotion do
|
|
36
36
|
|
37
37
|
snob2 = FilmSnob.new(
|
38
38
|
"http://www.dailymotion.com/video/xf02xp_uffie-difficult_music",
|
39
|
-
maxwidth
|
39
|
+
:maxwidth => 500
|
40
40
|
)
|
41
41
|
VCR.use_cassette("dailymotion/music500") do
|
42
42
|
expect(snob2.html).to match(/width="500"/)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
46
|
-
|
@@ -52,7 +52,7 @@ describe FilmSnob::Soundcloud do
|
|
52
52
|
it "should allow user to set the iframe width" do
|
53
53
|
snob = FilmSnob.new(
|
54
54
|
"https://soundcloud.com/theweeknd/the-weeknd-king-of-the-fall",
|
55
|
-
maxwidth
|
55
|
+
:maxwidth => 500
|
56
56
|
)
|
57
57
|
VCR.use_cassette("soundcloud/maxwidth") do
|
58
58
|
expect(snob.html).to match(/width="500"/)
|
@@ -62,7 +62,7 @@ describe FilmSnob::Soundcloud do
|
|
62
62
|
it "should allow user to set autoplay" do
|
63
63
|
snob = FilmSnob.new(
|
64
64
|
"https://soundcloud.com/theweeknd/the-weeknd-king-of-the-fall",
|
65
|
-
auto_play
|
65
|
+
:auto_play => true
|
66
66
|
)
|
67
67
|
VCR.use_cassette("soundcloud/autoplay") do
|
68
68
|
expect(snob.html).to match(/auto_play=true/)
|
@@ -70,4 +70,3 @@ describe FilmSnob::Soundcloud do
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
73
|
-
|
@@ -46,15 +46,14 @@ describe FilmSnob::Vimeo do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it "should allow oembed configuration" do
|
49
|
-
snob = FilmSnob.new("http://vimeo.com/31158841", width
|
49
|
+
snob = FilmSnob.new("http://vimeo.com/31158841", :width => 400)
|
50
50
|
VCR.use_cassette("vimeo/murmuration") do
|
51
51
|
expect(snob.html).to match(/width="400"/)
|
52
52
|
end
|
53
53
|
|
54
|
-
snob2 = FilmSnob.new("http://vimeo.com/31158841", width
|
54
|
+
snob2 = FilmSnob.new("http://vimeo.com/31158841", :width => 500)
|
55
55
|
VCR.use_cassette("vimeo/murmuration2") do
|
56
56
|
expect(snob2.html).to match(/width="500"/)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
60
|
-
|
data/spec/film_snob_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
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.5
|
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-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
204
|
version: '0'
|
205
205
|
requirements: []
|
206
206
|
rubyforge_project:
|
207
|
-
rubygems_version: 2.4.5
|
207
|
+
rubygems_version: 2.4.5.1
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: Fetch embed codes for videos
|