fbrails 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/fbrails/version.rb +1 -1
  2. data/lib/fbrails.rb +6 -2
  3. metadata +1 -1
@@ -1,3 +1,3 @@
1
1
  module Fbrails
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/fbrails.rb CHANGED
@@ -29,12 +29,16 @@ end
29
29
  end
30
30
 
31
31
  def self.token_valid?(token,expires = false)
32
- if expires != false && expires != nil && expires < Time.new
32
+ if expires.class = Time && expires < Time.new
33
33
  return false
34
34
  end
35
35
 
36
36
  url = "https://graph.facebook.com/me/?access_token=#{token}"
37
- result = Fbrails.get(url)
37
+ begin
38
+ result = Fbrails.get(url)
39
+ rescue
40
+ return false
41
+ end
38
42
  if result == false
39
43
  return false
40
44
  elsif result.has_key?("id")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: