Class: DPL::Provider::TestFairy

Inherits:
DPL::Provider show all
Defined in:
lib/dpl/provider/testfairy.rb

Constant Summary collapse

VERSION =
"0.1"
TAG =
"-TestFairy-"
SERVER =
"http://api.testfairy.com"
UPLOAD_URL_PATH =
"/api/upload"
UPLOAD_SIGNED_URL_PATH =
"/api/upload-signed"

Instance Attribute Summary

Attributes inherited from DPL::Provider

#context, #options

Instance Method Summary collapse

Methods inherited from DPL::Provider

apt_get, #check_app, #cleanup, #commit_msg, context, #create_key, #deploy, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup, #user_agent, #warn

Constructor Details

This class inherits a constructor from DPL::Provider

Instance Method Details

#android?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/dpl/provider/testfairy.rb', line 42

def android?
  option(:app_file).include? "apk"
end

#check_authObject



17
18
19
20
21
22
23
24
# File 'lib/dpl/provider/testfairy.rb', line 17

def check_auth
  if android?
    storepassToPrint = option(:storepass).clone
    aliasToPrint = option(:alias).clone
    puts "keystore-file = #{option(:keystore_file)} storepass = #{storepassToPrint.sub! storepassToPrint[1..-2], '****'} alias = #{aliasToPrint.sub! aliasToPrint[1..-2], '****'}"
  end
  puts "api-key = #{option(:api_key).gsub(/[123456789]/, '*')} symbols-file = #{options[:symbols_file]}"
end

#needs_key?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/dpl/provider/testfairy.rb', line 26

def needs_key?
  false
end

#push_appObject



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/dpl/provider/testfairy.rb', line 30

def push_app
  puts "push_app #{TAG}"
  response = upload_app
  if android?
    puts response['instrumented_url']
    instrumentedFile = download_from_url response['instrumented_url']
    signedApk = signing_apk instrumentedFile
    response = upload_signed_apk signedApk
  end
  puts "Upload success!, check your build on #{response['build_url']}"
end