Class: Fastlane::Actions::FarolSetVersionAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/farol/actions/farol_set_version_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



17
18
19
# File 'lib/fastlane/plugin/farol/actions/farol_set_version_action.rb', line 17

def self.authors
  ["Felipe Plets"]
end

.available_optionsObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fastlane/plugin/farol/actions/farol_set_version_action.rb', line 30

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :token,
                            env_name: "TOKEN",
                         description: "The token for your Farol App",
                            optional: false,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :platform,
                            env_name: "PLATFORM",
                         description: "The platform you want to get the version",
                            optional: false,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :version,
                            env_name: "VERSION",
                         description: "The new version for your app",
                            optional: false,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :build,
                            env_name: "BUILD",
                         description: "The new build number for your app",
                            optional: false,
                                type: Numeric)
  ]
end

.descriptionObject



13
14
15
# File 'lib/fastlane/plugin/farol/actions/farol_set_version_action.rb', line 13

def self.description
  "Enable your app to use Farol Platform services"
end

.detailsObject



25
26
27
28
# File 'lib/fastlane/plugin/farol/actions/farol_set_version_action.rb', line 25

def self.details
  # Optional:
  "Integrate your app with the Farol Platform using services like push notifications"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
58
59
60
61
# File 'lib/fastlane/plugin/farol/actions/farol_set_version_action.rb', line 55

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_valueObject



21
22
23
# File 'lib/fastlane/plugin/farol/actions/farol_set_version_action.rb', line 21

def self.return_value
  # If your method provides a return value, you can describe here what it does
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/fastlane/plugin/farol/actions/farol_set_version_action.rb', line 4

def self.run(params)
  api = Farol::Api.new
  token = params[:token]
  verb = 'post'
  method = 'app/version/' + params[:platform]
  form_data = { "version" => params[:version], "build" => params[:build] }
  api.request(token, verb, method, form_data)
end