class Shenzhen::Plugins::Crashlytics::Client

Public Class Methods

new(crashlytics_path, api_token, build_secret) click to toggle source
# File lib/shenzhen/plugins/crashlytics.rb, line 7
def initialize(crashlytics_path, api_token, build_secret)
  @api_token, @build_secret = api_token, build_secret

  @crashlytics_path = Pathname.new("#{crashlytics_path}/submit").cleanpath.to_s
  say_error "Path to Crashlytics.framework/submit is invalid" and abort unless File.exists?(@crashlytics_path)
end

Public Instance Methods

upload_build(ipa, options) click to toggle source
# File lib/shenzhen/plugins/crashlytics.rb, line 14
def upload_build(ipa, options)
  command = "#{@crashlytics_path} #{@api_token} #{@build_secret} -ipaPath '#{options[:file]}'"
  command += " -notesPath '#{options[:notes]}'" if options[:notes]
  command += " -emails #{options[:emails]}" if options[:emails]
  command += " -groupAliases #{options[:groups]}" if options[:groups]
  command += " -notifications #{options[:notifications] ? 'YES' : 'NO'}"

  system command
end