Module: Clipboard
- Extended by:
- Clipboard
- Included in:
- Clipboard
- Defined in:
- lib/clipboard/gtk.rb,
lib/clipboard.rb,
lib/clipboard/mac.rb,
lib/clipboard/wsl.rb,
lib/clipboard/file.rb,
lib/clipboard/java.rb,
lib/clipboard/linux.rb,
lib/clipboard/utils.rb,
lib/clipboard/cygwin.rb,
lib/clipboard/version.rb,
lib/clipboard/windows.rb
Overview
Ruby-Gnome2 based implementation Requires either the gtk3 or the gtk2 gem
Defined Under Namespace
Modules: Cygwin, File, Gtk, Java, Linux, Mac, Utils, Windows, Wsl
Classes: ClipboardLoadError
Constant Summary
collapse
- VERSION =
"1.3.6"
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.implementation ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/clipboard.rb', line 23
def self.implementation
return @implementation if @implementation
os = case RbConfig::CONFIG['host_os']
when /mac|darwin/ then :Mac
when /linux|bsd/ then :Linux
when /mswin|mingw/ then :Windows
when /cygwin/ then :Cygwin
else
raise ClipboardLoadError, "Your OS(#{ RbConfig::CONFIG['host_os'] }) is not supported, using file-based (fake) clipboard"
end
if os == :Linux
require "etc"
if Etc.respond_to?(:uname) && Etc.uname[:release] =~ /Microsoft/ os = :Wsl
end
end
@implementation = Clipboard.const_get(os)
rescue ClipboardLoadError => e
$stderr.puts e.message if $VERBOSE
@implementation = Clipboard::File
end
|
.implementation=(val) ⇒ Object
49
50
51
|
# File 'lib/clipboard.rb', line 49
def self.implementation=(val)
@implementation = val
end
|