Class: Fastlane::Actions::VersionGetPodspecAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/version_get_podspec.rb

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, details, return_value, sh, step_text

Class Method Details

.authorsObject



41
42
43
# File 'lib/fastlane/actions/version_get_podspec.rb', line 41

def self.authors
  ["Liquidsoul", "KrauseFx"]
end

.available_optionsObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fastlane/actions/version_get_podspec.rb', line 22

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :path,
                                 env_name: "FL_VERSION_PODSPEC_PATH",
                                 description: "You must specify the path to the podspec file",
                                 is_string: true,
                                 default_value: Dir["*.podspec"].last,
                                 verify_block: proc do |value|
                                   UI.user_error!("Please pass a path to the `version_get_podspec` action") if value.length == 0
                                 end)
  ]
end

.descriptionObject



18
19
20
# File 'lib/fastlane/actions/version_get_podspec.rb', line 18

def self.description
  "Receive the version number from a podspec file"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/fastlane/actions/version_get_podspec.rb', line 45

def self.is_supported?(platform)
  true
end

.outputObject



35
36
37
38
39
# File 'lib/fastlane/actions/version_get_podspec.rb', line 35

def self.output
  [
    ['PODSPEC_VERSION_NUMBER', 'The podspec version number']
  ]
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/fastlane/actions/version_get_podspec.rb', line 4

def self.run(params)
  podspec_path = params[:path]

  UI.user_error!("Could not find podspec file at path '#{podspec_path}'") unless File.exist? podspec_path

  version_podspec_file = Helper::PodspecHelper.new(podspec_path)

  Actions.lane_context[SharedValues::PODSPEC_VERSION_NUMBER] = version_podspec_file.version_value
end