class XCJobs::Distribute::TestFlight

Attributes

api_token[RW]
distribution_lists[RW]
file[RW]
notes[RW]
notify[RW]
replace[RW]
team_token[RW]

Public Class Methods

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

Private Instance Methods

define() click to toggle source
# File lib/xcjobs/distribute.rb, line 56
def define
  namespace :distribute do
    desc 'upload IPA to TestFlight'
    task :testflight do
      upload('http://testflightapp.com/api/builds.json', form_data)
    end
  end
end
form_data() click to toggle source
# File lib/xcjobs/distribute.rb, line 65
def form_data
  {}.tap do |fields|
    fields[:file] = "@#{file}" if file
    fields[:api_token] = api_token if api_token
    fields[:team_token] = team_token if team_token
    fields[:notify] = notify if notify
    fields[:replace] = replace if replace
    fields[:distribution_lists] = distribution_lists if distribution_lists
    fields[:notes] = notes if notes
  end
end