Class: Shenzhen::Plugins::Crashlytics::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/shenzhen/plugins/crashlytics.rb

Instance Method Summary collapse

Constructor Details

#initialize(crashlytics_path, api_token, build_secret) ⇒ Client

Returns a new instance of Client.


7
8
9
10
11
12
# 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

Instance Method Details

#upload_build(ipa, options) ⇒ Object


14
15
16
17
18
19
20
21
22
# 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