class Shenzhen::Plugins::TestFairy::Client
Constants
- HOSTNAME
Public Class Methods
new(api_key)
click to toggle source
# File lib/shenzhen/plugins/testfairy.rb, line 11 def initialize(api_key) @api_key = api_key @connection = Faraday.new(:url => "https://#{HOSTNAME}") do |builder| builder.request :multipart builder.request :url_encoded builder.response :json, :content_type => /\bjson$/ builder.use FaradayMiddleware::FollowRedirects builder.adapter :net_http end end
Public Instance Methods
upload_build(ipa, options) { |env, env| ... }
click to toggle source
# File lib/shenzhen/plugins/testfairy.rb, line 22 def upload_build(ipa, options) options[:file] = Faraday::UploadIO.new(ipa, 'application/octet-stream') if ipa and File.exist?(ipa) if symbols_file = options.delete(:symbols_file) options[:symbols_file] = Faraday::UploadIO.new(symbols_file, 'application/octet-stream') end @connection.post do |req| req.url("/api/upload/") req.body = options end.on_complete do |env| yield env[:status], env[:body] if block_given? end end