class Fastlane::Actions::FirebaseListAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/firebase/actions/firebase_list_action.rb, line 27
def self.authors
  ["Tomas Kohout"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/firebase/actions/firebase_list_action.rb, line 40
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :username,
                            env_name: "FIREBASE_USERNAME",
                         description: "Username for your google account",
                            optional: false),
    FastlaneCore::ConfigItem.new(key: :project_number,
                            env_name: "FIREBASE_PROJECT_NUMBER",
                         description: "Project number",
                            optional: true)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/firebase/actions/firebase_list_action.rb, line 23
def self.description
  "An unofficial tool to access Firebase"
end
details() click to toggle source
# File lib/fastlane/plugin/firebase/actions/firebase_list_action.rb, line 35
def self.details
  # Optional:
  "Firebase helps you list your projects, create applications, download configuration files and more..."
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/firebase/actions/firebase_list_action.rb, line 53
def self.is_supported?(platform)
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
  # See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
  #
  # [:ios, :mac, :android].include?(platform)
  true
end
return_value() click to toggle source
# File lib/fastlane/plugin/firebase/actions/firebase_list_action.rb, line 31
def self.return_value
  # If your method provides a return value, you can describe here what it does
end
run(params) click to toggle source
# File lib/fastlane/plugin/firebase/actions/firebase_list_action.rb, line 6
def self.run(params)
  manager = Firebase::Manager.new
  # Login
  api = manager.login(params[:username])

  # List projects
  projects = api.project_list()
 
  projects.each_with_index { |p, i| 
    UI.message "#{i+1}. #{p["displayName"]} (#{p["projectNumber"]})" 
    clients = p["clientSummary"] || []
    clients.sort {|left, right| left["clientId"] <=> right["clientId"] }.each_with_index { |client, j|
      UI.message "  - #{client["clientId"]} (#{client["displayName"]})" 
    } 
  }
end