Sha256: 4d438f00eb0f7d05e02bfd74012ab96b146ac6dc7f36106ae37510711601abf5

Contents?: true

Size: 525 Bytes

Versions: 73

Compression:

Stored size: 525 Bytes

Contents

require 'fastlane_core'
require 'open3'

module FastlaneCore
  class Clipboard
    def self.copy(content: nil)
      return UI.crash!("'pbcopy' or 'pbpaste' command not found.") unless is_supported?
      Open3.popen3('pbcopy') { |input, _, _| input << content }
    end

    def self.paste
      return UI.crash!("'pbcopy' or 'pbpaste' command not found.") unless is_supported?
      return `pbpaste`
    end

    def self.is_supported?
      return `which pbcopy`.length > 0 && `which pbpaste`.length > 0
    end
  end
end

Version data entries

73 entries across 73 versions & 4 rubygems

Version Path
fastlane-2.225.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.224.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.223.1 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.223.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.222.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.221.1 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.221.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.220.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.219.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.218.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-security-patched-2.216.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.217.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.216.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.215.1 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.215.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-mercafacil-2.214.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.214.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.213.0 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane-2.212.2 fastlane_core/lib/fastlane_core/clipboard.rb
fastlane_pricing_fix-2.212.1 fastlane_core/lib/fastlane_core/clipboard.rb