calabash-cucumber 0.9.104 → 0.9.105

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- calabash-cucumber (0.9.104)
4
+ calabash-cucumber (0.9.105)
5
5
  CFPropertyList
6
6
  bundler (~> 1.1)
7
7
  cucumber
@@ -62,6 +62,8 @@ elsif cmd == 'sim'
62
62
  calabash_sim_reset
63
63
  elsif subcmd == 'acc'
64
64
  calabash_sim_accessibility
65
+ elsif subcmd == 'location'
66
+ calabash_sim_location(ARGV)
65
67
  elsif subcmd == 'locale'
66
68
  calabash_sim_locale(ARGV)
67
69
  elsif subcmd == 'device'
@@ -18,9 +18,9 @@ def calabash_scaffold
18
18
  FileUtils.mv "#{@features_dir}/irb_ios5.sh", "."
19
19
 
20
20
  msg("Info") do
21
- puts "features subdirectory created. \n"
22
- puts "Try executing \n\nDEVICE=iphone OS=ios5 cucumber"
23
- puts "\n (replace ios5 with ios4 if running iOS 4.x simulator.\nReplace iphone with ipad if running iPad simulator.).\n"
21
+ puts "Features subdirectory created. \n"
22
+ puts "Make sure you've build your -cal scheme in XCode and "
23
+ puts "try executing \n\ncucumber"
24
24
  end
25
25
 
26
26
  end
@@ -25,10 +25,10 @@ def print_usage
25
25
  downloads latest compatible version of calabash.framework
26
26
  check (EXPERIMENTAL) [opt path to .ipa/.app]?
27
27
  check whether an app or ipa is linked with calabash.framework
28
- submit [ipapath] [secret] [opt_features path]?
29
- submits an ipa and features folder to www.lesspainful.com
30
28
  sim locale [lang] [regional]?
31
29
  change locale and regional settings in all iOS Simulators
30
+ sim location [on|off] [bundleid]?
31
+ set allow location on/off for current project or bundleid
32
32
  sim reset
33
33
  reset content and settings in all iOS Simulators
34
34
  sim acc
@@ -24,7 +24,7 @@ end
24
24
 
25
25
  def calabash_setup(args)
26
26
  puts "Checking if Xcode is running..."
27
- res = `ps x -o pid,command | grep -v grep | grep Xcode.app/Contents/MacOS/Xcode`
27
+ res = `ps x -o pid,command | grep -v grep | grep Contents/MacOS/Xcode`
28
28
  if res==""
29
29
  puts "Xcode not running."
30
30
  project_name, project_path, xpath = find_project_files(args)
@@ -49,22 +49,8 @@ def calabash_setup(args)
49
49
 
50
50
  else
51
51
  puts "Xcode is running. We'll be changing the project file so we'd better stop it."
52
- puts "Shall I stop Xcode? Please answer yes (y) or no (n)"
53
- answer = STDIN.gets.chomp
54
- if (answer == 'yes' or answer == 'y')
55
- res.split("\n").each do |line|
56
- pid = line.split(" ")[0]
57
- if system("kill #{pid}")
58
- puts "Stopped XCode. Retrying... "
59
- calabash_setup(args)
60
- else
61
- puts "Killing Xcode seemed to fail :( Aborting..."
62
- end
63
- end
64
- else
65
- puts "Please stop Xcode and try again."
66
- exit(0)
67
- end
52
+ puts "Please stop XCode and run setup again"
53
+ exit(0)
68
54
  end
69
55
  end
70
56
 
@@ -26,6 +26,50 @@ def calabash_sim_accessibility
26
26
  end
27
27
  end
28
28
 
29
+
30
+ def calabash_sim_location(args)
31
+
32
+ if args.length == 0
33
+ print_usage
34
+ exit 0
35
+ end
36
+ on_off = args.shift
37
+ if args.length == 0
38
+ print_usage
39
+ exit 0
40
+ end
41
+ bundle_id = args.shift
42
+
43
+
44
+ dirs = Dir.glob(File.join(File.expand_path("~/Library"),"Application Support","iPhone Simulator","*.*","Library","Caches","locationd"))
45
+ dirs.each do |sim_dir|
46
+ existing_path = "#{sim_dir}/clients.plist"
47
+ if File.exist?(existing_path)
48
+ plist_path = existing_path
49
+ else
50
+ plist_path = File.expand_path("#{@script_dir}/data/clients.plist")
51
+ end
52
+
53
+ plist = CFPropertyList::List.new(:file => plist_path)
54
+ hash = CFPropertyList.native_types(plist.value)
55
+
56
+ app_hash = hash[bundle_id]
57
+ if not app_hash
58
+ app_hash = hash[bundle_id] = {}
59
+ end
60
+ app_hash["BundleId"] = bundle_id
61
+ app_hash["Authorized"] = on_off == "on" ? true : false
62
+ app_hash["LocationTimeStarted"] = 0
63
+
64
+ ##Plist edit the template
65
+ res_plist = CFPropertyList::List.new
66
+ res_plist.value = CFPropertyList.guess(hash)
67
+ res_plist.save(existing_path, CFPropertyList::List::FORMAT_BINARY)
68
+
69
+ end
70
+ end
71
+
72
+
29
73
  def calabash_sim_locale(args)
30
74
 
31
75
  prefs_path = File.expand_path("#{@script_dir}/data/.GlobalPreferences.plist")
@@ -61,15 +61,6 @@ Usage: calabash-ios <command-name> [parameters]
61
61
  build configurations. We check that Debug doesn't link with
62
62
  calabash.framework but Calabash does.
63
63
 
64
- submit [ipapath] [secret] [opt_features path]?
65
- submits an ipa and features folder to www.lesspainful.com
66
- [ipapath] should be a path to a build .ipa file which is
67
- linked with calabash.framework. [secret] should be an account
68
- secret created with your LessPainful account.
69
- [op_features path] is optional (default is current working dir)
70
- If specified it should be the path to the features folder
71
- you want to send.
72
-
73
64
  sim locale [lang] [regional]? Changes the regional settings
74
65
  for the iOS Simulators. You must ensure the correct format
75
66
  for the optional regional parameter, for example,
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = "0.9.104"
3
+ VERSION = "0.9.105"
4
4
  FRAMEWORK_VERSION = "0.9.103"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.104
4
+ version: 0.9.105
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-17 00:00:00.000000000 Z
12
+ date: 2012-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cucumber
@@ -253,6 +253,7 @@ files:
253
253
  - lib/calabash-cucumber/version.rb
254
254
  - lib/calabash-cucumber/wait_helpers.rb
255
255
  - scripts/data/.GlobalPreferences.plist
256
+ - scripts/data/clients.plist
256
257
  - scripts/data/com.apple.Accessibility.plist
257
258
  - scripts/reset_simulator.scpt
258
259
  homepage: http://calaba.sh