Sha256: 21063ab9b6f9237ccd2f1fa74ef17fe488c06a70d207a73089c783360a8e8c8d

Contents?: true

Size: 1.85 KB

Versions: 24

Compression:

Stored size: 1.85 KB

Contents

module Fastlane
  module Actions
    class VersionGetPodspecAction < Action
      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

      #####################################################
      # @!group Documentation
      #####################################################

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

      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,
                                       verify_block: proc do |value|
                                         UI.user_error!("Please pass a path to the `version_get_podspec` action") if value.length == 0
                                       end)
        ]
      end

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

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

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

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

      def self.category
        :misc
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
fastlane-2.74.1 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.74.0 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.74.0.beta.20180108010004 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.74.0.beta.20180107010004 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.74.0.beta.20180106010004 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.73.0 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.73.0.beta.20180105010003 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.73.0.beta.20180104010004 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.73.0.beta.20180103010003 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.72.0 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.72.0.beta.20180102010003 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.72.0.beta.20180101010003 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.72.0.beta.20171231010003 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.71.1 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.72.0.beta.20171230010003 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.72.0.beta.20171229010003 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.72.0.beta.20171228010004 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.71.0 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.71.0.beta.20171227010004 fastlane/lib/fastlane/actions/version_get_podspec.rb
fastlane-2.71.0.beta.20171226010004 fastlane/lib/fastlane/actions/version_get_podspec.rb