zuckermo 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +1 -0
- data/Rakefile +1 -0
- data/app/app_delegate.rb +1 -1
- data/lib/zuckermo.rb +3 -0
- data/lib/zuckermo/version.rb +1 -1
- data/motion/zuckermo/account_store.rb +46 -24
- data/spec/main_spec.rb +8 -4
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f7ba3d8cf28f49471f9c5f694831ef277fc5d0b
|
4
|
+
data.tar.gz: eca59206eb095baa14b94ce5874b49d2118be9fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb5fb0cdaddf116baa247ac24edcf550a1c1ee39645ca05d369f639333851dba0945981aa37bf50215ac549508db9505626b5800b719a672297905041d9d8e7
|
7
|
+
data.tar.gz: 148c0bdd9145db908b3e2f4c01d6e12377d6365cfac8166f2e20d65eaf54614485d8b2e52de3232ef8cbfcae56de1a7f0564e975b07d5409e8980f6781a46d60
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.gitignore
CHANGED
data/Rakefile
CHANGED
data/app/app_delegate.rb
CHANGED
@@ -13,7 +13,7 @@ class AppDelegate
|
|
13
13
|
@label.setText '...'
|
14
14
|
@controller.view.addSubview @label
|
15
15
|
|
16
|
-
Facebook.app_id =
|
16
|
+
Facebook.app_id = NSBundle.mainBundle.objectForInfoDictionaryKey('APP_ID')
|
17
17
|
Facebook.sign_in do |granted, error|
|
18
18
|
if granted
|
19
19
|
@label.setText Facebook.accounts[0].username
|
data/lib/zuckermo.rb
CHANGED
@@ -7,8 +7,11 @@ end
|
|
7
7
|
require 'bubble-wrap'
|
8
8
|
|
9
9
|
Motion::Project::App.setup do |app|
|
10
|
+
|
10
11
|
Dir.glob(File.join(File.dirname(__FILE__), '../motion/**/*.rb')).each do |file|
|
11
12
|
app.files.unshift(file)
|
12
13
|
end
|
13
14
|
app.frameworks += ["Facebook", "Accounts"]
|
15
|
+
app.deployment_target = "5.1"
|
16
|
+
|
14
17
|
end
|
data/lib/zuckermo/version.rb
CHANGED
@@ -10,33 +10,55 @@ module Zuckermo
|
|
10
10
|
attr_accessor :app_id
|
11
11
|
attr_reader :account_store
|
12
12
|
|
13
|
-
|
14
|
-
self.account_store.accountTypeWithAccountTypeIdentifier(ACAccountTypeIdentifierFacebook)
|
15
|
-
end
|
13
|
+
if defined?(ACAccountTypeIdentifierFacebook) #Check's for iOS6
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
def account_type
|
16
|
+
self.account_store.accountTypeWithAccountTypeIdentifier(ACAccountTypeIdentifierFacebook)
|
17
|
+
end
|
18
|
+
|
19
|
+
def accounts
|
20
|
+
(self.account_store.accountsWithAccountType(account_type) || []).collect do |ac_account|
|
21
|
+
Zuckermo::User.new ac_account
|
22
|
+
end
|
20
23
|
end
|
21
|
-
end
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
25
|
+
def sign_in permissions, audience, &block
|
26
|
+
@permissions, @audience, @callback = permissions, audience, block
|
27
|
+
|
28
|
+
if accounts.size > 0
|
29
|
+
|
30
|
+
@options =
|
31
|
+
{
|
32
|
+
ACFacebookAppIdKey => @app_id,
|
33
|
+
ACFacebookPermissionsKey => @permissions
|
34
|
+
}
|
35
|
+
|
36
|
+
self.account_store.requestAccessToAccountsWithType( self.account_type,
|
37
|
+
options: @options,
|
38
|
+
completion: -> granted, error do
|
39
|
+
Dispatch::Queue.main.sync do
|
40
|
+
@callback.call(granted, error)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
)
|
44
|
+
else
|
45
|
+
@callback.call false, NSError.alloc.initWithDomain( 'com.zuckermo.no_accounts', code: 0, userInfo: nil )
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
else # We currently don't support iOS5
|
50
|
+
|
51
|
+
def account_type
|
52
|
+
raise NotImplemented
|
53
|
+
end
|
54
|
+
|
55
|
+
def accounts
|
56
|
+
[]
|
57
|
+
end
|
58
|
+
|
59
|
+
def sign_in permissions, audience, &block
|
60
|
+
block.call false, NotImplemented
|
61
|
+
end
|
40
62
|
end
|
41
63
|
|
42
64
|
end
|
data/spec/main_spec.rb
CHANGED
@@ -6,11 +6,15 @@ describe "Accessing a Facebook account" do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'allows us to retrieve the users name' do
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
if Facebook.accounts.size > 0
|
10
|
+
wait 1 do
|
11
|
+
tap 'ok'
|
12
|
+
end
|
13
|
+
wait 1
|
13
14
|
view('username').text.should.equal ENV['USER']
|
15
|
+
else
|
16
|
+
warn "\n\n!!!!!!!!!!!!!\n\n No acounts on simulator"
|
17
|
+
view('username').text.should.equal 'Fail... See Log'
|
14
18
|
end
|
15
19
|
end
|
16
20
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zuckermo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Rowe
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
2feWfO4gCNmvfFjULOAYHq9JHEjN5SLSXvj5HdSnDcCyIfJKn5Ya3JahWQaWIsXf
|
30
30
|
/NPE/mB57TOwj+d7XUa2NC4HUadF8R51IYEcIB0PpIEzJlKtfXFcOZxO
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2013-05-
|
32
|
+
date: 2013-05-23 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: bubble-wrap
|
metadata.gz.sig
CHANGED
Binary file
|