calabash-cucumber 0.9.140.pre2 → 0.9.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,10 @@ module Calabash
19
19
 
20
20
  DEFAULT_SIM_RETRY = 2
21
21
 
22
+ # Load environment variable for showing full console output
23
+ # If not env var set then we use true; i.e. output to console in full
24
+ FULL_CONSOLE_OUTPUT = ENV['CALABASH_FULL_CONSOLE_OUTPUT'] == 'false' ? false : true
25
+
22
26
  def self.relaunch(path, sdk = nil, version = 'iphone', args = nil)
23
27
 
24
28
  app_bundle_path = app_bundle_or_raise(path)
@@ -176,12 +180,18 @@ module Calabash
176
180
  timeout = (ENV['CONNECT_TIMEOUT'] || DEFAULT_SIM_WAIT).to_i
177
181
  retry_count = 0
178
182
  connected = false
179
- puts "Waiting at most #{timeout} seconds for simulator (CONNECT_TIMEOUT)"
180
- puts "Retrying at most #{max_retry_count} times (MAX_CONNECT_RETRY)"
183
+
184
+ if FULL_CONSOLE_OUTPUT
185
+ puts "Waiting at most #{timeout} seconds for simulator (CONNECT_TIMEOUT)"
186
+ puts "Retrying at most #{max_retry_count} times (MAX_CONNECT_RETRY)"
187
+ end
188
+
181
189
  until connected do
182
190
  raise "MAX_RETRIES" if retry_count == max_retry_count
183
191
  retry_count += 1
184
- puts "(#{retry_count}.) Start Simulator #{sdk}, #{version}, for #{app_bundle_path}"
192
+ if FULL_CONSOLE_OUTPUT
193
+ puts "(#{retry_count}.) Start Simulator #{sdk}, #{version}, for #{app_bundle_path}"
194
+ end
185
195
  begin
186
196
  Timeout::timeout(timeout, TimeoutErr) do
187
197
  simulator = launch(app_bundle_path, sdk, version, args)
@@ -196,7 +206,9 @@ module Calabash
196
206
  if connected
197
207
  server_version = get_version
198
208
  if server_version
199
- p server_version
209
+ if FULL_CONSOLE_OUTPUT
210
+ p server_version
211
+ end
200
212
  unless version_check(server_version)
201
213
  msgs = ["You're running an older version of Calabash server with a newer client",
202
214
  "Client:#{Calabash::Cucumber::VERSION}",
@@ -241,7 +253,9 @@ module Calabash
241
253
 
242
254
  def self.ping_app
243
255
  url = URI.parse(ENV['DEVICE_ENDPOINT']|| "http://localhost:37265/")
244
- puts "Ping #{url}..."
256
+ if FULL_CONSOLE_OUTPUT
257
+ puts "Ping #{url}..."
258
+ end
245
259
  http = Net::HTTP.new(url.host, url.port)
246
260
  res = http.start do |sess|
247
261
  sess.request Net::HTTP::Get.new url.path
@@ -260,7 +274,9 @@ module Calabash
260
274
  endpoint += "/" unless endpoint.end_with? "/"
261
275
  url = URI.parse("#{endpoint}version")
262
276
 
263
- puts "Fetch version #{url}..."
277
+ if FULL_CONSOLE_OUTPUT
278
+ puts "Fetch version #{url}..."
279
+ end
264
280
  begin
265
281
  body = Net::HTTP.get_response(url).body
266
282
  res = JSON.parse(body)
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = '0.9.140.pre2'
3
+ VERSION = '0.9.140'
4
4
  FRAMEWORK_VERSION = '0.9.139'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.140.pre2
5
- prerelease: 8
4
+ version: 0.9.140
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Karl Krukow
@@ -317,9 +317,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
317
317
  required_rubygems_version: !ruby/object:Gem::Requirement
318
318
  none: false
319
319
  requirements:
320
- - - ! '>'
320
+ - - ! '>='
321
321
  - !ruby/object:Gem::Version
322
- version: 1.3.1
322
+ version: '0'
323
323
  requirements: []
324
324
  rubyforge_project:
325
325
  rubygems_version: 1.8.23