open_graphy 1.0.0 → 1.0.1

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: 37f58ad61b985b57779656bf55788c7225cf4888
4
- data.tar.gz: 600252251fcbdfe00fbec7b5749cda00b9f8aed2
3
+ metadata.gz: fb96a766afc24c92ea612a84627ac817b3d8f91e
4
+ data.tar.gz: 68d2f7cd34b1d3b65f02c46202e54400be016aac
5
5
  SHA512:
6
- metadata.gz: 2de2b2042538b30620c834bfd5aea773de8d0bd0fd9d783ee5f6fc1d045dc64453b00722a7ba571a938f18f1797ef1e653848398272ae6cc91ca0711e7295b48
7
- data.tar.gz: d752d82c76f92915b90221345c138fbb6404ad48ec28bca32789de863a3a68dbb69bb99c0ba91901c7c467a088534495e235177238d01c983e574e8b8f150c91
6
+ metadata.gz: debb02504ecc8df2458800d72087aa2bdf8d41f8ff3697e1b047d99f7ef4b1c1a7bbb6e4298abf6b5d5782021d8f1b771d328d45e02a23c3954de1d7cc3cdd2d
7
+ data.tar.gz: 14f3a84476359456f5cdc954bc3d5587b15279763aa3952d7666ad74dfd621b1822bdc5a5ca084f724be3bf01e968600c6ea1f11d2ab8d9bfc9fa68cb73f56f4
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # OpenGraphy [![Build Status](https://travis-ci.org/onthebeach/open_graphy.svg)](https://travis-ci.org/onthebeach/open_graphy) [![Gem Version](https://badge.fury.io/rb/open_graphy.svg)](http://badge.fury.io/rb/open_graphy)
1
+ # OpenGraphy [![Build Status](https://travis-ci.org/onthebeach/open_graphy.svg)](https://travis-ci.org/onthebeach/open_graphy) [![Gem Version](https://badge.fury.io/rb/open_graphy.svg)](http://badge.fury.io/rb/open_graphy) [![Code Climate](https://codeclimate.com/github/onthebeach/open_graphy/badges/gpa.svg)](https://codeclimate.com/github/onthebeach/open_graphy)
2
2
 
3
3
  This ruby gem allow you to fetch data that follows the opengraph protocol, and lets you fetch data from custom metatags also.
4
4
 
@@ -28,7 +28,7 @@ module OpenGraphy
28
28
  end
29
29
 
30
30
  def check_redirect_limit
31
- raise Uri::RedirectLoopError, 'too many HTTP redirects' if @limit == 0
31
+ raise Uri::RedirectLoopError, 'too many HTTP redirects' if @limit == 0
32
32
  end
33
33
 
34
34
  def uri
@@ -9,8 +9,6 @@ module OpenGraphy
9
9
  fetch(uri_str).body
10
10
  end
11
11
 
12
- private
13
-
14
12
  def self.fetch(uri)
15
13
  Fetcher.new(uri).fetch
16
14
  end
@@ -22,7 +22,7 @@ module OpenGraphy
22
22
  private
23
23
 
24
24
  def valid_meta_tags
25
- valid_meta_tags ||= meta_tags.select(&:valid?)
25
+ @valid_meta_tags ||= meta_tags.select(&:valid?)
26
26
  end
27
27
 
28
28
  def meta_tags
@@ -1,3 +1,3 @@
1
1
  module OpenGraphy
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -17,10 +17,11 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
+ spec.add_dependency "nokogiri", "~> 1.6"
21
+
20
22
  spec.add_development_dependency "bundler", "~> 1.7"
21
- spec.add_development_dependency "rake", "~> 10.0"
22
- spec.add_development_dependency "nokogiri", "~> 1.6"
23
+ spec.add_development_dependency "rake", "~> 11.0"
23
24
  spec.add_development_dependency "rspec", "~> 3.1"
24
- spec.add_development_dependency "vcr", '~> 2.9'
25
- spec.add_development_dependency "webmock", "~> 1.20"
25
+ spec.add_development_dependency "vcr", '~> 3.0'
26
+ spec.add_development_dependency "webmock", "~> 2.1"
26
27
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe OpenGraphy do
4
- subject {
3
+ RSpec.describe OpenGraphy do
4
+ subject(:open_graphy) {
5
5
  VCR.use_cassette('imdb/tt2084970') do
6
6
  OpenGraphy.fetch(url)
7
7
  end
@@ -12,6 +12,10 @@ describe OpenGraphy do
12
12
  it 'should return an object with the opengraph data' do
13
13
  expect(subject).to be_kind_of(OpenGraphy::MetaTags)
14
14
  end
15
+
16
+ it { expect(open_graphy.url).to eql('http://www.imdb.com/title/tt2084970/') }
17
+ it { expect(open_graphy.site_name).to eql('IMDb') }
18
+ it { expect(open_graphy.image).to eql('http://ia.media-imdb.com/images/M/MV5BNDkwNTEyMzkzNl5BMl5BanBnXkFtZTgwNTAwNzk3MjE@._V1_.jpg') }
15
19
  end
16
20
 
17
21
  describe 'custom metatags' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_graphy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Bradley
@@ -9,50 +9,50 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-05 00:00:00.000000000 Z
12
+ date: 2016-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: bundler
15
+ name: nokogiri
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.7'
21
- type: :development
20
+ version: '1.6'
21
+ type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.7'
27
+ version: '1.6'
28
28
  - !ruby/object:Gem::Dependency
29
- name: rake
29
+ name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '10.0'
34
+ version: '1.7'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '10.0'
41
+ version: '1.7'
42
42
  - !ruby/object:Gem::Dependency
43
- name: nokogiri
43
+ name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '1.6'
48
+ version: '11.0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '1.6'
55
+ version: '11.0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rspec
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -73,28 +73,28 @@ dependencies:
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '2.9'
76
+ version: '3.0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '2.9'
83
+ version: '3.0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: webmock
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '1.20'
90
+ version: '2.1'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '1.20'
97
+ version: '2.1'
98
98
  description: A simple ruby wrapper for the open graph protocol
99
99
  email:
100
100
  - craig.bradley@onthebeach.co.uk