Sha256: e4ca2235fc6f371218ad760ad258b8e22a212f15d268d8a7704f3a9439c8832e

Contents?: true

Size: 953 Bytes

Versions: 6

Compression:

Stored size: 953 Bytes

Contents

require "fastlane_core"

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

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

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

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pilot-0.1.7 lib/pilot/tester_exporter.rb
pilot-0.1.6 lib/pilot/tester_exporter.rb
pilot-0.1.5 lib/pilot/tester_exporter.rb
pilot-0.1.4 lib/pilot/tester_exporter.rb
pilot-0.1.3 lib/pilot/tester_exporter.rb
pilot-0.1.2 lib/pilot/tester_exporter.rb