israkel 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -0
- data/Rakefile +4 -0
- data/VERSION +1 -1
- data/israkel.gemspec +1 -1
- data/lib/israkel/tasks.rb +20 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -59,6 +59,17 @@ tasks to change some settings:
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
## Allow GPS access
|
63
|
+
|
64
|
+
Allowing GPS access upfront can be required because it's not possible
|
65
|
+
to use KIF to tap on the OK button the the GPS access alert view.
|
66
|
+
|
67
|
+
i = ISRakel::Tasks.new
|
68
|
+
desc "Allow GPS access"
|
69
|
+
task :allow_gps_access do
|
70
|
+
i.allow_gps_access("com.plu.FooApp")
|
71
|
+
end
|
72
|
+
|
62
73
|
There's a second method called `edit_global_preferences` which works
|
63
74
|
the same, just edits a different file.
|
64
75
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/israkel.gemspec
CHANGED
data/lib/israkel/tasks.rb
CHANGED
@@ -21,6 +21,22 @@ module ISRakel
|
|
21
21
|
define_stop_task
|
22
22
|
end
|
23
23
|
|
24
|
+
def allow_gps_access(bundle_id)
|
25
|
+
directory = File.join(simulator_support_path, 'Library', 'Caches', 'locationd')
|
26
|
+
FileUtils.mkdir_p(directory) unless Dir.exists?(directory)
|
27
|
+
edit_file( File.join(directory, 'clients.plist') ) do |content|
|
28
|
+
content.merge!({
|
29
|
+
bundle_id => {
|
30
|
+
:Authorized => true,
|
31
|
+
:BundleId => bundle_id,
|
32
|
+
:Executable => "",
|
33
|
+
:Registered => "",
|
34
|
+
:Whitelisted => false,
|
35
|
+
}
|
36
|
+
})
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
24
40
|
def edit_global_preferences(&block)
|
25
41
|
unless sdk_version.to_f >= 6.0
|
26
42
|
abort "ERROR: edit_global_preferences is only supported for iOS SDK >= 6.0"
|
@@ -42,7 +58,10 @@ module ISRakel
|
|
42
58
|
private
|
43
59
|
|
44
60
|
def edit_file(file)
|
45
|
-
content =
|
61
|
+
content = {}
|
62
|
+
if File.exists?(file)
|
63
|
+
content = plist_to_hash(file)
|
64
|
+
end
|
46
65
|
yield content
|
47
66
|
hash_to_plist(content, file)
|
48
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: israkel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
segments:
|
108
108
|
- 0
|
109
|
-
hash:
|
109
|
+
hash: 2434754097521065311
|
110
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
111
|
none: false
|
112
112
|
requirements:
|