clipboard 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -3
- data/lib/clipboard.rb +9 -2
- data/lib/clipboard/version.rb +1 -1
- data/lib/clipboard/wsl.rb +20 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfc223f701d9da1f5ab36cffc1f3e9ab7cb74c9c10ef32cc1d6cfcc80eb2d226
|
4
|
+
data.tar.gz: a374f338cc2559a8b93b72f79aab9ae79d0981a289f789e437d1890d43038631
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d29498e6c3caad52203297ebf184b214c20d49d6da7507539a9f33265f5428908d750c1356d6c368713e6859ba7475e5d4ae7689a066a240782b16a1dd4d984d
|
7
|
+
data.tar.gz: ce3afab6640d5b4285e57c1f5bde531f777eb2d777aa6be61650e418fcc0a084da0b2c3b4928e47166710d8e050101e7b34f9a0afcbe929df1c9c3c7e84bea7d
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
## 1.
|
3
|
+
## 1.2.0
|
4
|
+
* Support WSL (Windows Subsystem for Linux)
|
4
5
|
|
5
|
-
|
6
|
+
## 1.1.2
|
7
|
+
* Linux: Replace calls to `which` with native check (thanks @woodruffw)
|
6
8
|
|
7
9
|
## 1.1.1
|
8
|
-
|
9
10
|
* Surpress 3rd party processes' STDERR, see #26
|
10
11
|
* Internal API changes to meet modified relaxed ruby style guidelines
|
11
12
|
|
data/lib/clipboard.rb
CHANGED
@@ -24,12 +24,19 @@ module Clipboard
|
|
24
24
|
when /linux|bsd/ then :Linux
|
25
25
|
when /mswin|mingw/ then :Windows
|
26
26
|
when /cygwin/ then :Cygwin
|
27
|
-
# when /solaris|sunos/ then :Linux # needs testing..
|
28
27
|
else
|
29
28
|
raise ClipboardLoadError, "Your OS(#{ RbConfig::CONFIG['host_os'] }) is not supported, using file-based (fake) clipboard"
|
30
29
|
end
|
31
30
|
|
32
|
-
|
31
|
+
# Running additional check to detect if running in Microsoft WSL
|
32
|
+
if os == :Linux
|
33
|
+
require "etc"
|
34
|
+
if Etc.uname[:release] =~ /Microsoft/
|
35
|
+
os = :Wsl
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
@implementation = Clipboard.const_get(os)
|
33
40
|
rescue ClipboardLoadError => e
|
34
41
|
$stderr.puts e.message if $VERBOSE
|
35
42
|
@implementation = Clipboard::File
|
data/lib/clipboard/version.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'open3'
|
2
|
+
|
3
|
+
module Clipboard
|
4
|
+
module Wsl
|
5
|
+
extend self
|
6
|
+
|
7
|
+
def paste(_ = nil)
|
8
|
+
`powershell.exe -Command Get-Clipboard`
|
9
|
+
end
|
10
|
+
|
11
|
+
def copy(data)
|
12
|
+
Open3.popen3( 'clip.exe' ){ |input, _, _| input << data }
|
13
|
+
paste
|
14
|
+
end
|
15
|
+
|
16
|
+
def clear
|
17
|
+
copy ''
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clipboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- lib/clipboard/utils.rb
|
60
60
|
- lib/clipboard/version.rb
|
61
61
|
- lib/clipboard/windows.rb
|
62
|
+
- lib/clipboard/wsl.rb
|
62
63
|
- spec/clipboard_spec.rb
|
63
64
|
- spec/spec_helper.rb
|
64
65
|
homepage: http://github.com/janlelis/clipboard
|
@@ -84,7 +85,7 @@ requirements:
|
|
84
85
|
install xclip'
|
85
86
|
- On Windows, you will need the ffi gem.
|
86
87
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.7.
|
88
|
+
rubygems_version: 2.7.7
|
88
89
|
signing_key:
|
89
90
|
specification_version: 4
|
90
91
|
summary: Access to the clipboard on Linux, MacOS, Windows, and Cygwin.
|