calabash-android 0.5.13.pre1 → 0.5.14
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96c1911188f20f232889ba00d5e2123b3d9b2bc8
|
4
|
+
data.tar.gz: dd293371094b4de6770ad1379e3bd43b2660f6a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbeebcbeb4ba2938adb07f4678e2eca1854d23af8f60d3088a31cb3ccf54e4d3bd13d06c128b4075dc54711ad26ad7f9190ff4a9a304ac38fd6497e302b85e2a
|
7
|
+
data.tar.gz: 0cd1b8f01157537924397b90a21ca535a96fe93b7bbb22ff808606cc2d479478b71473d4d760afdb79607d9c27959b9cfe6f01d8103601adf58dd9eb8ad44d17
|
Binary file
|
@@ -397,6 +397,25 @@ module Calabash module Android
|
|
397
397
|
end
|
398
398
|
end
|
399
399
|
|
400
|
+
def http_put(path, data = {}, options = {})
|
401
|
+
begin
|
402
|
+
|
403
|
+
configure_http(@http, options)
|
404
|
+
make_http_request(
|
405
|
+
:method => :put,
|
406
|
+
:body => data,
|
407
|
+
:uri => url_for(path),
|
408
|
+
:header => {"Content-Type" => "application/octet-stream"})
|
409
|
+
|
410
|
+
rescue HTTPClient::TimeoutError,
|
411
|
+
HTTPClient::KeepAliveDisconnected,
|
412
|
+
Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::ECONNABORTED,
|
413
|
+
Errno::ETIMEDOUT => e
|
414
|
+
log "It looks like your app is no longer running. \nIt could be because of a crash or because your test script shut it down."
|
415
|
+
raise e
|
416
|
+
end
|
417
|
+
end
|
418
|
+
|
400
419
|
def set_http(http)
|
401
420
|
@http = http
|
402
421
|
end
|
@@ -427,6 +446,8 @@ module Calabash module Android
|
|
427
446
|
|
428
447
|
response = if options[:method] == :post
|
429
448
|
@http.post(options[:uri], options)
|
449
|
+
elsif options[:method] == :put
|
450
|
+
@http.put(options[:uri], options)
|
430
451
|
else
|
431
452
|
@http.get(options[:uri], options)
|
432
453
|
end
|
@@ -845,6 +866,24 @@ module Calabash module Android
|
|
845
866
|
default_device.http(path, data, options)
|
846
867
|
end
|
847
868
|
|
869
|
+
def http_put(path, data = {}, options = {})
|
870
|
+
default_device.http_put(path, data, options)
|
871
|
+
end
|
872
|
+
|
873
|
+
# @return [String] The path of the uploaded file on the device
|
874
|
+
def upload_file(file_path)
|
875
|
+
name = File.basename(file_path)
|
876
|
+
device_tmp_path = http_put('/add-file', File.binread(file_path))
|
877
|
+
http('/move-cache-file-to-public', {from: device_tmp_path, name: name})
|
878
|
+
end
|
879
|
+
|
880
|
+
# @param [String] file_path Path of the file to load (.apk or .jar)
|
881
|
+
# @param [Array<String>] classes A list of classes to load from the file
|
882
|
+
def load_dylib(file_path, classes = [])
|
883
|
+
uploaded_file = upload_file(file_path)
|
884
|
+
http('/load-dylib', {path: uploaded_file, classes: classes})
|
885
|
+
end
|
886
|
+
|
848
887
|
def html(q)
|
849
888
|
query(q).map {|e| e['html']}
|
850
889
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calabash-android
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Maturana Larsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -265,9 +265,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
265
265
|
version: '0'
|
266
266
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
267
|
requirements:
|
268
|
-
- - '
|
268
|
+
- - '>='
|
269
269
|
- !ruby/object:Gem::Version
|
270
|
-
version:
|
270
|
+
version: '0'
|
271
271
|
requirements: []
|
272
272
|
rubyforge_project:
|
273
273
|
rubygems_version: 2.0.2
|