Sha256: 52e690dde934b7b429a84b628bef12563d99e3f1f353f04d352be9f6a5477215
Contents?: true
Size: 1.36 KB
Versions: 3
Compression:
Stored size: 1.36 KB
Contents
module Pantograph module Actions class ClipboardAction < Action def self.run(params) value = params[:value] truncated_value = value[0..800].gsub(/\s\w+\s*$/, '...') UI.message("Storing '#{truncated_value}' in the clipboard 🎨") if PantographCore::Helper.mac? require 'open3' Open3.popen3('pbcopy') { |input, _, _| input << value } end end ##################################################### # @!group Documentation ##################################################### def self.description "Copies a given string into the clipboard. Works only on macOS" end def self.available_options [ PantographCore::ConfigItem.new(key: :value, env_name: "FL_CLIPBOARD_VALUE", description: "The string that should be copied into the clipboard") ] end def self.authors ["KrauseFx", "joshdholtz"] end def self.is_supported?(platform) true end def self.example_code [ 'clipboard(value: "https://johnknapprs.github.io/pantograph/")', 'clipboard(value: lane_context[SharedValues::HOCKEY_DOWNLOAD_LINK] || "")' ] end def self.category :misc end end end end
Version data entries
3 entries across 3 versions & 1 rubygems