social-avatar-proxy 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -33,6 +33,8 @@ In your `config/routes.rb` file:
33
33
  mount SocialAvatarProxy::App, at: "/avatars"
34
34
  ```
35
35
 
36
+ ### COMING SOON
37
+
36
38
  In your views:
37
39
 
38
40
  ```ruby
@@ -41,8 +41,14 @@ module SocialAvatarProxy
41
41
 
42
42
  def perform_request
43
43
  http = Net::HTTP.new(uri.host, uri.port)
44
- http.use_ssl = uri.scheme == "https"
44
+ # enable SSL without verification if on HTTPS
45
+ if uri.scheme == "https"
46
+ http.use_ssl = true
47
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
48
+ end
49
+ # create the request
45
50
  request = Net::HTTP::Get.new(uri.request_uri)
51
+ # run the request
46
52
  http.request(request)
47
53
  end
48
54
  end
@@ -1,3 +1,3 @@
1
1
  module SocialAvatarProxy
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -10,8 +10,8 @@ describe SocialAvatarProxy::FacebookAvatar do
10
10
 
11
11
  describe "#remote_url" do
12
12
  it "should return a valid URL" do
13
- expected = "https://graph.facebook.com/#{id}/picture"
14
- expect(subject.remote_url).to eq(expected)
13
+ result = URI(subject.remote_url)
14
+ expect(result.host).to eq("graph.facebook.com")
15
15
  end
16
16
  end
17
17
  end
@@ -21,8 +21,8 @@ describe SocialAvatarProxy::FacebookAvatar do
21
21
 
22
22
  describe "#remote_url" do
23
23
  it "should return a valid URL" do
24
- expected = "https://graph.facebook.com/#{id}/picture"
25
- expect(subject.remote_url).to eq(expected)
24
+ result = URI(subject.remote_url)
25
+ expect(result.host).to eq("graph.facebook.com")
26
26
  end
27
27
  end
28
28
  end
@@ -10,8 +10,8 @@ describe SocialAvatarProxy::TwitterAvatar do
10
10
 
11
11
  describe "#remote_url" do
12
12
  it "should return a valid URL" do
13
- expected = "http://api.twitter.com/1/users/profile_image?user_id=#{id}&size=original"
14
- expect(subject.remote_url).to eq(expected)
13
+ result = URI(subject.remote_url)
14
+ expect(result.host).to eq("api.twitter.com")
15
15
  end
16
16
  end
17
17
  end
@@ -21,8 +21,8 @@ describe SocialAvatarProxy::TwitterAvatar do
21
21
 
22
22
  describe "#remote_url" do
23
23
  it "should return a valid URL" do
24
- expected = "http://api.twitter.com/1/users/profile_image?screen_name=#{id}&size=original"
25
- expect(subject.remote_url).to eq(expected)
24
+ result = URI(subject.remote_url)
25
+ expect(result.host).to eq("api.twitter.com")
26
26
  end
27
27
  end
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social-avatar-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -136,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  segments:
138
138
  - 0
139
- hash: 1494370510572488826
139
+ hash: 308556052636751640
140
140
  required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  none: false
142
142
  requirements:
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  segments:
147
147
  - 0
148
- hash: 1494370510572488826
148
+ hash: 308556052636751640
149
149
  requirements: []
150
150
  rubyforge_project:
151
151
  rubygems_version: 1.8.24