Class: Fastlane::Actions::GetXcconfigValueAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::GetXcconfigValueAction
- Defined in:
- lib/fastlane/plugin/xcconfig/actions/get_xcconfig_value_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
21 22 23 |
# File 'lib/fastlane/plugin/xcconfig/actions/get_xcconfig_value_action.rb', line 21 def self. ['Sergii Ovcharenko'] end |
.available_options ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fastlane/plugin/xcconfig/actions/get_xcconfig_value_action.rb', line 33 def self. [ FastlaneCore::ConfigItem.new(key: :name, env_name: "XCCP_GET_VALUE_PARAM_NAME", description: "Name of key in xcconfig file", type: String, optional: false), FastlaneCore::ConfigItem.new(key: :path, env_name: "XCCP_GET_VALUE_PARAM_PATH", description: "Path to plist file you want to update", type: String, optional: false, verify_block: proc do |value| UI.user_error!("Couldn't find xcconfig file at path '#{value}'") unless File.exist?(File.(value)) end) ] end |
.description ⇒ Object
17 18 19 |
# File 'lib/fastlane/plugin/xcconfig/actions/get_xcconfig_value_action.rb', line 17 def self.description 'Reads a value of a setting from xcconfig file.' end |
.details ⇒ Object
29 30 31 |
# File 'lib/fastlane/plugin/xcconfig/actions/get_xcconfig_value_action.rb', line 29 def self.details 'This action reads the value of a given setting from a given xcconfig file. Will throw an error if specified setting doesn\'t exist' end |
.is_supported?(platform) ⇒ Boolean
51 52 53 |
# File 'lib/fastlane/plugin/xcconfig/actions/get_xcconfig_value_action.rb', line 51 def self.is_supported?(platform) true end |
.return_value ⇒ Object
25 26 27 |
# File 'lib/fastlane/plugin/xcconfig/actions/get_xcconfig_value_action.rb', line 25 def self.return_value 'Value of a setting.' end |
.run(params) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/fastlane/plugin/xcconfig/actions/get_xcconfig_value_action.rb', line 7 def self.run(params) path = File.(params[:path]) File.read(path).lines.each do |line| name, value = Helper::XcconfigHelper.parse_xcconfig_name_value_line(line) return value if name == params[:name] end Fastlane::UI.user_error!("Couldn't read '#{params[:name]}' from #{params[:path]}.") end |