clipboard 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 44d254172766eccb8380131b4a5a08ec01eb57c6
4
+ data.tar.gz: 304975e97da154b601a0567ad0445d0ae1d7dff3
5
+ SHA512:
6
+ metadata.gz: 2b22b5d1a9e0ef54e29d9156e0ae3e3d78d0b0e619eaf5fa12e6d5e5dc1fdc123b1d98083714b0007eab5907c77b7b151459ca8af787d0e01f6025e9ab6220af
7
+ data.tar.gz: 5304e58c2fce95c5e7b6852a7be23dfe01cf2beca55ee08a08e18693e30209c4cd3dc9aaedb49724e6545d142cfbd17caab8de96a979b36effda325cc308247d
@@ -1,3 +1,6 @@
1
+ == 1.0.6
2
+ * Improve Linux xsel support #17
3
+
1
4
  == 1.0.5
2
5
  * Windows 1.9 multibyte support
3
6
 
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ platforms :rbx do
6
+ gem 'rubysl-singleton', '~> 2.0'
7
+ end
@@ -1,21 +1,27 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clipboard (1.0.5)
4
+ clipboard (1.0.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- diff-lcs (1.2.4)
10
- rake (10.0.4)
11
- rspec (2.13.0)
12
- rspec-core (~> 2.13.0)
13
- rspec-expectations (~> 2.13.0)
14
- rspec-mocks (~> 2.13.0)
15
- rspec-core (2.13.1)
16
- rspec-expectations (2.13.0)
17
- diff-lcs (>= 1.1.3, < 2.0)
18
- rspec-mocks (2.13.1)
9
+ diff-lcs (1.2.5)
10
+ rake (10.4.2)
11
+ rspec (3.2.0)
12
+ rspec-core (~> 3.2.0)
13
+ rspec-expectations (~> 3.2.0)
14
+ rspec-mocks (~> 3.2.0)
15
+ rspec-core (3.2.0)
16
+ rspec-support (~> 3.2.0)
17
+ rspec-expectations (3.2.0)
18
+ diff-lcs (>= 1.2.0, < 2.0)
19
+ rspec-support (~> 3.2.0)
20
+ rspec-mocks (3.2.0)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.2.0)
23
+ rspec-support (3.2.1)
24
+ rubysl-singleton (2.0.0)
19
25
 
20
26
  PLATFORMS
21
27
  ruby
@@ -24,3 +30,4 @@ DEPENDENCIES
24
30
  clipboard!
25
31
  rake
26
32
  rspec (>= 2)
33
+ rubysl-singleton (~> 2.0)
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2013 Jan Lelis
1
+ Copyright (c) 2010-2015 Jan Lelis
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
1
1
  = clipboard {<img src="https://travis-ci.org/janlelis/clipboard.png" />}[https://travis-ci.org/janlelis/clipboard]
2
- Access the clipboard and do not care if the OS is Linux, MacOS or Windows.
2
+ Lets you access the clipboard on Linux, MacOS or Windows.
3
3
 
4
4
  === Usage
5
5
  * <tt>Clipboard.copy</tt>
@@ -8,14 +8,17 @@ Access the clipboard and do not care if the OS is Linux, MacOS or Windows.
8
8
 
9
9
  == Remarks
10
10
 
11
+ === Non-gem Requirements
12
+ * *Linux*: +xclip+ or +xsel+, you can install it on debian/ubuntu with <tt>sudo apt-get install xclip</tt>
13
+
14
+ ==== ffi Dependency
15
+ This gem depends on the *ffi* gem to support the Windows clipboard. Since *ffi* requires native support, it cannot be installed on evevry platform and is not a hard dependency. If you need Windows support, you will need to put the *ffi* gem into your Gemfile.
16
+
11
17
  ==== Multiple Clipboards
12
- On Linux, you can choose from which clipboard you want to +paste+ by supplying an argumument, the default is CLIPBOARD.
18
+ On Linux, you can choose from which clipboard you want to +paste+ by passing it as an argumument. The default is CLIPBOARD.
13
19
 
14
20
  +copy+ copies to all clipboards in Clipboard::CLIPBOARDS.
15
21
 
16
- ==== ffi Dependency
17
- This gem depends on the ffi gem to support the Windows clipboard. However, since ffi is not plain Ruby, it cannot be installed in every Ruby environment and therefore, ffi is not a hard dependency of this gem. To ensure Windows compatibility, you can put the ffi gem in your Gemfile.
18
-
19
22
  ==== Windows Encoding
20
23
  If you paste with 1.9, the clipboard encoding will be translated to your <tt>Encoding.default_external</tt>.
21
24
 
@@ -23,26 +26,17 @@ If you paste with 1.8, it will fallback to CP850 encoding.
23
26
  Copying with 1.8 will fallback to the +clip+ utility, which is installed by default since Vista
24
27
 
25
28
  ==== SSH
26
- To use the clipboard through ssh, you need to install <tt>xauth</tt> on your server and connect via <tt>ssh -X</tt> or <tt>ssh -Y</tt>. However, some server settings restrict that feature, so don't rely on it, untested.
29
+ To use the clipboard through ssh, you need to install <tt>xauth</tt> on your server and connect via <tt>ssh -X</tt> or <tt>ssh -Y</tt>. Please note that some server settings restrict this feature.
27
30
 
28
31
  ==== Java
29
- There is a java implementation included (<tt>Clipboard::Java</tt>) as an option for JRuby. However, on Linux, it always operates (only) on the CLIPBOARD clipboard.
30
-
31
- === Non-gem Requirements
32
- * *Linux*: +xclip+ or +xsel+, you can install it on debian/ubuntu with <tt>sudo apt-get install xclip</tt>
32
+ There is a Java implementation included (<tt>Clipboard::Java</tt>) as an option for JRuby. However, on Linux, it always operates only on the CLIPBOARD clipboard.
33
33
 
34
34
  === TODO
35
35
  * Don't depend on +xclip+/+xsel+ (no plans to implement it, though)
36
36
 
37
37
  === blip
38
- Want to access the clipboard form the command line? Try {blip}[http://rubygems.org/gems/blip]!
39
38
 
40
- === Copyright
41
- Copyright (c) 2010-2013 Jan Lelis <http://happycode.org> released under the MIT license
39
+ *blip* is a handy commandline wrapper that lets you quickly copy file content to your clipboard: {blip}[http://rubygems.org/gems/blip]!
42
40
 
43
- Contributions by and thanks to
44
- * Michael Grosser
45
-
46
- See https://github.com/janlelis/clipboard/graphs/contributors for full list!
47
-
48
- J-_-L
41
+ === Copyright
42
+ Copyright (c) 2010-2015 Jan Lelis <http://janlelis.de> released under the MIT license. Contributions by and thanks to Michael Grosser and {all the other contributors!}[https://github.com/janlelis/clipboard/graphs/contributors]
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ end
21
21
 
22
22
  desc "Install the gem locally (without docs)"
23
23
  task :install => :gem do
24
- sh %{gem install pkg/#{gemspec.name}-#{gemspec.version} --no-rdoc --no-ri}
24
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}.gem --no-rdoc --no-ri}
25
25
  end
26
26
 
27
27
  desc "Generate the gemspec"
@@ -13,19 +13,9 @@ Gem::Specification.new do |s|
13
13
  s.description = 'Easy access to the clipboard on Linux, MacOS and Windows (Clipboard.copy & Clipboard.paste).'
14
14
  s.email = 'mail@janlelis.de'
15
15
  s.homepage = %q{http://github.com/janlelis/clipboard}
16
- s.requirements = ["On Linux (or other X), you need xclip. You can install it on debian/ubuntu with: sudo apt-get install xclip"]
17
- s.requirements += ["On Windows, you need the ffi gem."]
18
- s.files = Dir.glob(%w[{lib,spec}/**/*.rb [A-Z]* [A-Z]*.rdoc]) + %w{clipboard.gemspec .gemtest}
16
+ s.requirements = ["On Linux (or other X), you will need xclip. You can install it on debian/ubuntu with: sudo apt-get install xclip"]
17
+ s.requirements += ["On Windows, you will need the ffi gem."]
18
+ s.files = Dir.glob(%w[{lib,spec}/**/*.rb [A-Z]* [A-Z]*.rdoc]) + %w{clipboard.gemspec}
19
19
  s.add_development_dependency 'rake'
20
20
  s.add_development_dependency 'rspec', '>=2'
21
-
22
- len = s.homepage.size
23
- s.post_install_message = \
24
- (" ┌── " + "info ".ljust(len-2,'%') + "─┐\n" +
25
- " J-_-L │ " + s.homepage + " │\n" +
26
- " ├── " + "usage ".ljust(len-2,'%') + "─┤\n" +
27
- " │ " + "require 'clipboard'".ljust(len,' ') + " │\n" +
28
- " │ " + "Clipboard.copy '42'".ljust(len,' ') + " │\n" +
29
- " │ " + "Clipboard.paste #=> 42".ljust(len,' ') + " │\n" +
30
- " └─" + '─'*len + "─┘").gsub('%', '─') # 1.8 workaround
31
21
  end
@@ -13,7 +13,7 @@ module Clipboard::Linux
13
13
  ReadCommand = 'xclip -o'
14
14
  Selection = proc{|x| "-selection #{x}"}
15
15
  elsif system('which xsel >/dev/null 2>&1')
16
- WriteCommand = 'xsel'
16
+ WriteCommand = 'xsel -i'
17
17
  ReadCommand = 'xsel -o'
18
18
  Selection = {'clipboard' => '-b', 'primary' => '-p', 'secondary' => '-s'}
19
19
  else
@@ -1,3 +1,3 @@
1
1
  module Clipboard
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
@@ -5,36 +5,37 @@ require File.expand_path('spec/spec_helper')
5
5
 
6
6
  $os = RbConfig::CONFIG['host_os']
7
7
 
8
+
8
9
  describe Clipboard do
9
10
  before do
10
11
  RbConfig::CONFIG['host_os'] = $os
11
12
  end
12
13
 
13
14
  it "has a VERSION" do
14
- Clipboard::VERSION.should =~ /^\d+\.\d+\.\d+$/
15
+ expect( Clipboard::VERSION ).to match /^\d+\.\d+\.\d+$/
15
16
  end
16
17
 
17
18
  it "can copy & paste" do
18
19
  Clipboard.copy("FOO\nBAR")
19
- Clipboard.paste.should == "FOO\nBAR"
20
+ expect( Clipboard.paste ).to eq "FOO\nBAR"
20
21
  end
21
22
 
22
23
  if RUBY_VERSION >= "1.9"
23
24
  it "can copy & paste with multibyte char" do
24
25
  Encoding.default_external = "utf-8"
25
26
  Clipboard.copy("日本語")
26
- Clipboard.paste.should == "日本語"
27
+ expect( Clipboard.paste ).to eq "日本語"
27
28
  end
28
29
  end
29
30
 
30
31
  it "returns data on copy" do
31
- Clipboard.copy('xxx').should == 'xxx'
32
+ expect( Clipboard.copy('xxx') ).to eq 'xxx'
32
33
  end
33
34
 
34
35
  it "can clear" do
35
36
  Clipboard.copy('xxx')
36
37
  Clipboard.clear
37
- Clipboard.paste.should == ''
38
+ expect( Clipboard.paste ).to eq ''
38
39
  end
39
40
 
40
41
  describe "when included" do
@@ -44,10 +45,10 @@ describe Clipboard do
44
45
 
45
46
  it "can copy & paste & clear" do
46
47
  a = A.new
47
- a.send(:copy, "XXX").should == 'XXX'
48
- a.send(:paste).should == "XXX"
48
+ expect( a.send(:copy, "XXX") ).to eq 'XXX'
49
+ expect( a.send(:paste) ).to eq "XXX"
49
50
  a.send(:clear)
50
- a.send(:paste).should == ''
51
+ expect( a.send(:paste) ).to eq ''
51
52
  end
52
53
  end
53
54
 
@@ -59,18 +60,18 @@ describe Clipboard do
59
60
  end
60
61
 
61
62
  it "can paste with empty file" do
62
- Clipboard.paste.should == ''
63
+ expect( Clipboard.paste ).to eq ''
63
64
  end
64
65
 
65
66
  it "can copy & paste" do
66
- Clipboard.copy('xxx').should == 'xxx'
67
- Clipboard.paste.should == 'xxx'
67
+ expect( Clipboard.copy('xxx') ).to eq 'xxx'
68
+ expect( Clipboard.paste ).to eq 'xxx'
68
69
  end
69
70
 
70
71
  it "can clear" do
71
- Clipboard.copy('xxx').should == 'xxx'
72
+ expect( Clipboard.copy('xxx') ).to eq 'xxx'
72
73
  Clipboard.clear
73
- Clipboard.paste.should == ''
74
+ expect( Clipboard.paste ).to eq ''
74
75
  end
75
76
  end
76
77
 
@@ -82,21 +83,21 @@ describe Clipboard do
82
83
 
83
84
  it "does not warn on normal detection" do
84
85
  if system('which xclip >/dev/null 2>&1') || system('which xsel >/dev/null 2>&1')
85
- $stderr.should_not_receive(:puts)
86
+ expect( $stderr ).not_to receive(:puts)
86
87
  end
87
88
  Clipboard.implementation
88
89
  end
89
90
 
90
91
  it "warns when OS is unknown" do
91
92
  RbConfig::CONFIG['host_os'] = 'Fooo OS'
92
- $stderr.should_receive(:puts)
93
- Clipboard.implementation.should == Clipboard::File
93
+ expect( $stderr ).to receive(:puts)
94
+ expect( Clipboard.implementation ).to eq Clipboard::File
94
95
  end
95
96
 
96
97
  it "does not warn when $VERBOSE is false" do
97
98
  $VERBOSE = false
98
99
  RbConfig::CONFIG['host_os'] = 'Fooo OS'
99
- $stderr.should_not_receive(:puts)
100
+ expect( $stderr ).not_to receive(:puts)
100
101
  Clipboard.implementation
101
102
  end
102
103
  end
metadata CHANGED
@@ -1,123 +1,90 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: clipboard
3
- version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 5
10
- version: 1.0.5
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.6
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Jan Lelis
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-04-30 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
- none: false
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- hash: 3
27
- segments:
28
- - 0
29
- version: "0"
11
+ date: 2015-02-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
30
14
  name: rake
31
- prerelease: false
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
32
20
  type: :development
33
- requirement: *id001
34
- - !ruby/object:Gem::Dependency
35
- version_requirements: &id002 !ruby/object:Gem::Requirement
36
- none: false
37
- requirements:
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
38
24
  - - ">="
39
- - !ruby/object:Gem::Version
40
- hash: 7
41
- segments:
42
- - 2
43
- version: "2"
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
44
28
  name: rspec
45
- prerelease: false
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '2'
46
34
  type: :development
47
- requirement: *id002
48
- description: Easy access to the clipboard on Linux, MacOS and Windows (Clipboard.copy & Clipboard.paste).
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '2'
41
+ description: Easy access to the clipboard on Linux, MacOS and Windows (Clipboard.copy
42
+ & Clipboard.paste).
49
43
  email: mail@janlelis.de
50
44
  executables: []
51
-
52
45
  extensions: []
53
-
54
46
  extra_rdoc_files: []
55
-
56
- files:
47
+ files:
48
+ - CHANGELOG.rdoc
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - LICENSE
52
+ - README.rdoc
53
+ - Rakefile
54
+ - clipboard.gemspec
57
55
  - lib/clipboard.rb
58
- - lib/clipboard/version.rb
59
- - lib/clipboard/linux.rb
60
56
  - lib/clipboard/file.rb
57
+ - lib/clipboard/java.rb
58
+ - lib/clipboard/linux.rb
61
59
  - lib/clipboard/mac.rb
60
+ - lib/clipboard/version.rb
62
61
  - lib/clipboard/windows.rb
63
- - lib/clipboard/java.rb
64
62
  - spec/clipboard_spec.rb
65
63
  - spec/spec_helper.rb
66
- - Rakefile
67
- - Gemfile
68
- - LICENSE
69
- - Gemfile.lock
70
- - README.rdoc
71
- - CHANGELOG.rdoc
72
- - clipboard.gemspec
73
- - .gemtest
74
64
  homepage: http://github.com/janlelis/clipboard
75
65
  licenses: []
76
-
77
- post_install_message: !binary |
78
- ICAgICAgIOKUjOKUgOKUgCBpbmZvIOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKU
79
- gOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKU
80
- gOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUkAogSi1fLUwg4pSCIGh0dHA6Ly9n
81
- aXRodWIuY29tL2phbmxlbGlzL2NsaXBib2FyZCDilIIKICAgICAgIOKUnOKU
82
- gOKUgCB1c2FnZSDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDi
83
- lIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDilIDi
84
- lIDilIDilIDilKQKICAgICAgIOKUgiByZXF1aXJlICdjbGlwYm9hcmQnICAg
85
- ICAgICAgICAgICAgICAg4pSCCiAgICAgICDilIIgQ2xpcGJvYXJkLmNvcHkg
86
- JzQyJyAgICAgICAgICAgICAgICAgIOKUggogICAgICAg4pSCIENsaXBib2Fy
87
- ZC5wYXN0ZSAjPT4gNDIgICAgICAgICAgICAgICDilIIKICAgICAgIOKUlOKU
88
- gOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKU
89
- gOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKU
90
- gOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUmA==
91
-
66
+ metadata: {}
67
+ post_install_message:
92
68
  rdoc_options: []
93
-
94
- require_paths:
69
+ require_paths:
95
70
  - lib
96
- required_ruby_version: !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
99
73
  - - ">="
100
- - !ruby/object:Gem::Version
101
- hash: 3
102
- segments:
103
- - 0
104
- version: "0"
105
- required_rubygems_version: !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
108
78
  - - ">="
109
- - !ruby/object:Gem::Version
110
- hash: 3
111
- segments:
112
- - 0
113
- version: "0"
114
- requirements:
115
- - "On Linux (or other X), you need xclip. You can install it on debian/ubuntu with: sudo apt-get install xclip"
116
- - On Windows, you need the ffi gem.
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements:
82
+ - 'On Linux (or other X), you will need xclip. You can install it on debian/ubuntu
83
+ with: sudo apt-get install xclip'
84
+ - On Windows, you will need the ffi gem.
117
85
  rubyforge_project:
118
- rubygems_version: 1.8.25
86
+ rubygems_version: 2.4.5
119
87
  signing_key:
120
- specification_version: 3
88
+ specification_version: 4
121
89
  summary: Easy access to the clipboard on Linux, MacOS and Windows.
122
90
  test_files: []
123
-
data/.gemtest DELETED
File without changes