Class: Fastlane::Actions::ReadVersionAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::ReadVersionAction
- Defined in:
- lib/fastlane/plugin/version_manager/actions/read_version_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
37 38 39 |
# File 'lib/fastlane/plugin/version_manager/actions/read_version_action.rb', line 37 def self. ["Ibrahim AshShohail"] end |
.available_options ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/fastlane/plugin/version_manager/actions/read_version_action.rb', line 52 def self. [ FastlaneCore::ConfigItem.new( key: :pubspec, env_name: 'PUBSPEC', description: 'The path of pubspec.yml file', optional: true, type: String, default_value: './pubspec.yaml' ), ] end |
.description ⇒ Object
33 34 35 |
# File 'lib/fastlane/plugin/version_manager/actions/read_version_action.rb', line 33 def self.description "Version manager" end |
.details ⇒ Object
48 49 50 |
# File 'lib/fastlane/plugin/version_manager/actions/read_version_action.rb', line 48 def self.details "Version manager" end |
.is_supported?(platform) ⇒ Boolean
65 66 67 |
# File 'lib/fastlane/plugin/version_manager/actions/read_version_action.rb', line 65 def self.is_supported?(platform) true end |
.return_value ⇒ Object
41 42 43 44 45 46 |
# File 'lib/fastlane/plugin/version_manager/actions/read_version_action.rb', line 41 def self.return_value [ ['VERSION_NUMBER', 'The version number'], ['BUILD_NUMBER', 'The build number'], ] end |
.run(params) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fastlane/plugin/version_manager/actions/read_version_action.rb', line 7 def self.run(params) pubspec_file = params[:pubspec] begin pubspec = YAML.load_file(pubspec_file) # rubocop:disable Style/RescueStandardError rescue raise 'Failed to read pubspec.yaml' end v = SemVersion.new(pubspec['version']) UI.('Version is: '.dup.concat(v.to_s)) version_number = Helper::VersionManagerHelper.version(v) build_number = v. UI.('The version is: '.dup.concat(version_number)) UI.('The build number is: '.dup.concat(build_number)) { 'version_number' => version_number, 'build_number' => build_number } end |