class FastlaneCore::Clipboard

Public Class Methods

copy(content: nil) click to toggle source
# File fastlane_core/lib/fastlane_core/clipboard.rb, line 6
def self.copy(content: nil)
  return UI.crash!("'pbcopy' or 'pbpaste' command not found.") unless is_supported?
  Open3.popen3('pbcopy') { |input, _, _| input << content }
end
is_supported?() click to toggle source
# File fastlane_core/lib/fastlane_core/clipboard.rb, line 16
def self.is_supported?
  return `which pbcopy`.length > 0 && `which pbpaste`.length > 0
end
paste() click to toggle source
# File fastlane_core/lib/fastlane_core/clipboard.rb, line 11
def self.paste
  return UI.crash!("'pbcopy' or 'pbpaste' command not found.") unless is_supported?
  return `pbpaste`
end