Class: Fastlane::Actions::AsciiArtAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::AsciiArtAction
- Defined in:
- lib/fastlane/plugin/ascii_art/actions/ascii_art_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
17 18 19 |
# File 'lib/fastlane/plugin/ascii_art/actions/ascii_art_action.rb', line 17 def self. ['Boris Bügling'] end |
.available_options ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fastlane/plugin/ascii_art/actions/ascii_art_action.rb', line 21 def self. [ FastlaneCore::ConfigItem.new(key: :image_path, env_name: 'ASCII_ART_IMAGE_PATH', description: 'Path or URL of the image you want to show', optional: false, type: String), FastlaneCore::ConfigItem.new(key: :width, env_name: 'ASCII_ART_WIDTH', description: "Width to use for the ASCII art, defaults to your terminal's width", optional: true, type: Fixnum) ] end |
.description ⇒ Object
13 14 15 |
# File 'lib/fastlane/plugin/ascii_art/actions/ascii_art_action.rb', line 13 def self.description 'Add some fun to your fastlane output.' end |
.is_supported?(_platform) ⇒ Boolean
36 37 38 |
# File 'lib/fastlane/plugin/ascii_art/actions/ascii_art_action.rb', line 36 def self.is_supported?(_platform) true end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/fastlane/plugin/ascii_art/actions/ascii_art_action.rb', line 4 def self.run(params) require 'asciiart' require 'io/console' a = ::AsciiArt.new(params[:image_path]) width = params[:width].nil? ? IO.console.winsize[1] - 2 : params[:width] puts a.to_ascii_art(width: width) end |