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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -50
  3. data/.travis.yml +2 -1
  4. data/Gemfile +0 -1
  5. data/Rakefile +2 -3
  6. data/film_snob.gemspec +0 -1
  7. data/lib/film_snob.rb +2 -3
  8. data/lib/film_snob/deprecated.rb +0 -1
  9. data/lib/film_snob/exceptions.rb +0 -1
  10. data/lib/film_snob/url_to_video.rb +0 -1
  11. data/lib/film_snob/version.rb +1 -2
  12. data/lib/film_snob/video_site.rb +2 -3
  13. data/lib/film_snob/video_sites/coub.rb +0 -1
  14. data/lib/film_snob/video_sites/dailymotion.rb +0 -1
  15. data/lib/film_snob/video_sites/funny_or_die.rb +0 -1
  16. data/lib/film_snob/video_sites/hulu.rb +0 -1
  17. data/lib/film_snob/video_sites/instagram.rb +1 -2
  18. data/lib/film_snob/video_sites/rutube.rb +1 -2
  19. data/lib/film_snob/video_sites/soundcloud.rb +1 -2
  20. data/lib/film_snob/video_sites/vimeo.rb +0 -1
  21. data/lib/film_snob/video_sites/vine.rb +0 -1
  22. data/lib/film_snob/video_sites/youtube.rb +0 -1
  23. data/spec/deprecated_spec.rb +1 -2
  24. data/spec/film_snob/video_sites/coub_spec.rb +0 -1
  25. data/spec/film_snob/video_sites/dailymotion_spec.rb +2 -3
  26. data/spec/film_snob/video_sites/funny_or_die_spec.rb +0 -1
  27. data/spec/film_snob/video_sites/hulu_spec.rb +0 -1
  28. data/spec/film_snob/video_sites/instagram_spec.rb +0 -1
  29. data/spec/film_snob/video_sites/rutube_spec.rb +0 -1
  30. data/spec/film_snob/video_sites/soundcloud_spec.rb +2 -3
  31. data/spec/film_snob/video_sites/vimeo_spec.rb +2 -3
  32. data/spec/film_snob/video_sites/vine_spec.rb +0 -1
  33. data/spec/film_snob/video_sites/youtube_spec.rb +0 -1
  34. data/spec/film_snob_spec.rb +0 -1
  35. data/spec/spec_helper.rb +0 -1
  36. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a601ca38e0d932d9f1a0cbda09684e20a8521698
4
- data.tar.gz: 04e76c9a32a8bc4b71fae81f0c3dade1a5cbbbdb
3
+ metadata.gz: 8cf290744ac7770ce7b8d8f0ebdde751b4428557
4
+ data.tar.gz: 0df2231616cbd058bea30b5480708f1c795e1d83
5
5
  SHA512:
6
- metadata.gz: 930341d43662884815073ed285f42221e54dc39cdda500554a0f45643e3e8546df173dae8aba8fc6e0ae70df91131869c1c19aba01121664597b478fe8b19da5
7
- data.tar.gz: 731d530bd8341888c122fa977acf1cf513eec8e775962abf8567d771849584a6d1993f85c916a288612e5588a8fb92fd832e2dd326b0cd82a0ba5aa4e29781b9
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 will use the %r syntax even if there's only one slash
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
- Description: "Checks for proper usage of fail and raise."
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
- # Expect a final blank line
49
- Style/TrailingBlankLines:
50
- Description: "Checks trailing blank lines and final newline."
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
@@ -9,9 +9,10 @@ rvm:
9
9
  - 2.1.4
10
10
  - 2.1.5
11
11
  - 2.2.0
12
+ - 2.2.1
13
+ - 2.2.2
12
14
  before_install: "gem install bundler -v 1.10"
13
15
  script:
14
16
  - bundle exec rake ci
15
17
  sudo: false
16
18
  cache: bundler
17
-
data/Gemfile CHANGED
@@ -2,4 +2,3 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in film_snob.gemspec
4
4
  gemspec
5
-
data/Rakefile CHANGED
@@ -13,6 +13,5 @@ task :todos do
13
13
  end
14
14
  end
15
15
 
16
- task ci: [:spec, :style, :todos]
17
- task default: :ci
18
-
16
+ task :ci => [:spec, :style, :todos]
17
+ task :default => :ci
data/film_snob.gemspec CHANGED
@@ -30,4 +30,3 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "codeclimate-test-reporter", "~> 0.4"
31
31
  spec.required_ruby_version = ">= 1.9.3"
32
32
  end
33
-
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-08-01): actually deprecate this method
15
- deprecated_alias :watchable?, :embeddable?, removed_in: "v1.0.0"
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
-
@@ -10,4 +10,3 @@ class FilmSnob
10
10
  end
11
11
  end
12
12
  end
13
-
@@ -2,4 +2,3 @@ class FilmSnob
2
2
  class NotSupportedURLError < StandardError; end
3
3
  class NotEmbeddableError < StandardError; end
4
4
  end
5
-
@@ -26,4 +26,3 @@ class FilmSnob
26
26
  end
27
27
  end
28
28
  end
29
-
@@ -1,4 +1,3 @@
1
1
  class FilmSnob
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
4
-
@@ -2,7 +2,7 @@ require "net/http"
2
2
  require "json"
3
3
 
4
4
  class FilmSnob
5
- # TODO(2015-08-01): rename to something more general
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: clean_url }.merge(options))
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
-
@@ -17,4 +17,3 @@ class FilmSnob
17
17
  end
18
18
  end
19
19
  end
20
-
@@ -18,4 +18,3 @@ class FilmSnob
18
18
  end
19
19
  end
20
20
  end
21
-
@@ -17,4 +17,3 @@ class FilmSnob
17
17
  end
18
18
  end
19
19
  end
20
-
@@ -17,4 +17,3 @@ class FilmSnob
17
17
  end
18
18
  end
19
19
  end
20
-
@@ -10,7 +10,7 @@ class FilmSnob
10
10
  end
11
11
 
12
12
  def self.oembed_endpoint
13
- "http://api.instagram.com/publicapi/oembed/"
13
+ "http://instagram.com/publicapi/oembed/"
14
14
  end
15
15
 
16
16
  def clean_url
@@ -18,4 +18,3 @@ class FilmSnob
18
18
  end
19
19
  end
20
20
  end
21
-
@@ -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: :json))
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: :json))
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
-
@@ -20,4 +20,3 @@ class FilmSnob
20
20
  end
21
21
  end
22
22
  end
23
-
@@ -17,4 +17,3 @@ class FilmSnob
17
17
  end
18
18
  end
19
19
  end
20
-
@@ -22,4 +22,3 @@ class FilmSnob
22
22
  end
23
23
  end
24
24
  end
25
-
@@ -3,7 +3,7 @@ class FilmSnob
3
3
  class Dog
4
4
  extend Deprecated
5
5
 
6
- deprecated_alias :woof, :bark, removed_in: "v4.0.0"
6
+ deprecated_alias :woof, :bark, :removed_in => "v4.0.0"
7
7
 
8
8
  def bark
9
9
  "bark"
@@ -26,4 +26,3 @@ class FilmSnob
26
26
  end
27
27
  end
28
28
  end
29
-
@@ -9,4 +9,3 @@ describe FilmSnob::Coub do
9
9
  end
10
10
  end
11
11
  end
12
-
@@ -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: 400
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: 500
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
-
@@ -10,4 +10,3 @@ describe FilmSnob::FunnyOrDie do
10
10
  end
11
11
  end
12
12
  end
13
-
@@ -9,4 +9,3 @@ describe FilmSnob::Hulu do
9
9
  end
10
10
  end
11
11
  end
12
-
@@ -34,4 +34,3 @@ describe FilmSnob::Instagram do
34
34
  end
35
35
  end
36
36
  end
37
-
@@ -12,4 +12,3 @@ describe FilmSnob::Rutube do
12
12
  end
13
13
  end
14
14
  end
15
-
@@ -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: 500
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: true
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: 400)
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: 500)
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
-
@@ -9,4 +9,3 @@ describe FilmSnob::Vine do
9
9
  end
10
10
  end
11
11
  end
12
-
@@ -86,4 +86,3 @@ describe FilmSnob::YouTube do
86
86
  expect(snob.clean_url).to eq "https://www.youtube.com/watch?v=sLSFOCyNC8Q"
87
87
  end
88
88
  end
89
-
@@ -12,4 +12,3 @@ describe FilmSnob do
12
12
  end
13
13
  end
14
14
  end
15
-
data/spec/spec_helper.rb CHANGED
@@ -27,4 +27,3 @@ RSpec.configure do |config|
27
27
  mocks.verify_partial_doubles = true
28
28
  end
29
29
  end
30
-
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
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-07-11 00:00:00.000000000 Z
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