Class: FastlaneCraft::InfoPlistController
- Inherits:
-
Object
- Object
- FastlaneCraft::InfoPlistController
- Includes:
- Gem
- Defined in:
- lib/fastlane-craft/info_plist_controller.rb
Instance Method Summary collapse
- #build_version ⇒ Object
- #bump_build_version_patch ⇒ Object
-
#initialize(info_plist, extra_info_plists = []) ⇒ InfoPlistController
constructor
A new instance of InfoPlistController.
- #set_build_version(version) ⇒ Object
- #set_version(version) ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(info_plist, extra_info_plists = []) ⇒ InfoPlistController
Returns a new instance of InfoPlistController.
7 8 9 10 11 12 13 |
# File 'lib/fastlane-craft/info_plist_controller.rb', line 7 def initialize(info_plist, extra_info_plists = []) raise 'Invalid Info Plist Path' unless File.file?(info_plist) raise 'Invalid Extra Info Plists Paths' unless extra_info_plists.all? { |p| File.file?(p) } @info_plist = info_plist @extra_info_plists = extra_info_plists end |
Instance Method Details
#build_version ⇒ Object
38 39 40 41 |
# File 'lib/fastlane-craft/info_plist_controller.rb', line 38 def build_version value = plist_value_for(@info_plist, build_version_key) Version.new(value) end |
#bump_build_version_patch ⇒ Object
15 16 17 18 19 |
# File 'lib/fastlane-craft/info_plist_controller.rb', line 15 def bump_build_version_patch value = build_version.to_s value[-1] = (value[-1].to_i + 1).to_s set_build_version(Version.new(value)) end |
#set_build_version(version) ⇒ Object
27 28 29 30 31 |
# File 'lib/fastlane-craft/info_plist_controller.rb', line 27 def set_build_version(version) info_plists.each do |path| set_plist_value_for(path, version.to_s, build_version_key) end end |
#set_version(version) ⇒ Object
21 22 23 24 25 |
# File 'lib/fastlane-craft/info_plist_controller.rb', line 21 def set_version(version) info_plists.each do |path| set_plist_value_for(path, version.to_s, version_key) end end |
#version ⇒ Object
33 34 35 36 |
# File 'lib/fastlane-craft/info_plist_controller.rb', line 33 def version value = plist_value_for(@info_plist, version_key) Version.new(value) end |