Sha256: 218dc1a65ce4b49acfdb510a7b4b67abfbe8633fa5b726f2b979f093cfad7459

Contents?: true

Size: 1.09 KB

Versions: 10

Compression:

Stored size: 1.09 KB

Contents

require "fastlane_core"
require "pilot/tester_util"

module Pilot
  class TesterExporter < Manager
    def export_testers(options)
      raise "Export file path is required".red unless options[:testers_file_path]

      start(options)
      require 'csv'

      testers = Spaceship::Tunes::Tester::External.all

      file = config[:testers_file_path]

      CSV.open(file, "w") do |csv|
        csv << ['First', 'Last', 'Email', 'Devices', 'Groups', 'Installed Version', 'Install Date']

        testers.each do |tester|
          groups = tester.raw_data.get("groups")

          group_names = ""
          if groups && groups.length > 0
            names = groups.map { |group| group["name"]["value"] }
            group_names = names.join(';')
          end

          install_version = tester.full_version || ""
          pretty_date = tester.pretty_install_date || ""

          csv << [tester.first_name, tester.last_name, tester.email, tester.devices.count, group_names, install_version, pretty_date]
        end

        Helper.log.info "Successfully exported CSV to #{file}".green
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pilot-1.2.1 lib/pilot/tester_exporter.rb
pilot-1.2.0 lib/pilot/tester_exporter.rb
pilot-1.1.0 lib/pilot/tester_exporter.rb
pilot-1.0.1 lib/pilot/tester_exporter.rb
pilot-1.0.0 lib/pilot/tester_exporter.rb
pilot-0.3.0 lib/pilot/tester_exporter.rb
pilot-0.2.3 lib/pilot/tester_exporter.rb
pilot-0.2.2 lib/pilot/tester_exporter.rb
pilot-0.2.1 lib/pilot/tester_exporter.rb
pilot-0.2.0 lib/pilot/tester_exporter.rb