Module: Clipboard
- Extended by:
- Clipboard
- Included in:
- Clipboard
- Defined in:
- lib/clipboard.rb,
lib/clipboard/mac.rb,
lib/clipboard/file.rb,
lib/clipboard/linux.rb,
lib/clipboard/windows.rb
Defined Under Namespace
Modules: File, Linux, Mac, Windows
Classes: ClipboardLoadError
Constant Summary
collapse
- VERSION =
File.read( (File.dirname(__FILE__) + '/../VERSION') ).chomp
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.implementation ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/clipboard.rb', line 14
def self.implementation
return @implementation if @implementation
os = case RbConfig::CONFIG['host_os']
when /mac|darwin/ then :Mac
when /linux|bsd|cygwin/ then :Linux
when /mswin|mingw/ then :Windows
else
raise ClipboardLoadError, "Your OS(#{ RbConfig::CONFIG['host_os'] }) is not supported, using file-based (fake) clipboard"
end
@implementation = Clipboard.const_get os
rescue ClipboardLoadError => e
$stderr.puts e.message if $VERBOSE
@implementation = Clipboard::File
end
|
.implementation=(val) ⇒ Object
32
33
34
|
# File 'lib/clipboard.rb', line 32
def self.implementation=(val)
@implementation = val
end
|