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, #default_text_charset, #default_text_charset?, #deploy, deprecated, #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)


44
45
46
# File 'lib/dpl/provider/testfairy.rb', line 44

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

#check_authObject



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

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)


28
29
30
# File 'lib/dpl/provider/testfairy.rb', line 28

def needs_key?
  false
end

#push_appObject



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

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