y_support 2.0.8 → 2.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/y_support/all.rb +1 -0
- data/lib/y_support/version.rb +1 -1
- data/lib/y_support/x.rb +17 -0
- data/test/x_test.rb +19 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 899631a56a158e4c5486d250535886d6b57fb81f
|
4
|
+
data.tar.gz: 1aacb955e009e88ceed9a593696d5b14ecbaba96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3eedc267f3aabc24e2b74dd446ff2c66ef326664a0442a5d6fbbb969a853dce32c71f8ae1fd27d9dec9b8f7add69107711af5cd3ddde9744033752b90f5ce671
|
7
|
+
data.tar.gz: 84dde1023824155544242d81dbae07508762a369d2b41d914285942f998848dc22fc3b1676b9eb6523f5a099c4489e7238c8cbe0d0c92d2990e4456f99680669
|
data/lib/y_support/all.rb
CHANGED
data/lib/y_support/version.rb
CHANGED
data/lib/y_support/x.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'y_support'
|
2
|
+
|
3
|
+
module YSupport::X
|
4
|
+
class << self
|
5
|
+
# Echo a string to the primary X clip with `xsel -b -i`.
|
6
|
+
#
|
7
|
+
def echo_primary_clipboard( string )
|
8
|
+
system 'echo -n "' + string + '" | xsel -b -i'
|
9
|
+
end
|
10
|
+
|
11
|
+
# Echo a string to the secondary X clip with `xsel -b -i`.
|
12
|
+
#
|
13
|
+
def echo_secondary_clipboard( string )
|
14
|
+
system 'echo -n "' + string + '" | xsel -s -i'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end # module YSupport::X
|
data/test/x_test.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#! /usr/local/bin/ruby
|
2
|
+
#encoding: utf-8
|
3
|
+
|
4
|
+
require 'test/unit'
|
5
|
+
require 'shoulda'
|
6
|
+
require './../lib/y_support/x'
|
7
|
+
|
8
|
+
class XTest < Test::Unit::TestCase
|
9
|
+
context "X" do
|
10
|
+
setup do
|
11
|
+
YSupport::X.echo_primary_clipboard "hello"
|
12
|
+
YSupport::X.echo_secondary_clipboard "world"
|
13
|
+
end
|
14
|
+
|
15
|
+
should "have clipboard as expected" do
|
16
|
+
assert_equal "hello world", [`xsel -b`, `xsel -s`].join(' ')
|
17
|
+
end
|
18
|
+
end # context X
|
19
|
+
end # class XTest
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: y_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- boris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- lib/y_support/typing/object/typing.rb
|
95
95
|
- lib/y_support/unicode.rb
|
96
96
|
- lib/y_support/version.rb
|
97
|
+
- lib/y_support/x.rb
|
97
98
|
- test/abstract_algebra_test.rb
|
98
99
|
- test/conscience_test.rb
|
99
100
|
- test/inert_recorder_test.rb
|
@@ -106,6 +107,7 @@ files:
|
|
106
107
|
- test/respond_to_test.rb
|
107
108
|
- test/typing_test.rb
|
108
109
|
- test/unicode_test.rb
|
110
|
+
- test/x_test.rb
|
109
111
|
- y_support.gemspec
|
110
112
|
homepage: ''
|
111
113
|
licenses: []
|
@@ -144,3 +146,4 @@ test_files:
|
|
144
146
|
- test/respond_to_test.rb
|
145
147
|
- test/typing_test.rb
|
146
148
|
- test/unicode_test.rb
|
149
|
+
- test/x_test.rb
|