calabash-cucumber 0.9.23 → 0.9.24

Sign up to get free protection for your applications and to get access to all the features.
data/bin/calabash-ios CHANGED
@@ -33,6 +33,9 @@ elsif cmd == 'setup'
33
33
  elsif cmd == 'check'
34
34
  validate_setup(ARGV)
35
35
  exit 0
36
+ elsif cmd == 'submit'
37
+ calabash_submit(ARGV)
38
+ exit 0
36
39
  elsif cmd == 'sim'
37
40
  if ARGV.length == 0
38
41
  print_usage
@@ -1,3 +1,7 @@
1
+ require 'tempfile'
2
+ require 'json'
3
+
4
+
1
5
  def msg(title, &block)
2
6
  puts "\n" + "-"*10 + title + "-"*10
3
7
  block.call
@@ -19,6 +23,8 @@ def print_usage
19
23
  downloads latest compatible version of calabash.framework
20
24
  check (EXPERIMENTAL) [opt path to .ipa/.app]?
21
25
  check whether an app or ipa is linked with calabash.framework
26
+ submit [ipapath] [secret] [opt_features path]?
27
+ submits an ipa and features folder to www.lesspainful.com
22
28
  sim locale [lang] [regional]?
23
29
  change locale and regional settings in all iOS Simulators
24
30
  sim reset
@@ -62,4 +68,52 @@ def ensure_correct_path(args)
62
68
  end
63
69
 
64
70
 
65
- ####
71
+ def is_json?(str)
72
+ str[0..0] == '{'
73
+ end
74
+
75
+ def calabash_submit(args)
76
+ if args.size < 2
77
+ msg("Error") do
78
+ puts "You must supply at path to ipa and secret."
79
+ end
80
+ exit 1
81
+ end
82
+
83
+ ipa_file = args[0]
84
+ if not File.exists?(ipa_file)
85
+ msg("Error") do
86
+ puts "Unable to find .ipa at '#{ipa_file}'"
87
+ end
88
+ exit 1
89
+ end
90
+
91
+ secret = args[1]
92
+
93
+ archive_path = "#{Tempfile.new("archive").path}.zip"
94
+
95
+ feature_path = "features"
96
+ if args.length == 3
97
+ feature_path = args[2]
98
+ end
99
+ system ("zip -r -o #{archive_path} #{File.expand_path(feature_path)}")
100
+
101
+ msg("Info") do
102
+ puts "Uploading ipa and features to www.lesspainful.com"
103
+ end
104
+
105
+ result = `curl -F "secret=#{secret}" -F "app=@#{ipa_file}" -F "env=@#{archive_path}" https://www.lesspainful.com/cmd_upload`
106
+
107
+ if is_json? result
108
+ json_result = JSON.parse(result)
109
+ puts "Test status is '#{json_result['status']}"
110
+ puts "Test id is '#{json_result['id']}"
111
+ puts "You can see the test result here: #{json_result['url']}"
112
+ puts "You can pull the status by using this command:"
113
+ puts "curl -F \"secret=#{secret}\" -F \"id=#{json_result['id']}\" https://www.lesspainful.com/cmd_status"
114
+ else
115
+ puts result
116
+ end
117
+
118
+ end
119
+
@@ -59,6 +59,15 @@ Usage: calabash-ios <command-name> [parameters]
59
59
  build configurations. We check that Debug doesn't link with
60
60
  calabash.framework but Calabash does.
61
61
 
62
+ submit [ipapath] [secret] [opt_features path]?
63
+ submits an ipa and features folder to www.lesspainful.com
64
+ [ipapath] should be a path to a build .ipa file which is
65
+ linked with calabash.framework. [secret] should be an account
66
+ secret created with your LessPainful account.
67
+ [op_features path] is optional (default is current working dir)
68
+ If specified it should be the path to the features folder
69
+ you want to send.
70
+
62
71
  sim locale [lang] [regional]? Changes the regional settings
63
72
  for the iOS Simulators. You must ensure the correct format
64
73
  for the optional regional parameter, for example,
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = "0.9.23"
3
+ VERSION = "0.9.24"
4
4
  FRAMEWORK_VERSION = "0.9.23"
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.23
4
+ version: 0.9.24
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cucumber
16
- requirement: &70321592588020 !ruby/object:Gem::Requirement
16
+ requirement: &70157175454340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70321592588020
24
+ version_requirements: *70157175454340
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &70321592587020 !ruby/object:Gem::Requirement
27
+ requirement: &70157175453820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70321592587020
35
+ version_requirements: *70157175453820
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: CFPropertyList
38
- requirement: &70321592585620 !ruby/object:Gem::Requirement
38
+ requirement: &70157175453080 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70321592585620
46
+ version_requirements: *70157175453080
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sim_launcher
49
- requirement: &70321592585040 !ruby/object:Gem::Requirement
49
+ requirement: &70157175452280 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70321592585040
57
+ version_requirements: *70157175452280
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: slowhandcuke
60
- requirement: &70321592584620 !ruby/object:Gem::Requirement
60
+ requirement: &70157175450980 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70321592584620
68
+ version_requirements: *70157175450980
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: net-http-persistent
71
- requirement: &70321592584120 !ruby/object:Gem::Requirement
71
+ requirement: &70157175450480 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70321592584120
79
+ version_requirements: *70157175450480
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: pbxproject
82
- requirement: &70321592583460 !ruby/object:Gem::Requirement
82
+ requirement: &70157175450040 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70321592583460
90
+ version_requirements: *70157175450040
91
91
  description: calabash-cucumber drives tests for native iOS apps. You must link your
92
92
  app with calabash-ios-server framework to execute tests.
93
93
  email: