zuckermo 0.0.2 → 0.0.3
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/Rakefile +1 -0
- data/lib/zuckermo.rb +5 -3
- data/lib/zuckermo/version.rb +1 -1
- data/motion/pollute.rb +1 -1
- data/motion/zuckermo/account_store.rb +35 -39
- data/spec/main_spec.rb +2 -2
- 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: 15862040247ad3843f1b6a5c89daf9be6770d2c7
|
4
|
+
data.tar.gz: 5f63569a8bcabed9b8c1ac3e775d7dcc6784f0ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f282997f04544da3b75fc8f3a280ad7fe8963c15a1df8efe4a59372d35913a988d9f2a68343bde955911359eb25e081e88e39620c28e5b1297141393c4581cf1
|
7
|
+
data.tar.gz: cb7f7e4bca9ea98c2141dc958d99f314ce1aef123bafb1eb7b53840f605bbe6625ba1a6b5b2914b1cf9f3655dad9683968602ef008e72e38cd0243c38f4573f8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Rakefile
CHANGED
data/lib/zuckermo.rb
CHANGED
@@ -8,10 +8,12 @@ require 'bubble-wrap'
|
|
8
8
|
|
9
9
|
Motion::Project::App.setup do |app|
|
10
10
|
|
11
|
-
|
11
|
+
root = File.join( File.dirname(__FILE__), '../motion' )
|
12
|
+
zuckermo_files = Dir.glob root+'/**/*.rb'
|
13
|
+
|
14
|
+
%W[#{root}/pollute.rb #{root}/facebook.rb #{root}/zuckermo.rb] + zuckermo_files.each do |file|
|
12
15
|
app.files.unshift(file)
|
13
16
|
end
|
14
|
-
app.
|
15
|
-
app.deployment_target = "5.1"
|
17
|
+
app.weak_frameworks += ["Social","Accounts"]
|
16
18
|
|
17
19
|
end
|
data/lib/zuckermo/version.rb
CHANGED
data/motion/pollute.rb
CHANGED
@@ -10,56 +10,52 @@ module Zuckermo
|
|
10
10
|
attr_accessor :app_id
|
11
11
|
attr_reader :account_store
|
12
12
|
|
13
|
-
|
13
|
+
def facebook_supported?
|
14
|
+
UIDevice.currentDevice.systemVersion.to_f >= 6
|
15
|
+
end
|
14
16
|
|
15
|
-
|
17
|
+
def account_type
|
18
|
+
if facebook_supported?
|
16
19
|
self.account_store.accountTypeWithAccountTypeIdentifier(ACAccountTypeIdentifierFacebook)
|
20
|
+
else
|
21
|
+
nil
|
17
22
|
end
|
23
|
+
end
|
18
24
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
25
|
+
def accounts
|
26
|
+
(self.account_store.accountsWithAccountType(account_type) || []).collect do |ac_account|
|
27
|
+
Zuckermo::User.new ac_account
|
23
28
|
end
|
29
|
+
end
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
@callback.call(granted, error)
|
41
|
-
end
|
31
|
+
def sign_in permissions, audience, &block
|
32
|
+
@permissions, @audience, @callback = permissions, audience, block
|
33
|
+
|
34
|
+
if facebook_supported?
|
35
|
+
@options =
|
36
|
+
{
|
37
|
+
ACFacebookAppIdKey => @app_id,
|
38
|
+
ACFacebookPermissionsKey => @permissions
|
39
|
+
}
|
40
|
+
|
41
|
+
self.account_store.requestAccessToAccountsWithType( self.account_type,
|
42
|
+
options: @options,
|
43
|
+
completion: -> granted, error do
|
44
|
+
Dispatch::Queue.main.sync do
|
45
|
+
@callback.call(granted, error)
|
42
46
|
end
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
else # We currently don't support iOS5
|
50
|
-
|
51
|
-
def account_type
|
52
|
-
raise NotImplemented
|
47
|
+
end
|
48
|
+
)
|
49
|
+
else
|
50
|
+
@callback.call false, unsupported_error
|
53
51
|
end
|
52
|
+
end
|
54
53
|
|
55
|
-
|
56
|
-
[]
|
57
|
-
end
|
54
|
+
private
|
58
55
|
|
59
|
-
def
|
60
|
-
|
56
|
+
def unsupported_error
|
57
|
+
NSError.errorWithDomain('com.zuckermo.unsupported_ios_version', code: 0, userInfo:nil)
|
61
58
|
end
|
62
|
-
end
|
63
59
|
|
64
60
|
end
|
65
61
|
end
|
data/spec/main_spec.rb
CHANGED
@@ -8,10 +8,10 @@ describe "Accessing a Facebook account" do
|
|
8
8
|
it 'allows us to retrieve the users name' do
|
9
9
|
if Facebook.accounts.size > 0
|
10
10
|
wait 1 do
|
11
|
-
tap '
|
11
|
+
tap 'OK'
|
12
12
|
end
|
13
13
|
wait 1
|
14
|
-
view('username').text.should.equal ENV['
|
14
|
+
view('username').text.should.equal ENV['FBUSER']
|
15
15
|
else
|
16
16
|
warn "\n\n!!!!!!!!!!!!!\n\n No acounts on simulator"
|
17
17
|
view('username').text.should.equal 'Fail... See Log'
|
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.3
|
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-24 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
|