Class: Fastlane::Actions::CoreVersionAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::CoreVersionAction
- Defined in:
- lib/fastlane/plugin/stream_actions/actions/core_version.rb
Documentation collapse
Class Method Summary collapse
Class Method Details
.available_options ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/fastlane/plugin/stream_actions/actions/core_version.rb', line 22 def self. [ FastlaneCore::ConfigItem.new( key: :version, description: 'Version string to normalize; nil or empty returns nil', optional: true ) ] end |
.description ⇒ Object
18 19 20 |
# File 'lib/fastlane/plugin/stream_actions/actions/core_version.rb', line 18 def self.description 'Returns major.minor.patch from a version string (e.g. 1.2.3-beta -> 1.2.3) for plist / CFBundleShortVersionString' end |
.is_supported?(platform) ⇒ Boolean
32 33 34 |
# File 'lib/fastlane/plugin/stream_actions/actions/core_version.rb', line 32 def self.is_supported?(platform) true end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/fastlane/plugin/stream_actions/actions/core_version.rb', line 4 def self.run(params) version = params[:version] return nil if version.nil? || version.to_s.strip.empty? m = version.to_s.match(/(\d+)\.(\d+)\.(\d+)/) UI.user_error!("Version must contain major.minor.patch (e.g. 1.2.3), got: #{version}") unless m "#{m[1]}.#{m[2]}.#{m[3]}" end |