class Fastlane::Actions::ClipboardAction

Public Class Methods

authors() click to toggle source
# File fastlane/lib/fastlane/actions/clipboard.rb, line 29
def self.authors
  ["KrauseFx", "joshdholtz", "rogerluan"]
end
available_options() click to toggle source
# File fastlane/lib/fastlane/actions/clipboard.rb, line 21
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :value,
                                 env_name: "FL_CLIPBOARD_VALUE",
                                 description: "The string that should be copied into the clipboard")
  ]
end
category() click to toggle source
# File fastlane/lib/fastlane/actions/clipboard.rb, line 44
def self.category
  :misc
end
description() click to toggle source

@!group Documentation

# File fastlane/lib/fastlane/actions/clipboard.rb, line 17
def self.description
  "Copies a given string into the clipboard. Works only on macOS"
end
example_code() click to toggle source
# File fastlane/lib/fastlane/actions/clipboard.rb, line 37
def self.example_code
  [
    'clipboard(value: "https://docs.fastlane.tools/")',
    'clipboard(value: lane_context[SharedValues::HOCKEY_DOWNLOAD_LINK] || "")'
  ]
end
is_supported?(platform) click to toggle source
# File fastlane/lib/fastlane/actions/clipboard.rb, line 33
def self.is_supported?(platform)
  FastlaneCore::Clipboard.is_supported?
end
run(params) click to toggle source
# File fastlane/lib/fastlane/actions/clipboard.rb, line 4
def self.run(params)
  value = params[:value]

  truncated_value = value[0..800].gsub(/\s\w+\s*$/, '...')
  UI.message("Storing '#{truncated_value}' in the clipboard 🎨")

  FastlaneCore::Clipboard.copy(content: value)
end