clippy 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/clippy +40 -40
- data/changelog.md +9 -9
- data/features/clippy.feature +8 -8
- data/features/step_definitions/clippy_steps.rb +10 -10
- data/features/support/global.rb +9 -9
- data/gemfile.rb +2 -2
- data/lib/clippy.rb +160 -161
- data/license.txt +18 -18
- data/rakefile.rb +19 -19
- data/readme.md +33 -31
- metadata +33 -13
data/bin/clippy
CHANGED
@@ -1,40 +1,40 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
$:.unshift('../lib')
|
3
|
-
require 'optparse'
|
4
|
-
require 'clippy'
|
5
|
-
|
6
|
-
##
|
7
|
-
# Opts.
|
8
|
-
do_return = nil
|
9
|
-
did_cmd = nil
|
10
|
-
OptionParser.new do |opts|
|
11
|
-
opts.banner = "Clippy v#{Clippy.version} by Envygeeks"
|
12
|
-
opts.on('--no-encoding', 'Encoding') { Clippy.encode = false }
|
13
|
-
opts.on('--paste', 'Paste') { do_return = Clippy.paste }
|
14
|
-
opts.on('--help', 'This') { do_return = opts }
|
15
|
-
opts.on('--clear', 'Clear') { did_cmd = Clippy.clear }
|
16
|
-
|
17
|
-
opts.on('--copy', 'Copy') do
|
18
|
-
unless ARGV.count > 0
|
19
|
-
text = ARGF.readlines.join
|
20
|
-
else
|
21
|
-
if ARGV.count > 1
|
22
|
-
raise(RuntimeError, 'More than one arg.', 'Clippy')
|
23
|
-
else
|
24
|
-
text = ARGV.first.dup
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
did_cmd = Clippy.copy(text)
|
29
|
-
end
|
30
|
-
|
31
|
-
opts.on('--version', 'version') { do_return = Clippy.version }
|
32
|
-
end.parse!
|
33
|
-
|
34
|
-
if do_return.nil? and did_cmd.nil?
|
35
|
-
system("#{File.expand_path(__FILE__)} --help")
|
36
|
-
else
|
37
|
-
if do_return
|
38
|
-
$stdout.puts do_return
|
39
|
-
end
|
40
|
-
end
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$:.unshift('../lib')
|
3
|
+
require 'optparse'
|
4
|
+
require 'clippy'
|
5
|
+
|
6
|
+
##
|
7
|
+
# Opts.
|
8
|
+
do_return = nil
|
9
|
+
did_cmd = nil
|
10
|
+
OptionParser.new do |opts|
|
11
|
+
opts.banner = "Clippy v#{Clippy.version} by Envygeeks"
|
12
|
+
opts.on('--no-encoding', 'Encoding') { Clippy.encode = false }
|
13
|
+
opts.on('--paste', 'Paste') { do_return = Clippy.paste }
|
14
|
+
opts.on('--help', 'This') { do_return = opts }
|
15
|
+
opts.on('--clear', 'Clear') { did_cmd = Clippy.clear }
|
16
|
+
|
17
|
+
opts.on('--copy', 'Copy') do
|
18
|
+
unless ARGV.count > 0
|
19
|
+
text = ARGF.readlines.join
|
20
|
+
else
|
21
|
+
if ARGV.count > 1
|
22
|
+
raise(RuntimeError, 'More than one arg.', 'Clippy')
|
23
|
+
else
|
24
|
+
text = ARGV.first.dup
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
did_cmd = Clippy.copy(text)
|
29
|
+
end
|
30
|
+
|
31
|
+
opts.on('--version', 'version') { do_return = Clippy.version }
|
32
|
+
end.parse!
|
33
|
+
|
34
|
+
if do_return.nil? and did_cmd.nil?
|
35
|
+
system("#{File.expand_path(__FILE__)} --help")
|
36
|
+
else
|
37
|
+
if do_return
|
38
|
+
$stdout.puts do_return
|
39
|
+
end
|
40
|
+
end
|
data/changelog.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
0.2.1
|
2
|
-
Fix an issue with '\n$' on Ruby 1.9.3 by removing it.
|
3
|
-
No longer require open3 for Windows users.
|
4
|
-
Add an option for users to disable encoding.
|
5
|
-
Fix an issue with frozen argv by duping.
|
6
|
-
Micro-optimise the encoding checks a bit.
|
7
|
-
Update the readme to use Markdown.
|
8
|
-
Other various fixes that might not be mentioned.
|
9
|
-
Avoid shitty Gem pkg problems by forcing permissions.
|
1
|
+
* 0.2.1 and 0.2.2
|
2
|
+
* Fix an issue with '\n$' on Ruby 1.9.3 by removing it.
|
3
|
+
* No longer require open3 for Windows users.
|
4
|
+
* Add an option for users to disable encoding.
|
5
|
+
* Fix an issue with frozen argv by duping.
|
6
|
+
* Micro-optimise the encoding checks a bit.
|
7
|
+
* Update the readme to use Markdown.
|
8
|
+
* Other various fixes that might not be mentioned.
|
9
|
+
* Avoid shitty Gem pkg problems by forcing permissions.
|
data/features/clippy.feature
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
Feature: Clippy
|
2
|
-
Background:
|
3
|
-
Sometimes you would like to copy and paste from a Ruby script. In order to
|
4
|
-
that though we will need a small little class called Clippy that can copy,
|
5
|
-
paste and also clear the clipboard on Windows, Linux and Mac.
|
6
|
-
|
7
|
-
Given Clippy exist and it has a version.
|
8
|
-
Then Copy, Paste and Clear should exist.
|
1
|
+
Feature: Clippy
|
2
|
+
Background:
|
3
|
+
Sometimes you would like to copy and paste from a Ruby script. In order to
|
4
|
+
that though we will need a small little class called Clippy that can copy,
|
5
|
+
paste and also clear the clipboard on Windows, Linux and Mac.
|
6
|
+
|
7
|
+
Given Clippy exist and it has a version.
|
8
|
+
Then Copy, Paste and Clear should exist.
|
@@ -1,10 +1,10 @@
|
|
1
|
-
Given 'Clippy exist and it has a version.' do
|
2
|
-
should be_defined Clippy
|
3
|
-
should be_defined Clippy.version
|
4
|
-
end
|
5
|
-
|
6
|
-
Then 'Copy, Paste and Clear should exist.' do
|
7
|
-
[:copy, :paste, :clear].each do |service|
|
8
|
-
true.should == Clippy.respond_to?(service)
|
9
|
-
end
|
10
|
-
end
|
1
|
+
Given 'Clippy exist and it has a version.' do
|
2
|
+
should be_defined Clippy
|
3
|
+
should be_defined Clippy.version
|
4
|
+
end
|
5
|
+
|
6
|
+
Then 'Copy, Paste and Clear should exist.' do
|
7
|
+
[:copy, :paste, :clear].each do |service|
|
8
|
+
true.should == Clippy.respond_to?(service)
|
9
|
+
end
|
10
|
+
end
|
data/features/support/global.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
$:.unshift(File.join(File.dirname(__FILE__), '../../lib'))
|
2
|
-
require 'rspec/expectations'
|
3
|
-
require 'clippy'
|
4
|
-
|
5
|
-
RSpec::Matchers.define :be_defined do
|
6
|
-
match do |defyned|
|
7
|
-
defined? defyned
|
8
|
-
end
|
9
|
-
end
|
1
|
+
$:.unshift(File.join(File.dirname(__FILE__), '../../lib'))
|
2
|
+
require 'rspec/expectations'
|
3
|
+
require 'clippy'
|
4
|
+
|
5
|
+
RSpec::Matchers.define :be_defined do
|
6
|
+
match do |defyned|
|
7
|
+
defined? defyned
|
8
|
+
end
|
9
|
+
end
|
data/gemfile.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source :rubygems
|
2
|
-
gemspec
|
1
|
+
source :rubygems
|
2
|
+
gemspec
|
data/lib/clippy.rb
CHANGED
@@ -1,161 +1,160 @@
|
|
1
|
-
require 'rbconfig'
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
require '
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
tmpfile
|
48
|
-
tmpfile.
|
49
|
-
tmpfile.
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
when '
|
112
|
-
when '
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
when '
|
128
|
-
when '
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
end
|
1
|
+
require 'rbconfig' unless defined?(RbConfig)
|
2
|
+
unless RbConfig::CONFIG['host_os'] =~ /mswin/ || RbConfig::CONFIG['host_os'] == 'mingw32'
|
3
|
+
require 'open3'
|
4
|
+
else
|
5
|
+
require 'Win32API'
|
6
|
+
require 'tempfile'
|
7
|
+
end
|
8
|
+
|
9
|
+
class Clippy
|
10
|
+
private_class_method :new
|
11
|
+
@@encode = true
|
12
|
+
|
13
|
+
[:UnsupportedOS, :UnknownClipboard, :InvalidEncoding].each do |status|
|
14
|
+
const_set(status, Class.new(StandardError))
|
15
|
+
end
|
16
|
+
|
17
|
+
class << self
|
18
|
+
|
19
|
+
##
|
20
|
+
# Version.
|
21
|
+
def version
|
22
|
+
'0.2.3'
|
23
|
+
end
|
24
|
+
|
25
|
+
def binary_exist?(bin)
|
26
|
+
system("which #{bin} > /dev/null 2>&1")
|
27
|
+
end
|
28
|
+
|
29
|
+
def encode=(value)
|
30
|
+
@@encode = value if [TrueClass, FalseClass].include?(value.class)
|
31
|
+
end
|
32
|
+
|
33
|
+
##
|
34
|
+
# Copy
|
35
|
+
def copy(data)
|
36
|
+
unless data.is_a?(String)
|
37
|
+
raise(ArgumentError, 'Clippy can only copy a string')
|
38
|
+
end
|
39
|
+
|
40
|
+
##
|
41
|
+
# For shit like Pidgin..
|
42
|
+
data.gsub!(/\n/, "\r\n")
|
43
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin/ || RbConfig::CONFIG['host_os'] == 'mingw32'
|
44
|
+
if system('clip /? > NUL')
|
45
|
+
begin
|
46
|
+
tmpfile = Tempfile.new('clippy')
|
47
|
+
tmpfile.write(data)
|
48
|
+
tmpfile.flush
|
49
|
+
system("clip < #{tmpfile.path}")
|
50
|
+
ensure
|
51
|
+
tmpfile.close(true)
|
52
|
+
end
|
53
|
+
else
|
54
|
+
raise(UnsupportedOS, 'Your Windows version is too old.')
|
55
|
+
end
|
56
|
+
else
|
57
|
+
case true
|
58
|
+
when binary_exist?('xsel')
|
59
|
+
['-p', '-b', '-s'].each do |opt|
|
60
|
+
Open3.popen3("xsel -i #{opt}") do |stdin, _, _|
|
61
|
+
stdin << data
|
62
|
+
end
|
63
|
+
end
|
64
|
+
when binary_exist?('pbcopy')
|
65
|
+
Open3.popen3('pbcopy') do |stdin|
|
66
|
+
stdin << data
|
67
|
+
end
|
68
|
+
when binary_exist?('xclip')
|
69
|
+
['primary', 'secondary', 'clipboard'].each do |opt|
|
70
|
+
Open3.popen3("xclip -i -selection #{opt}") do |stdin, _, _|
|
71
|
+
stdin << data
|
72
|
+
end
|
73
|
+
end
|
74
|
+
else
|
75
|
+
raise(UnknownClipboard, 'Clippy requires xsel, xclip or pbcopy.')
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
((data.nil? or data.empty?)?(false):(data))
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Paste
|
84
|
+
def paste(encoding = nil, which = nil)
|
85
|
+
if encoding
|
86
|
+
if %w(clipboard primary secondary).include?(encoding)
|
87
|
+
which, encoding = encoding, nil
|
88
|
+
else
|
89
|
+
if @@encode && defined?(Encoding)
|
90
|
+
unless Encoding.list.map(&:to_s).include?(encoding)
|
91
|
+
raise(InvalidEncoding, 'The encoding you selected is unsupported')
|
92
|
+
end
|
93
|
+
else
|
94
|
+
encoding = nil
|
95
|
+
warn('Encoding library wasn\'t found, skipping the encode') unless !@@encode
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin/
|
101
|
+
Win32API.new('user32', 'OpenClipboard', 'L', 'I').call(0)
|
102
|
+
data = Win32API.new('user32', 'GetClipboardData', 'I', 'P').call(1) || ''
|
103
|
+
Win32API.new('user32', 'CloseClipboard', [], 'I').call
|
104
|
+
else
|
105
|
+
case true
|
106
|
+
when binary_exist?('xsel')
|
107
|
+
cmd = 'xsel -o'
|
108
|
+
|
109
|
+
case which
|
110
|
+
when 'clipboard' then cmd+= ' -b'
|
111
|
+
when 'primary' then cmd+= ' -p'
|
112
|
+
when 'secondary' then cmd+= ' -s'
|
113
|
+
end
|
114
|
+
|
115
|
+
Open3.popen3(cmd) do |_, stdout, _|
|
116
|
+
data = stdout.read
|
117
|
+
end
|
118
|
+
when binary_exist?('pbpaste')
|
119
|
+
Open3.popen('pbpaste') do |_, stdout, _|
|
120
|
+
data = stdout.read || ''
|
121
|
+
end
|
122
|
+
when binary_exist?('xclip')
|
123
|
+
cmd = 'xclip -o'
|
124
|
+
|
125
|
+
case which
|
126
|
+
when 'clipboard' then cmd+= ' clipboard'
|
127
|
+
when 'primary' then cmd+= ' primary'
|
128
|
+
when 'secondary' then cmd+= ' secondary'
|
129
|
+
end
|
130
|
+
|
131
|
+
Open3.popen3(cmd) do |_, stdout, _|
|
132
|
+
data = stdout.read || ''
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
if @@encode && defined?(Encoding)
|
138
|
+
if data.encoding.name != Encoding.default_external
|
139
|
+
data.encode(encoding ? encoding : Encoding.default_external)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
((data.nil? or data.empty?)?(false):(data))
|
144
|
+
end
|
145
|
+
|
146
|
+
def clear
|
147
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin/ || RbConfig::CONFIG['host_os'] == 'mingw32'
|
148
|
+
Win32API.new('user32', 'OpenClipboard', 'L', 'I').call(0)
|
149
|
+
Win32API.new('user32', 'EmptyClipboard', [], 'I').call
|
150
|
+
Win32API.new('user32', 'CloseClipboard', [], 'I').call
|
151
|
+
else
|
152
|
+
if copy('')
|
153
|
+
return true
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
false
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
data/license.txt
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
Copyright (c) 2011 Jordon Bedwell
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4
|
-
this software and associated documentation files (the "Software"), to deal in the
|
5
|
-
Software without restriction, including without limitation the rights to use,
|
6
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
7
|
-
Software, and to permit persons to whom the Software is furnished to do so,
|
8
|
-
subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in all
|
11
|
-
copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
17
|
-
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
18
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright (c) 2011 Jordon Bedwell
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4
|
+
this software and associated documentation files (the "Software"), to deal in the
|
5
|
+
Software without restriction, including without limitation the rights to use,
|
6
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
7
|
+
Software, and to permit persons to whom the Software is furnished to do so,
|
8
|
+
subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
17
|
+
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
18
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/rakefile.rb
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
require 'rubygems/package_task'
|
2
|
-
require 'rake/testtask'
|
3
|
-
|
4
|
-
task :default => [:test]
|
5
|
-
|
6
|
-
Rake::TestTask.new do |tfile|
|
7
|
-
tfile.verbose = true
|
8
|
-
tfile.pattern = "tests/**/*.rb"
|
9
|
-
end
|
10
|
-
|
11
|
-
if ARGV.include?('features')
|
12
|
-
require 'cucumber'
|
13
|
-
require 'cucumber/rake/task'
|
14
|
-
Cucumber::Rake::Task.new(:features)
|
15
|
-
end
|
16
|
-
|
17
|
-
Gem::PackageTask.new(eval(IO.read('clippy.gemspec'))) do |pkg|
|
18
|
-
pkg.need_tar, pkg.need_zip = true
|
19
|
-
end
|
1
|
+
require 'rubygems/package_task'
|
2
|
+
require 'rake/testtask'
|
3
|
+
|
4
|
+
task :default => [:test]
|
5
|
+
|
6
|
+
Rake::TestTask.new do |tfile|
|
7
|
+
tfile.verbose = true
|
8
|
+
tfile.pattern = "tests/**/*.rb"
|
9
|
+
end
|
10
|
+
|
11
|
+
if ARGV.include?('features')
|
12
|
+
require 'cucumber'
|
13
|
+
require 'cucumber/rake/task'
|
14
|
+
Cucumber::Rake::Task.new(:features)
|
15
|
+
end
|
16
|
+
|
17
|
+
Gem::PackageTask.new(eval(IO.read('clippy.gemspec'))) do |pkg|
|
18
|
+
pkg.need_tar, pkg.need_zip = true
|
19
|
+
end
|
data/readme.md
CHANGED
@@ -1,31 +1,33 @@
|
|
1
|
-
Clippy is a cross-platform clipboard utility and script for Ruby.
|
2
|
-
|
3
|
-
---
|
4
|
-
* Requirements:
|
5
|
-
* Ruby1.9
|
6
|
-
*
|
7
|
-
*
|
8
|
-
|
9
|
-
*
|
10
|
-
*
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
#
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
--
|
29
|
-
--
|
30
|
-
--
|
31
|
-
|
1
|
+
Clippy is a cross-platform clipboard utility and script for Ruby.
|
2
|
+
|
3
|
+
---
|
4
|
+
* Requirements:
|
5
|
+
* Ruby1.9+ or jRuby in 1.9 (Windows)
|
6
|
+
* Ruby1.8.6+ (For Unix and Linux))
|
7
|
+
* All platforms support jRuby in 1.8 or 1.9 mode except Windows.
|
8
|
+
* Development:
|
9
|
+
* Cucumber
|
10
|
+
* Rake
|
11
|
+
* Minitest
|
12
|
+
* RSPEC-Expectations
|
13
|
+
|
14
|
+
All other distros should work with 1.8+
|
15
|
+
|
16
|
+
# Shell (Linux and Windows)
|
17
|
+
clippy --copy '#1'
|
18
|
+
echo '#2' |clippy --copy
|
19
|
+
clipy --copy < 'file#3.txt'
|
20
|
+
|
21
|
+
# Ruby1.8+
|
22
|
+
require 'clippy'
|
23
|
+
Clippy.copy('#1')
|
24
|
+
Clippy.paste and Clippy.clear
|
25
|
+
<br />
|
26
|
+
<pre>
|
27
|
+
Clippy v0.1 by Envygeeks
|
28
|
+
--paste Paste
|
29
|
+
--help This
|
30
|
+
--clear Clear
|
31
|
+
--copy Copy
|
32
|
+
--version Version
|
33
|
+
</pre>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clippy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-06-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec-expectations
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,15 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: rake
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
36
|
- - ! '>='
|
@@ -33,10 +38,15 @@ dependencies:
|
|
33
38
|
version: '0'
|
34
39
|
type: :development
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
37
47
|
- !ruby/object:Gem::Dependency
|
38
48
|
name: minitest
|
39
|
-
requirement:
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
40
50
|
none: false
|
41
51
|
requirements:
|
42
52
|
- - ! '>='
|
@@ -44,10 +54,15 @@ dependencies:
|
|
44
54
|
version: '0'
|
45
55
|
type: :development
|
46
56
|
prerelease: false
|
47
|
-
version_requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
48
63
|
- !ruby/object:Gem::Dependency
|
49
64
|
name: cucumber
|
50
|
-
requirement:
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
51
66
|
none: false
|
52
67
|
requirements:
|
53
68
|
- - ! '>='
|
@@ -55,7 +70,12 @@ dependencies:
|
|
55
70
|
version: '0'
|
56
71
|
type: :development
|
57
72
|
prerelease: false
|
58
|
-
version_requirements:
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
59
79
|
description: A utility to access the systems clipboard.
|
60
80
|
email:
|
61
81
|
- jordon@envygeeks.com
|
@@ -67,9 +87,9 @@ extra_rdoc_files: []
|
|
67
87
|
files:
|
68
88
|
- lib/clippy.rb
|
69
89
|
- bin/clippy
|
70
|
-
- features/support/global.rb
|
71
|
-
- features/step_definitions/clippy_steps.rb
|
72
90
|
- features/clippy.feature
|
91
|
+
- features/step_definitions/clippy_steps.rb
|
92
|
+
- features/support/global.rb
|
73
93
|
- readme.md
|
74
94
|
- license.txt
|
75
95
|
- rakefile.rb
|
@@ -96,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
116
|
version: '0'
|
97
117
|
requirements: []
|
98
118
|
rubyforge_project:
|
99
|
-
rubygems_version: 1.8.
|
119
|
+
rubygems_version: 1.8.23
|
100
120
|
signing_key:
|
101
121
|
specification_version: 3
|
102
122
|
summary: A utility to access the systems clipboard.
|