frankie 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1 +1,3 @@
1
+ v0.2.2. Updated to deal with session change in Sinatra, plus misc bug fixes with Facebooker integration
2
+
1
3
  v0.2.0. Converted codebase to become Ruby Gem
data/Manifest CHANGED
@@ -1,3 +1,4 @@
1
+ bin/tunnel
1
2
  CHANGELOG
2
3
  lib/frankie.rb
3
4
  LICENSE
@@ -5,3 +6,4 @@ Manifest
5
6
  Rakefile
6
7
  README.rdoc
7
8
  test/frankie_test.rb
9
+ test/helper.rb
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ host, remote_port, local_port = ARGV
4
+ raise 'You must specify at least a hostname - i.e. tunnel myhost.com' unless host
5
+ remote_port ||= 10000
6
+ local_port ||= 4567
7
+ puts "Tunneling #{host}:#{remote_port} to 0.0.0.0:#{local_port}"
8
+ begin
9
+ exec "autossh -M 48484 -nNT -g -R *:#{remote_port}:0.0.0.0:#{local_port} #{host}"
10
+ rescue
11
+ raise "Tunnel failed to start. Do you have autossh installed?"
12
+ end
@@ -1,20 +1,22 @@
1
1
 
2
- # Gem::Specification for Frankie-0.2.0
2
+ # Gem::Specification for Frankie-0.2.2
3
3
  # Originally generated by Echoe
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{frankie}
7
- s.version = "0.2.0"
7
+ s.version = "0.2.2"
8
8
 
9
9
  s.specification_version = 2 if s.respond_to? :specification_version=
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["Ron Evans"]
13
- s.date = %q{2008-04-12}
13
+ s.date = %q{2008-04-21}
14
+ s.default_executable = %q{tunnel}
14
15
  s.description = %q{Easy creation of Facebook applications in Ruby using plugin for Sinatra web framework that integrates with Facebooker gem.}
15
16
  s.email = %q{}
16
- s.extra_rdoc_files = ["CHANGELOG", "lib/frankie.rb", "LICENSE", "README.rdoc"]
17
- s.files = ["CHANGELOG", "lib/frankie.rb", "LICENSE", "Manifest", "Rakefile", "README.rdoc", "test/frankie_test.rb", "frankie.gemspec"]
17
+ s.executables = ["tunnel"]
18
+ s.extra_rdoc_files = ["bin/tunnel", "CHANGELOG", "lib/frankie.rb", "LICENSE", "README.rdoc"]
19
+ s.files = ["bin/tunnel", "CHANGELOG", "lib/frankie.rb", "LICENSE", "Manifest", "Rakefile", "README.rdoc", "test/frankie_test.rb", "test/helper.rb", "frankie.gemspec"]
18
20
  s.has_rdoc = true
19
21
  s.homepage = %q{http://facethesinatra.com/}
20
22
  s.post_install_message = %q{*** Frankie was installed ***}
@@ -53,7 +53,7 @@ module Frankie
53
53
  private
54
54
 
55
55
  def session_already_secured?
56
- (@facebook_session = session['facebook_session']) && session['facebook_session'].secured?
56
+ (@facebook_session = session[:facebook_session]) && session[:facebook_session].secured?
57
57
  end
58
58
 
59
59
  def secure_with_token!
@@ -61,7 +61,7 @@ module Frankie
61
61
  @facebook_session = new_facebook_session
62
62
  @facebook_session.auth_token = params['auth_token']
63
63
  @facebook_session.secure!
64
- session['facebook_session'] = @facebook_session
64
+ session[:facebook_session] = @facebook_session
65
65
  end
66
66
  end
67
67
 
@@ -76,9 +76,8 @@ module Frankie
76
76
  end
77
77
 
78
78
  def create_new_facebook_session_and_redirect!
79
- s = new_facebook_session
80
- session['facebook_session'] = s
81
- throw :halt, do_redirect(session['facebook_session'].login_url) unless @installation_required
79
+ session[:facebook_session] = new_facebook_session
80
+ throw :halt, do_redirect(session[:facebook_session].login_url) unless @installation_required
82
81
  end
83
82
 
84
83
  def new_facebook_session
@@ -89,7 +88,7 @@ module Frankie
89
88
  return unless request_is_for_a_facebook_canvas?
90
89
  if friends = facebook_params['friends']
91
90
  facebook_session.user.friends = friends.map do |friend_uid|
92
- User.new(friend_uid, facebook_session)
91
+ Facebooker::User.new(friend_uid, facebook_session)
93
92
  end
94
93
  end
95
94
  end
@@ -139,7 +138,7 @@ module Frankie
139
138
 
140
139
  def do_redirect(*args)
141
140
  if request_is_for_a_facebook_canvas?
142
- fbml_redirect_tag(args[0])
141
+ fbml_redirect_tag(args)
143
142
  else
144
143
  redirect args[0]
145
144
  end
@@ -150,8 +149,8 @@ module Frankie
150
149
  end
151
150
 
152
151
  def request_is_for_a_facebook_canvas?
153
- return false if !params["fb_sig_in_canvas"]
154
- !params["fb_sig_in_canvas"].blank?
152
+ return false if params["fb_sig_in_canvas"].nil?
153
+ params["fb_sig_in_canvas"] == "1"
155
154
  end
156
155
 
157
156
  def application_is_installed?
@@ -170,7 +169,7 @@ module Frankie
170
169
  end
171
170
 
172
171
  def application_is_not_installed_by_facebook_user
173
- throw :halt, do_redirect(session['facebook_session'].install_url)
172
+ throw :halt, do_redirect(session[:facebook_session].install_url)
174
173
  end
175
174
 
176
175
  def set_fbml_format
@@ -0,0 +1,4 @@
1
+ require 'rubygems'
2
+ require 'sinatra'
3
+ require File.dirname(__FILE__) + '/../lib/frankie'
4
+ require 'sinatra/test/spec'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frankie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ron Evans
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-04-12 00:00:00 -07:00
12
+ date: 2008-04-21 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -32,16 +32,18 @@ dependencies:
32
32
  version:
33
33
  description: Easy creation of Facebook applications in Ruby using plugin for Sinatra web framework that integrates with Facebooker gem.
34
34
  email: ""
35
- executables: []
36
-
35
+ executables:
36
+ - tunnel
37
37
  extensions: []
38
38
 
39
39
  extra_rdoc_files:
40
+ - bin/tunnel
40
41
  - CHANGELOG
41
42
  - lib/frankie.rb
42
43
  - LICENSE
43
44
  - README.rdoc
44
45
  files:
46
+ - bin/tunnel
45
47
  - CHANGELOG
46
48
  - lib/frankie.rb
47
49
  - LICENSE
@@ -49,6 +51,7 @@ files:
49
51
  - Rakefile
50
52
  - README.rdoc
51
53
  - test/frankie_test.rb
54
+ - test/helper.rb
52
55
  - frankie.gemspec
53
56
  has_rdoc: true
54
57
  homepage: http://facethesinatra.com/