Class: Fastlane::Actions::SlackTrainStartAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::SlackTrainStartAction
- Defined in:
- lib/fastlane/plugin/slack_train/actions/slack_train_start_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
24 25 26 |
# File 'lib/fastlane/plugin/slack_train/actions/slack_train_start_action.rb', line 24 def self. ["@KrauseFx"] end |
.available_options ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/fastlane/plugin/slack_train/actions/slack_train_start_action.rb', line 28 def self. [ FastlaneCore::ConfigItem.new(key: :distance, env_name: "SLACK_TRAIN_DISTANCE", description: "How many rails do we need?", default_value: 5, type: Integer), FastlaneCore::ConfigItem.new(key: :train, env_name: "SLACK_TRAIN_TRAIN", description: "Train emoji", default_value: "🚝", type: String), FastlaneCore::ConfigItem.new(key: :rail, env_name: "SLACK_TRAIN_RAIL", description: "Character or emoji for the rail", default_value: "=", type: String), FastlaneCore::ConfigItem.new(key: :reverse_direction, env_name: "SLACK_TRAIN_REVERSE_DIRECTION", description: "Pass true if you want the train to go from left to right", default_value: false, is_string: false) ] end |
.description ⇒ Object
20 21 22 |
# File 'lib/fastlane/plugin/slack_train/actions/slack_train_start_action.rb', line 20 def self.description "Show a train of the fastlane progress" end |
.is_supported?(platform) ⇒ Boolean
53 54 55 |
# File 'lib/fastlane/plugin/slack_train/actions/slack_train_start_action.rb', line 53 def self.is_supported?(platform) true end |
.run(params) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/fastlane/plugin/slack_train/actions/slack_train_start_action.rb', line 12 def self.run(params) lane_context[SharedValues::SLACK_TRAIN_DISTANCE] = params[:distance] lane_context[SharedValues::SLACK_TRAIN_EMOJI] = params[:train] lane_context[SharedValues::SLACK_TRAIN_RAIL] = params[:rail] lane_context[SharedValues::SLACK_TRAIN_DIRECTION] = params[:reverse_direction] ? 1 : -1 lane_context[SharedValues::SLACK_TRAIN_CURRENT_TRAIN_POSITION] = params[:reverse_direction] ? 0 : (params[:distance] - 1) end |