fb_rails 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,6 @@
1
1
  module FbRails
2
2
  class Config
3
3
  class_attribute :app_id, :secret, :user_class_name, :timeout
4
- self.timeout = 60
5
4
 
6
5
  class << self
7
6
  def user_class
@@ -44,7 +44,7 @@ module FbRails
44
44
  def http
45
45
  result = Net::HTTP.new(facebook_uri.host, facebook_uri.port)
46
46
  configure_https(result)
47
- result.timeout = FbRails::Config.timeout
47
+ configure_timeout(result)
48
48
  result
49
49
  end
50
50
 
@@ -52,6 +52,13 @@ module FbRails
52
52
  http.use_ssl = true
53
53
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
54
54
  end
55
+
56
+ def configure_timeout(http)
57
+ if FbRails::Config.timeout
58
+ http.open_timeout = FbRails::Config.timeout
59
+ http.read_timeout = FbRails::Config.timeout
60
+ end
61
+ end
55
62
  end
56
63
 
57
64
  attr_reader :access_token
@@ -5,8 +5,4 @@ class FbRails::ConfigTest < ActiveSupport::TestCase
5
5
  assert_equal User, FbRails::Config.user_class
6
6
  assert User.new.respond_to?(:access_token)
7
7
  end
8
-
9
- test 'default timeout' do
10
- assert_equal 60, FbRails::Config.timeout
11
- end
12
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-19 00:00:00.000000000Z
12
+ date: 2011-09-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70219700445320 !ruby/object:Gem::Requirement
16
+ requirement: &70118718756760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 3.0.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70219700445320
24
+ version_requirements: *70118718756760
25
25
  description: A Rails 3 gem for the latest facebook API
26
26
  email: developer@matthewhiggins.com
27
27
  executables: []