class Fastlane::Actions::GsSaveBetaVersionAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/gs_versioning/actions/gs_save_beta_version.rb, line 37
def self.authors
  ["SAVeselovskiy"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/gs_versioning/actions/gs_save_beta_version.rb, line 50
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :path,
                                 env_name: "GS_VERSIONS_FILE_PATH",
                                 description: "path to versions file",
                                 optional: false,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :version,
                                 env_name: "GS_APP_VERSION",
                                 description: "App version",
                                 optional: false,
                                 type: Version),
    FastlaneCore::ConfigItem.new(key: :project_name,
                                 env_name: "ALIAS",
                                 description: "project name for versions file access",
                                 optional: false,
                                 type: String)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/gs_versioning/actions/gs_save_beta_version.rb, line 33
def self.description
  "Plugin for GradoService versioning system"
end
details() click to toggle source
# File lib/fastlane/plugin/gs_versioning/actions/gs_save_beta_version.rb, line 45
def self.details
  # Optional:
  "Plugin for GradoService versioning system"
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/gs_versioning/actions/gs_save_beta_version.rb, line 70
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/gs_versioning/actions/gs_save_beta_version.rb, line 41
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/gs_versioning/actions/gs_save_beta_version.rb, line 18
def self.run(params)
  require 'json'
  jsonstr = FileHelper.read(params[:path]) # TODO: впилить проверку если не указан путь
  json = JSON.parse(jsonstr)
  UI.message(json[params[:project_name]])
  res = params[:version].toString
  UI.message("New beta version " + res)
  json[params[:project_name]]["beta"] = res
  FileHelper.write(params[:path], json.to_json)

  GSVersionApiProvider.updateVersions(params[:project_name])

  res
end