sinbook 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -74,6 +74,16 @@ sinbook: simple sinatra facebook extension in 300 lines of ruby
74
74
  => 'hello world'
75
75
 
76
76
 
77
+ === Other Options
78
+
79
+ facebook do
80
+ symbolize_keys true
81
+ end
82
+
83
+ >> fb.groups.get :uid => 1234
84
+ => [{:name => 'Sinatra Users'}]
85
+
86
+
77
87
  === Local Development
78
88
 
79
89
  To develop locally, use ssh to setup a reverse tunnel to your external server.
@@ -85,17 +95,6 @@ sinbook: simple sinatra facebook extension in 300 lines of ruby
85
95
  http://myserver.com:4567/ which will be forwarded to port 4567 on your local machine.
86
96
 
87
97
 
88
-
89
- === Other Options
90
-
91
- facebook do
92
- symbolize_keys true
93
- end
94
-
95
- >> fb.groups.get :uid => 1234
96
- => [{:name => 'Sinatra Users'}]
97
-
98
-
99
98
  === TODO
100
99
 
101
100
  * Split out facebook api client so it can be used outside sinatra
@@ -1,4 +1,5 @@
1
1
  require 'rubygems'
2
+ $:.unshift File.join(File.dirname(__FILE__),'../lib')
2
3
  require 'sinbook'
3
4
  require 'sinatra'
4
5
 
@@ -39,7 +40,7 @@ __END__
39
40
  FB.init("#{fb.api_key}", "/receiver")
40
41
 
41
42
  @@ main
42
- - if fb.valid? and fb[:user]
43
+ - if fb[:user]
43
44
  Hi,
44
45
  %fb:profile-pic{:uid => fb[:user]}
45
46
  %fb:name{:uid => fb[:user], :useyou => 'false', :firstnameonly => 'true'}
@@ -1,4 +1,5 @@
1
1
  require 'rubygems'
2
+ $:.unshift File.join(File.dirname(__FILE__),'../lib')
2
3
  require 'sinbook'
3
4
  require 'sinatra'
4
5
 
@@ -145,7 +145,7 @@ module Sinatra
145
145
 
146
146
  alias :__class__ :class
147
147
  alias :__inspect__ :inspect
148
- instance_methods.each { |m| undef_method m unless m =~ /^__/ }
148
+ instance_methods.each { |m| undef_method m unless m =~ /^(__|object_id)/ }
149
149
  alias :inspect :__inspect__
150
150
 
151
151
  def initialize name, obj
@@ -338,17 +338,17 @@ module Sinatra
338
338
  FacebookSettings.new(self, &blk)
339
339
  end
340
340
 
341
+ FixRequestMethod = proc{
342
+ if method = request.params['fb_sig_request_method']
343
+ request.env['REQUEST_METHOD'] = method
344
+ end
345
+ }
346
+
341
347
  def self.registered app
342
348
  app.helpers FacebookHelper
343
- app.before(&method(:fix_request_method))
349
+ app.before(&FixRequestMethod)
344
350
  app.disable :sessions
345
351
  end
346
-
347
- def self.fix_request_method app
348
- if method = app.request.params['fb_sig_request_method']
349
- app.request.env['REQUEST_METHOD'] = method
350
- end
351
- end
352
352
  end
353
353
 
354
354
  Application.register Facebook
@@ -1,7 +1,7 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'sinbook'
3
- s.version = '0.1.5'
4
- s.date = '2009-11-25'
3
+ s.version = '0.1.6'
4
+ s.date = '2009-11-26'
5
5
  s.summary = 'simple sinatra facebook extension in 300 lines of ruby'
6
6
  s.description = 'A full-featured facebook extension for the sinatra webapp framework'
7
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aman Gupta
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-25 00:00:00 -05:00
12
+ date: 2009-11-26 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  requirements: []
61
61
 
62
62
  rubyforge_project:
63
- rubygems_version: 1.3.4
63
+ rubygems_version: 1.3.5
64
64
  signing_key:
65
65
  specification_version: 3
66
66
  summary: simple sinatra facebook extension in 300 lines of ruby