Class: Fastlane::Actions::PromptAction
- Inherits:
-
Fastlane::Action
- Object
- Fastlane::Action
- Fastlane::Actions::PromptAction
- Defined in:
- lib/fastlane/actions/prompt.rb
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
Class Method Summary collapse
Methods inherited from Fastlane::Action
Class Method Details
.authors ⇒ Object
49 50 51 |
# File 'lib/fastlane/actions/prompt.rb', line 49 def self. ["KrauseFx"] end |
.available_options ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/fastlane/actions/prompt.rb', line 31 def self. [ FastlaneCore::ConfigItem.new(key: :text, description: "The text that will be displayed to the user"), FastlaneCore::ConfigItem.new(key: :ci_input, description: "The default text that will be used when being executed on a CI service", default_value: ''), FastlaneCore::ConfigItem.new(key: :boolean, description: "Is that a boolean question (yes/no)? This will add (y/n) at the end", default_value: false, is_string: false) ] end |
.description ⇒ Object
20 21 22 |
# File 'lib/fastlane/actions/prompt.rb', line 20 def self.description "Ask the user for a value or for confirmation" end |
.details ⇒ Object
24 25 26 27 28 29 |
# File 'lib/fastlane/actions/prompt.rb', line 24 def self.details [ "You can use `prompt` to ask the user for a value or to just let the user confirm the next step", "When this is executed on a CI service, the passed `ci_input` value will be returned" ].join("\n") end |
.is_supported?(platform) ⇒ Boolean
53 54 55 |
# File 'lib/fastlane/actions/prompt.rb', line 53 def self.is_supported?(platform) true end |
.output ⇒ Object
45 46 47 |
# File 'lib/fastlane/actions/prompt.rb', line 45 def self.output [] end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/fastlane/actions/prompt.rb', line 4 def self.run(params) params[:text] += " (y/n)" if params[:boolean] Helper.log.info params[:text] user_input = params[:ci_input] if Helper.is_ci? user_input ||= STDIN.gets.chomp.strip user_input = (user_input.downcase == 'y') if params[:boolean] return user_input end |