clippy 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/{gemfile.rb → Gemfile} +2 -2
- data/{license.txt → License} +18 -18
- data/{rakefile.rb → Rakefile} +19 -19
- data/{readme.md → Readme.md} +33 -33
- 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/lib/clippy.rb +3 -4
- metadata +8 -8
data/{gemfile.rb → Gemfile}
RENAMED
@@ -1,2 +1,2 @@
|
|
1
|
-
source :rubygems
|
2
|
-
gemspec
|
1
|
+
source :rubygems
|
2
|
+
gemspec
|
data/{license.txt → License}
RENAMED
@@ -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 → Rakefile}
RENAMED
@@ -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 → Readme.md}
RENAMED
@@ -1,33 +1,33 @@
|
|
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>
|
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>
|
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 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.
|
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/lib/clippy.rb
CHANGED
@@ -19,7 +19,7 @@ class Clippy
|
|
19
19
|
##
|
20
20
|
# Version.
|
21
21
|
def version
|
22
|
-
'0.2.
|
22
|
+
'0.2.4'
|
23
23
|
end
|
24
24
|
|
25
25
|
def binary_exist?(bin)
|
@@ -33,9 +33,8 @@ class Clippy
|
|
33
33
|
##
|
34
34
|
# Copy
|
35
35
|
def copy(data)
|
36
|
-
|
37
|
-
|
38
|
-
end
|
36
|
+
# Just convert it ourselves right now.....
|
37
|
+
data = data.to_s unless data.is_a?(String)
|
39
38
|
|
40
39
|
##
|
41
40
|
# For shit like Pidgin..
|
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.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-08-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec-expectations
|
@@ -87,13 +87,13 @@ extra_rdoc_files: []
|
|
87
87
|
files:
|
88
88
|
- lib/clippy.rb
|
89
89
|
- bin/clippy
|
90
|
-
- features/clippy.feature
|
91
90
|
- features/step_definitions/clippy_steps.rb
|
91
|
+
- features/clippy.feature
|
92
92
|
- features/support/global.rb
|
93
|
-
-
|
94
|
-
-
|
95
|
-
-
|
96
|
-
-
|
93
|
+
- Readme.md
|
94
|
+
- License
|
95
|
+
- Rakefile
|
96
|
+
- Gemfile
|
97
97
|
- changelog.md
|
98
98
|
homepage: https://github.com/envygeeks/clippy
|
99
99
|
licenses:
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 1.8.
|
119
|
+
rubygems_version: 1.8.24
|
120
120
|
signing_key:
|
121
121
|
specification_version: 3
|
122
122
|
summary: A utility to access the systems clipboard.
|