class XCJobs::Distribute::HockeyApp

Attributes

build_server_url[RW]
commit_sha[RW]
dsym[RW]
file[RW]
identifier[RW]
mandatory[RW]
notes[RW]
notes_type[RW]
notify[RW]
repository_url[RW]
status[RW]
tags[RW]
teams[RW]
token[RW]
users[RW]

Public Class Methods

new() { |self| ... } click to toggle source
# File lib/xcjobs/distribute.rb, line 199
def initialize()
  yield self if block_given?
  define
end

Private Instance Methods

define() click to toggle source
# File lib/xcjobs/distribute.rb, line 206
def define
  namespace :distribute do
    desc 'upload IPA & dSYMs to HockeyApp'
    task :hockeyapp do
      upload("https://rink.hockeyapp.net/api/2/apps/#{identifier}/app_versions/upload", form_data, header)
    end
  end
end
form_data() click to toggle source
# File lib/xcjobs/distribute.rb, line 215
def form_data
  {}.tap do |fields|
    fields[:ipa] = "@#{file}" if file
    fields[:dsym] = "@#{dsym}" if dsym
    fields[:notes] = notes if notes
    fields[:notes_type] = notes_type if notes_type
    fields[:notify] = notify if notify
    fields[:status] = status if status
    fields[:tags] = tags.join(',') if tags
    fields[:teams] = teams.join(',') if teams
    fields[:users] = users.join(',') if users
    fields[:mandatory] = mandatory if mandatory
    fields[:commit_sha] = commit_sha if commit_sha
    fields[:build_server_url] = build_server_url if build_server_url
    fields[:repository_url] = repository_url if repository_url
  end
end
header() click to toggle source
# File lib/xcjobs/distribute.rb, line 233
def header
  {}.tap do |fields|
    fields["X-HockeyAppToken"] = token if token
  end
end