facebookcl 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/facebookcl.gemspec +1 -1
  3. data/lib/facebookcl.rb +9 -6
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
data/facebookcl.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{facebookcl}
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Bishop"]
data/lib/facebookcl.rb CHANGED
@@ -1,19 +1,22 @@
1
1
  require 'rubygems'
2
2
 
3
- require 'json'
3
+ # built in
4
4
  require 'net/http'
5
5
  require 'net/https'
6
6
  require 'open-uri'
7
7
  require 'socket'
8
8
  require 'uri'
9
9
 
10
+ # runtime dependencies
11
+ require 'json'
12
+
10
13
  module FacebookCL; class << self
11
14
  public
12
15
 
13
- APP_ID = 119412046078
14
- SERVER_PORT = 6682
16
+ APP_ID = 119412046078 # FacebookCL
17
+ SERVER_PORT = 6682 # my birthday ;o)
15
18
  GRAPH_URL = 'graph.facebook.com'
16
- NEXT_URL = 'http://127.0.0.1:6682'
19
+ NEXT_URL = '127.0.0.1'
17
20
 
18
21
  attr_accessor :uid
19
22
 
@@ -32,7 +35,7 @@ module FacebookCL; class << self
32
35
  'read_mailbox']
33
36
 
34
37
  params = {'client_id' => APP_ID,
35
- 'redirect_uri' => NEXT_URL,
38
+ 'redirect_uri' => "http://#{NEXT_URL}:#{SERVER_PORT}",
36
39
  'type' => 'user_agent',
37
40
  'display' => 'page',
38
41
  'scope' => perms.join(',')}
@@ -115,7 +118,7 @@ module FacebookCL; class << self
115
118
  end
116
119
 
117
120
  def serve_content(content)
118
- @server ||= TCPServer.new('127.0.0.1', SERVER_PORT)
121
+ @server ||= TCPServer.new(NEXT_URL, SERVER_PORT)
119
122
 
120
123
  session = @server.accept
121
124
  session.print "HTTP/1.1 200/OK\r\nContent-type:text/html\r\n\r\n"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebookcl
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Bishop