knock-knock 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/README.rdoc +5 -1
- data/lib/bubble/knock_knock/connection.rb +2 -1
- data/lib/bubble/knock_knock/request.rb +1 -1
- data/lib/knock_knock.rb +1 -1
- data/test/test_knock_knock.rb +5 -0
- metadata +2 -2
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -6,6 +6,7 @@ KnockKnock was made to turn login with Google Authentication API easier.
|
|
6
6
|
* Singleton class for connection with Google.
|
7
7
|
* Simple authentication and clear code.
|
8
8
|
* GET, POST, PUT, DELETE method implemented
|
9
|
+
* Connection with any Google Account, even (Hosted Google Accounts)[http://google.com/a]
|
9
10
|
|
10
11
|
== Synopsis
|
11
12
|
|
@@ -14,7 +15,7 @@ KnockKnock was made to turn login with Google Authentication API easier.
|
|
14
15
|
|
15
16
|
include Bubble::KnockKnock
|
16
17
|
|
17
|
-
Connection.connect('email@gmail.com', 'password', 'cp')
|
18
|
+
Connection.instance.connect('email@gmail.com', 'password', 'cp')
|
18
19
|
|
19
20
|
print Request.get('http://www.google.com/m8/feeds/contacts/email%40gmail.com/full')
|
20
21
|
|
@@ -22,6 +23,9 @@ KnockKnock was made to turn login with Google Authentication API easier.
|
|
22
23
|
|
23
24
|
sudo gem install knock-knock
|
24
25
|
|
26
|
+
== Contributors
|
27
|
+
* (Jonathan Towell)[http://moxiemachine.com/blog]
|
28
|
+
|
25
29
|
== License
|
26
30
|
|
27
31
|
(The MIT License)
|
@@ -43,10 +43,11 @@ module Bubble
|
|
43
43
|
protected
|
44
44
|
|
45
45
|
# It gives the correct values to attributes and variables required to make the connection.
|
46
|
+
# You can connect with any Google Account, even it's a hosted account (thanks, Jonathan Towell)
|
46
47
|
def setup
|
47
48
|
@uri = URI.parse('https://www.google.com/accounts/ClientLogin')
|
48
49
|
|
49
|
-
@query = { 'accountType' => '
|
50
|
+
@query = { 'accountType' => 'HOSTED_OR_GOOGLE',
|
50
51
|
'Email' => @email,
|
51
52
|
'Passwd' => @password,
|
52
53
|
'service' => @service,
|
@@ -88,7 +88,7 @@ module Bubble
|
|
88
88
|
end
|
89
89
|
|
90
90
|
@http = Net::HTTP.new(@uri.host, 443)
|
91
|
-
@http.use_ssl = true
|
91
|
+
@http.use_ssl = true
|
92
92
|
end
|
93
93
|
|
94
94
|
# Responsible by makes the right request when the developer points the HTTP Method (Post, Get), adding the parameters and the right header.
|
data/lib/knock_knock.rb
CHANGED
data/test/test_knock_knock.rb
CHANGED
@@ -12,6 +12,11 @@ class TestKnockKnock < Test::Unit::TestCase # :nodoc:
|
|
12
12
|
assert_raise(BadLogin) { @kk.connect('test@gmail.com', 'password', 'xapi') }
|
13
13
|
|
14
14
|
@kk.connect('bubble.testing@gmail.com', 'bubblerocks', 'cp')
|
15
|
+
assert google = @kk.auth
|
16
|
+
|
17
|
+
# Test with a hosted Google Account
|
18
|
+
@kk.connect('test@bubble.com.br', 'B48938', 'cp')
|
15
19
|
assert @kk.auth
|
20
|
+
assert @kk.auth != google
|
16
21
|
end
|
17
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knock-knock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Azisaka Maciel
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-12-
|
12
|
+
date: 2008-12-24 00:00:00 -02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|