calabash-cucumber 0.9.67 → 0.9.68

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.67)
4
+ calabash-cucumber (0.9.68)
5
5
  CFPropertyList
6
6
  cucumber
7
7
  json
@@ -1,3 +1,3 @@
1
1
  INSTALL_PATH = /./
2
2
 
3
- OTHER_LDFLAGS = $(inherited) -force_load $(SRCROOT)/Calabash/calabash.framework/calabash -framework CFNetwork -lstdc++
3
+ OTHER_LDFLAGS = $(inherited) -force_load $(SRCROOT)/calabash.framework/calabash -framework CFNetwork -lstdc++
@@ -32,6 +32,9 @@ elsif cmd == 'console'
32
32
  elsif cmd == 'build'
33
33
  build
34
34
  exit 0
35
+ elsif cmd == 'run'
36
+ run
37
+ exit 0
35
38
  elsif cmd == 'download'
36
39
  calabash_download(ARGV)
37
40
  exit 0
@@ -1,3 +1,8 @@
1
+ def ensure_build_dir(options={:build_dir => "Calabash"})
2
+ if !File.exist?(options[:build_dir])
3
+ FileUtils.mkdir_p options[:build_dir]
4
+ end
5
+ end
1
6
 
2
7
  def build(options={:build_dir=>"Calabash",
3
8
  :configuration => "Debug",
@@ -6,9 +11,7 @@ def build(options={:build_dir=>"Calabash",
6
11
  :wrapper_name => "Calabash.app"})
7
12
  #Follow Pete's .xcconfig-based approach with zero-config
8
13
 
9
- if !File.exist?(options[:build_dir])
10
- FileUtils.mkdir_p options[:build_dir]
11
- end
14
+ ensure_build_dir(options)
12
15
 
13
16
  if !File.exists?("#{options[:build_dir]}/cal.xcconfig")
14
17
  FileUtils.cp(File.join(File.dirname(__FILE__),"cal.xcconfig"),"#{options[:build_dir]}/cal.xcconfig")
@@ -32,11 +35,13 @@ def build(options={:build_dir=>"Calabash",
32
35
 
33
36
  cmd << %Q[WRAPPER_NAME="#{options[:wrapper_name]}"]
34
37
 
38
+ res =nil
35
39
  msg("Calabash Build") do
36
40
  cmd_s = cmd.join(" ")
37
41
  puts cmd_s
38
- system(cmd_s)
42
+ res=system(cmd_s)
39
43
  end
44
+ res
40
45
  end
41
46
 
42
47
  def console(options={:script => "irb_ios5.sh"})
@@ -51,3 +56,36 @@ def console(options={:script => "irb_ios5.sh"})
51
56
  puts "Running irb with ./.irbrc..."
52
57
  system("./#{options[:script]}")
53
58
  end
59
+
60
+
61
+ def run(options={:build_dir=>"Calabash",
62
+ :configuration => "Debug",
63
+ :sdk => "iphonesimulator",
64
+ :dstroot => "Calabash/build",
65
+ :wrapper_name => "Calabash.app"})
66
+ if ENV['NO_DOWNLOAD'] != "1"
67
+ if !File.directory?("calabash.framework")
68
+ calabash_download(ARGV)
69
+ end
70
+ end
71
+
72
+ if ENV['NO_BUILD'] != "1"
73
+ if !build(options)
74
+ msg("Info") do
75
+ puts "Build failed. Please consult logs. Aborting."
76
+ end
77
+ end
78
+ end
79
+
80
+ if ENV["NO_GEN"] != "1"
81
+ if !File.directory?("features")
82
+ calabash_scaffold
83
+ end
84
+ end
85
+
86
+ default_path = "#{options[:dstroot]}/#{options[:wrapper_name]}"
87
+ cmd = %Q[APP_BUNDLE_PATH="#{ENV['APP_BUNDLE_PATH'] || default_path}" cucumber]
88
+ puts cmd
89
+ system(cmd)
90
+ puts "Done..."
91
+ end
@@ -121,6 +121,7 @@ def download_calabash(project_path)
121
121
  else
122
122
  connection = Net::HTTP
123
123
  end
124
+ begin
124
125
  connection.start(uri.host, uri.port) do |http|
125
126
  request = Net::HTTP::Get.new uri.request_uri
126
127
 
@@ -139,6 +140,13 @@ def download_calabash(project_path)
139
140
  end
140
141
  end
141
142
  end
143
+ rescue SocketError => e
144
+ msg("Error") do
145
+ puts "Exception: #{e}"
146
+ puts "Unable to download Calabash. Please check connection."
147
+ end
148
+ exit 1
149
+ end
142
150
  if success
143
151
  puts "\nDownload done: #{file}. Unzipping..."
144
152
  if not system("unzip -C -K -o -q -d #{project_path} #{zip_file}")
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = "0.9.67"
3
+ VERSION = "0.9.68"
4
4
  FRAMEWORK_VERSION = "0.9.65"
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.67
4
+ version: 0.9.68
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: