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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4297f9bda01f5ba16148980f7a5e70b0918521f6
4
- data.tar.gz: db4a13c392ca6276bdf49c3c3dac0bb8fc3e8dfa
3
+ metadata.gz: 3025fad3bbbada894a2398cf004a184c5181faa8
4
+ data.tar.gz: c358d7f2ce46b156b7e39b18a97f279c634994b8
5
5
  SHA512:
6
- metadata.gz: 35474ad186833e37f679299170eb2a804d2983dc60ef4d914ee946c42f5a2a087e44c7e64f816a1e187cff7b76e83e70c4a4a1679139dd54f48866fed9d2991c
7
- data.tar.gz: 024c041c4a6a9ba807df8d503d831c3e16ab308724b025650a9c891aefd5e83056ea2413c26ae5b57919721ea98ba64d35ed8648a5cfdaf0883d82a4abd20a6e
6
+ metadata.gz: aab9cf9e456fa00244539cdcccd550bab0fb557096ded066e43428ed0f0a3f2b865aef62ea9b9f7705379decd7655762a48e20f4c307d44354f6e169937d520e
7
+ data.tar.gz: d072bee20078a497e5cfa877ec9544e0d3744fe7fbc825833b70a6346deb793629ea15aab0a9edc71babc593885d4486c3ebe04a65129c9ba6cb78039b4ff8d3
data/.travis.yml CHANGED
@@ -8,10 +8,10 @@ rvm:
8
8
  - 2.1.3
9
9
  - 2.1.4
10
10
  - 2.1.5
11
+ - 2.2.0
11
12
  before_install: "gem install bundler -v 1.6"
12
13
  script:
13
- - bundle exec rake
14
- - bundle exec rubocop
14
+ - bundle exec rake ci
15
15
  sudo: false
16
16
  cache: bundler
17
17
 
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 rspecs.
62
+ Run `rake spec` to run all of the tests.
63
63
 
64
64
  ## Code Style
65
65
 
66
- Run `rubocop` and try to keep the cops happy.
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
@@ -1,7 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require "rubocop/rake_task"
3
4
 
4
5
  RSpec::Core::RakeTask.new(:spec)
6
+ RuboCop::RakeTask.new(:style)
5
7
 
6
- task default: :spec
8
+ task ci: [:spec, :style]
9
+ task default: :ci
7
10
 
@@ -1,4 +1,4 @@
1
1
  class FilmSnob
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
4
4
 
@@ -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
- attr_reader :url
7
+ extend Deprecated, Forwardable
8
+
9
+ VIDEO_METHODS = [:site, :id, :clean_url, :title, :html]
8
10
 
9
- extend Deprecated
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.1
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-01-04 00:00:00.000000000 Z
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.5
192
+ rubygems_version: 2.4.8
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: Fetch embed codes for videos