Class: Fastlane::Actions::VersionGetPodspecAction

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

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, deprecated_notes, details, lane_context, method_missing, other_action, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorsObject



48
49
50
# File 'fastlane/lib/fastlane/actions/version_get_podspec.rb', line 48

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

.available_optionsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'fastlane/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,
                                 code_gen_sensitive: true,
                                 default_value: Dir["*.podspec"].last,
                                 default_value_dynamic: true,
                                 verify_block: proc do |value|
                                   UI.user_error!("Please pass a path to the `version_get_podspec` action") if value.length == 0
                                 end),
    FastlaneCore::ConfigItem.new(key: :require_variable_prefix,
                                 env_name: "FL_VERSION_BUMP_PODSPEC_VERSION_REQUIRE_VARIABLE_PREFIX",
                                 description: "true by default, this is used for non CocoaPods version bumps only",
                                 is_string: false,
                                 default_value: true)
  ]
end

.categoryObject



62
63
64
# File 'fastlane/lib/fastlane/actions/version_get_podspec.rb', line 62

def self.category
  :misc
end

.descriptionObject



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

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

.example_codeObject



56
57
58
59
60
# File 'fastlane/lib/fastlane/actions/version_get_podspec.rb', line 56

def self.example_code
  [
    'version = version_get_podspec(path: "TSMessages.podspec")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



52
53
54
# File 'fastlane/lib/fastlane/actions/version_get_podspec.rb', line 52

def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end

.outputObject



42
43
44
45
46
# File 'fastlane/lib/fastlane/actions/version_get_podspec.rb', line 42

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

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'fastlane/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, params[:require_variable_prefix])

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