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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d492494b1cf15742c2b407f187e650850633102c
4
- data.tar.gz: e6c2136adbdd92e76f0b7231e73745536d903690
3
+ metadata.gz: 899631a56a158e4c5486d250535886d6b57fb81f
4
+ data.tar.gz: 1aacb955e009e88ceed9a593696d5b14ecbaba96
5
5
  SHA512:
6
- metadata.gz: b48bb642dfd998952c56e5156ee432de0326847b35073a13f5fddde7666ba8d50932a22d10183b4c9a39b46648a43d73357133a3464763733a0f20c3efa481d1
7
- data.tar.gz: 3564cbb4e43fd0a91d3aebf95336f9ff4b21392d341c99aa92d192406e443cbb597e1757eee97f69abdd1ca3f76a2cf46407d963c62fa0bcea293417d9e08c38
6
+ metadata.gz: 3eedc267f3aabc24e2b74dd446ff2c66ef326664a0442a5d6fbbb969a853dce32c71f8ae1fd27d9dec9b8f7add69107711af5cd3ddde9744033752b90f5ce671
7
+ data.tar.gz: 84dde1023824155544242d81dbae07508762a369d2b41d914285942f998848dc22fc3b1676b9eb6523f5a099c4489e7238c8cbe0d0c92d2990e4456f99680669
data/lib/y_support/all.rb CHANGED
@@ -10,6 +10,7 @@ require 'y_support/inert_recorder'
10
10
  require 'y_support/local_object'
11
11
  require 'y_support/abstract_algebra'
12
12
  require 'y_support/kde'
13
+ require 'y_support/x'
13
14
  require 'y_support/misc'
14
15
 
15
16
 
@@ -1,3 +1,3 @@
1
1
  module YSupport
2
- VERSION = "2.0.8"
2
+ VERSION = "2.0.9"
3
3
  end
@@ -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.8
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-04 00:00:00.000000000 Z
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