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 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
@@ -27,3 +27,7 @@ task :set_keyboard_preferences do
27
27
  end
28
28
  end
29
29
 
30
+ desc "Allow GPS access"
31
+ task :allow_gps_access do
32
+ i.allow_gps_access("com.plu.FooApp")
33
+ end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "israkel"
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Johannes Plunien"]
@@ -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 = plist_to_hash(file)
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.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: 2027802512929039524
109
+ hash: 2434754097521065311
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements: