clipboard 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'zucker', '>= 4'
4
+
5
+ gem 'win32-clipboard', :platforms => :mswin
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Jan Lelis
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,27 @@
1
+ = clipboard
2
+ Access the clipboard and do not care if the OS is linux, mac or windows.
3
+
4
+ === Usage
5
+ You have <tt>Clipboard.write</tt> [+copy+],
6
+
7
+ <tt>Clipboard.read</tt> [+paste+] and
8
+
9
+ <tt>Clipboard.clear</tt>
10
+
11
+ Have fun ;)
12
+
13
+ === Requirements
14
+ * *Linux*: +xclip+ (you can install it on ubuntu with <tt>sudo apt-get install xclip</tt>)
15
+ * *Windows*: <tt>win32-clipboard</tt> gem
16
+ * +Zucker+ gem
17
+
18
+ === TODO
19
+ * Automatically require the <tt>win32-clipboard</tt> gem - but only on windows!
20
+ * Don't depend on +xclip+
21
+ * Don't depend on the <tt>win32-clipboard</tt> gem (or fix the 1.9 issues with the gem)
22
+ * Error management?
23
+
24
+ Feel free to report bugs or to implement one of the above features ;)
25
+
26
+ == Copyright
27
+ Copyright (c) 2010 Jan Lelis, http://rbjl.net, released under the MIT license
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ # require 'bundler'
4
+
5
+ begin
6
+ require 'jeweler'
7
+ Jeweler::Tasks.new do |gem|
8
+ gem.name = "clipboard"
9
+ gem.summary = %Q{Access the clipboard on all systems}
10
+ gem.description = %Q{Access the clipboard on all systems (Clipboard.write & Clipboard.read)}
11
+ gem.email = "mail@janlelis.de"
12
+ gem.homepage = "http://github.com/janlelis/clipboard"
13
+ gem.authors = ["Jan Lelis"]
14
+ gem.add_development_dependency "jeweler", ">= 0"
15
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
+ gem.add_dependency('zucker', '>= 4')
17
+ gem.requirements << 'To use this gem on linux (or other X), you need xclip'
18
+ gem.requirements << 'To use this gem on windows, you need the win32-clipboard gem'
19
+ # gem.add_bundler_dependencies
20
+ end
21
+ Jeweler::GemcutterTasks.new
22
+ rescue LoadError
23
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
24
+ end
25
+
26
+ require 'rake/rdoctask'
27
+ Rake::RDocTask.new do |rdoc|
28
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
29
+
30
+ rdoc.rdoc_dir = 'doc'
31
+ rdoc.title = "clipboard #{version}"
32
+ rdoc.rdoc_files.include('README*')
33
+ rdoc.rdoc_files.include('lib/**/*.rb')
34
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.6.0
data/clipboard.gemspec ADDED
@@ -0,0 +1,84 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{clipboard}
8
+ s.version = "0.6.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jan Lelis"]
12
+ s.date = %q{2010-10-01}
13
+ s.description = %q{Access the clipboard on all systems (Clipboard.write & Clipboard.read)}
14
+ s.email = %q{mail@janlelis.de}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "Gemfile",
23
+ "LICENSE",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "clipboard.gemspec",
28
+ "doc/Clipboard||= Module.new.html",
29
+ "doc/README_rdoc.html",
30
+ "doc/created.rid",
31
+ "doc/images/brick.png",
32
+ "doc/images/brick_link.png",
33
+ "doc/images/bug.png",
34
+ "doc/images/bullet_black.png",
35
+ "doc/images/bullet_toggle_minus.png",
36
+ "doc/images/bullet_toggle_plus.png",
37
+ "doc/images/date.png",
38
+ "doc/images/find.png",
39
+ "doc/images/loadingAnimation.gif",
40
+ "doc/images/macFFBgHack.png",
41
+ "doc/images/package.png",
42
+ "doc/images/page_green.png",
43
+ "doc/images/page_white_text.png",
44
+ "doc/images/page_white_width.png",
45
+ "doc/images/plugin.png",
46
+ "doc/images/ruby.png",
47
+ "doc/images/tag_green.png",
48
+ "doc/images/wrench.png",
49
+ "doc/images/wrench_orange.png",
50
+ "doc/images/zoom.png",
51
+ "doc/index.html",
52
+ "doc/js/darkfish.js",
53
+ "doc/js/jquery.js",
54
+ "doc/js/quicksearch.js",
55
+ "doc/js/thickbox-compressed.js",
56
+ "doc/lib/clipboard_rb.html",
57
+ "doc/rdoc.css",
58
+ "lib/clipboard.rb",
59
+ "version.rb"
60
+ ]
61
+ s.homepage = %q{http://github.com/janlelis/clipboard}
62
+ s.rdoc_options = ["--charset=UTF-8"]
63
+ s.require_paths = ["lib"]
64
+ s.requirements = ["To use this gem on linux (or other X), you need xclip", "To use this gem on windows, you need the win32-clipboard gem"]
65
+ s.rubygems_version = %q{1.3.7}
66
+ s.summary = %q{Access the clipboard on all systems}
67
+
68
+ if s.respond_to? :specification_version then
69
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
70
+ s.specification_version = 3
71
+
72
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
73
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
74
+ s.add_runtime_dependency(%q<zucker>, [">= 4"])
75
+ else
76
+ s.add_dependency(%q<jeweler>, [">= 0"])
77
+ s.add_dependency(%q<zucker>, [">= 4"])
78
+ end
79
+ else
80
+ s.add_dependency(%q<jeweler>, [">= 0"])
81
+ s.add_dependency(%q<zucker>, [">= 4"])
82
+ end
83
+ end
84
+
@@ -0,0 +1,396 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
+
8
+ <title>Module: Clipboard||= Module.new</title>
9
+
10
+ <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="./js/jquery.js" type="text/javascript"
13
+ charset="utf-8"></script>
14
+ <script src="./js/thickbox-compressed.js" type="text/javascript"
15
+ charset="utf-8"></script>
16
+ <script src="./js/quicksearch.js" type="text/javascript"
17
+ charset="utf-8"></script>
18
+ <script src="./js/darkfish.js" type="text/javascript"
19
+ charset="utf-8"></script>
20
+
21
+ </head>
22
+ <body class="module">
23
+
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
+ <h3 class="section-header">
28
+ <a href="./index.html">Home</a>
29
+ <a href="./index.html#classes">Classes</a>
30
+ <a href="./index.html#methods">Methods</a>
31
+ </h3>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="file-metadata">
36
+ <div id="file-list-section" class="section">
37
+ <h3 class="section-header">In Files</h3>
38
+ <div class="section-body">
39
+ <ul>
40
+
41
+ <li><a href="./lib/clipboard_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
+ class="thickbox" title="lib/clipboard.rb">lib/clipboard.rb</a></li>
43
+
44
+ </ul>
45
+ </div>
46
+ </div>
47
+
48
+
49
+ </div>
50
+
51
+ <div id="class-metadata">
52
+
53
+ <!-- Parent Class -->
54
+
55
+
56
+ <!-- Namespace Contents -->
57
+
58
+
59
+ <!-- Method Quickref -->
60
+
61
+ <div id="method-list-section" class="section">
62
+ <h3 class="section-header">Methods</h3>
63
+ <ul class="link-list">
64
+
65
+ <li><a href="#method-c-clear">::clear</a></li>
66
+
67
+ <li><a href="#method-c-clear">::clear</a></li>
68
+
69
+ <li><a href="#method-c-read">::read</a></li>
70
+
71
+ <li><a href="#method-c-read">::read</a></li>
72
+
73
+ <li><a href="#method-c-write">::write</a></li>
74
+
75
+ <li><a href="#method-c-write">::write</a></li>
76
+
77
+ </ul>
78
+ </div>
79
+
80
+
81
+ <!-- Included Modules -->
82
+
83
+ </div>
84
+
85
+ <div id="project-metadata">
86
+
87
+
88
+ <div id="fileindex-section" class="section project-section">
89
+ <h3 class="section-header">Files</h3>
90
+ <ul>
91
+
92
+ <li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
93
+
94
+ </ul>
95
+ </div>
96
+
97
+
98
+ <div id="classindex-section" class="section project-section">
99
+ <h3 class="section-header">Class Index
100
+ <span class="search-toggle"><img src="./images/find.png"
101
+ height="16" width="16" alt="[+]"
102
+ title="show/hide quicksearch" /></span></h3>
103
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
104
+ <fieldset>
105
+ <legend>Quicksearch</legend>
106
+ <input type="text" name="quicksearch" value=""
107
+ class="quicksearch-field" />
108
+ </fieldset>
109
+ </form>
110
+
111
+ <ul class="link-list">
112
+
113
+ <li><a href="./Clipboard||= Module.new.html">Clipboard||= Module.new</a></li>
114
+
115
+ </ul>
116
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
117
+ </div>
118
+
119
+
120
+ </div>
121
+ </div>
122
+
123
+ <div id="documentation">
124
+ <h1 class="module">Clipboard||= Module.new</h1>
125
+
126
+ <div id="description">
127
+
128
+ </div>
129
+
130
+ <!-- Constants -->
131
+
132
+ <div id="constants-list" class="section">
133
+ <h3 class="section-header">Constants</h3>
134
+ <dl>
135
+
136
+ <dt><a name="WriteCommand">WriteCommand</a></dt>
137
+
138
+ <dd class="description"></dd>
139
+
140
+
141
+ <dt><a name="ReadCommand">ReadCommand</a></dt>
142
+
143
+ <dd class="description"></dd>
144
+
145
+
146
+ <dt><a name="WriteCommand">WriteCommand</a></dt>
147
+
148
+ <dd class="description"></dd>
149
+
150
+
151
+ <dt><a name="ReadCommand">ReadCommand</a></dt>
152
+
153
+ <dd class="description"></dd>
154
+
155
+
156
+ </dl>
157
+ </div>
158
+
159
+
160
+ <!-- Attributes -->
161
+
162
+
163
+ <!-- Methods -->
164
+
165
+ <div id="public-class-method-details" class="method-section section">
166
+ <h3 class="section-header">Public Class Methods</h3>
167
+
168
+
169
+ <div id="clear-method" class="method-detail ">
170
+ <a name="method-c-clear"></a>
171
+
172
+ <div class="method-heading">
173
+
174
+ <span class="method-name">clear</span><span
175
+ class="method-args">()</span>
176
+ <span class="method-click-advice">click to toggle source</span>
177
+
178
+ </div>
179
+
180
+ <div class="method-description">
181
+
182
+
183
+
184
+
185
+
186
+ <div class="method-source-code"
187
+ id="clear-source">
188
+ <pre>
189
+ <span class="ruby-comment cmt"># File lib/clipboard.rb, line 43</span>
190
+ 43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear</span>
191
+ 44: <span class="ruby-constant">Win32</span><span class="ruby-operator">::</span><span class="ruby-constant">Clipboard</span>.<span class="ruby-identifier">empty</span>
192
+ 45: <span class="ruby-constant">Win32</span><span class="ruby-operator">::</span><span class="ruby-constant">Clipboard</span>.<span class="ruby-identifier">data</span>
193
+ 46: <span class="ruby-keyword kw">end</span></pre>
194
+ </div>
195
+
196
+ </div>
197
+
198
+
199
+
200
+
201
+ </div>
202
+
203
+
204
+ <div id="clear-method" class="method-detail ">
205
+ <a name="method-c-clear"></a>
206
+
207
+ <div class="method-heading">
208
+
209
+ <span class="method-name">clear</span><span
210
+ class="method-args">()</span>
211
+ <span class="method-click-advice">click to toggle source</span>
212
+
213
+ </div>
214
+
215
+ <div class="method-description">
216
+
217
+
218
+
219
+
220
+
221
+ <div class="method-source-code"
222
+ id="clear-source">
223
+ <pre>
224
+ <span class="ruby-comment cmt"># File lib/clipboard.rb, line 28</span>
225
+ 28: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear</span>
226
+ 29: <span class="ruby-identifier">write</span> <span class="ruby-value str">''</span>
227
+ 30: <span class="ruby-keyword kw">end</span></pre>
228
+ </div>
229
+
230
+ </div>
231
+
232
+
233
+
234
+
235
+ </div>
236
+
237
+
238
+ <div id="read-method" class="method-detail ">
239
+ <a name="method-c-read"></a>
240
+
241
+ <div class="method-heading">
242
+
243
+ <span class="method-name">read</span><span
244
+ class="method-args">()</span>
245
+ <span class="method-click-advice">click to toggle source</span>
246
+
247
+ </div>
248
+
249
+ <div class="method-description">
250
+
251
+
252
+
253
+
254
+
255
+ <div class="method-source-code"
256
+ id="read-source">
257
+ <pre>
258
+ <span class="ruby-comment cmt"># File lib/clipboard.rb, line 24</span>
259
+ 24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span>
260
+ 25: <span class="ruby-node">%[#{ ReadCommand }]</span>
261
+ 26: <span class="ruby-keyword kw">end</span></pre>
262
+ </div>
263
+
264
+ </div>
265
+
266
+
267
+
268
+
269
+ </div>
270
+
271
+
272
+ <div id="read-method" class="method-detail ">
273
+ <a name="method-c-read"></a>
274
+
275
+ <div class="method-heading">
276
+
277
+ <span class="method-name">read</span><span
278
+ class="method-args">()</span>
279
+ <span class="method-click-advice">click to toggle source</span>
280
+
281
+ </div>
282
+
283
+ <div class="method-description">
284
+
285
+
286
+
287
+
288
+
289
+ <div class="method-source-code"
290
+ id="read-source">
291
+ <pre>
292
+ <span class="ruby-comment cmt"># File lib/clipboard.rb, line 39</span>
293
+ 39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span>
294
+ 40: <span class="ruby-constant">Win32</span><span class="ruby-operator">::</span><span class="ruby-constant">Clipboard</span>.<span class="ruby-identifier">data</span>
295
+ 41: <span class="ruby-keyword kw">end</span></pre>
296
+ </div>
297
+
298
+ </div>
299
+
300
+
301
+
302
+
303
+ </div>
304
+
305
+
306
+ <div id="write-method" class="method-detail ">
307
+ <a name="method-c-write"></a>
308
+
309
+ <div class="method-heading">
310
+
311
+ <span class="method-name">write</span><span
312
+ class="method-args">(data)</span>
313
+ <span class="method-click-advice">click to toggle source</span>
314
+
315
+ </div>
316
+
317
+ <div class="method-description">
318
+
319
+
320
+
321
+
322
+
323
+ <div class="method-source-code"
324
+ id="write-source">
325
+ <pre>
326
+ <span class="ruby-comment cmt"># File lib/clipboard.rb, line 34</span>
327
+ 34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
328
+ 35: <span class="ruby-constant">Win32</span><span class="ruby-operator">::</span><span class="ruby-constant">Clipboard</span>.<span class="ruby-identifier">set_data</span>( <span class="ruby-identifier">data</span> )
329
+ 36: <span class="ruby-constant">Win32</span><span class="ruby-operator">::</span><span class="ruby-constant">Clipboard</span>.<span class="ruby-identifier">data</span>
330
+ 37: <span class="ruby-keyword kw">end</span></pre>
331
+ </div>
332
+
333
+ </div>
334
+
335
+
336
+
337
+
338
+ </div>
339
+
340
+
341
+ <div id="write-method" class="method-detail ">
342
+ <a name="method-c-write"></a>
343
+
344
+ <div class="method-heading">
345
+
346
+ <span class="method-name">write</span><span
347
+ class="method-args">(data)</span>
348
+ <span class="method-click-advice">click to toggle source</span>
349
+
350
+ </div>
351
+
352
+ <div class="method-description">
353
+
354
+
355
+
356
+
357
+
358
+ <div class="method-source-code"
359
+ id="write-source">
360
+ <pre>
361
+ <span class="ruby-comment cmt"># File lib/clipboard.rb, line 19</span>
362
+ 19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
363
+ 20: <span class="ruby-constant">Open3</span>.<span class="ruby-identifier">popen3</span>( <span class="ruby-constant">WriteCommand</span> ){ <span class="ruby-operator">|</span><span class="ruby-identifier">input</span>, <span class="ruby-identifier">_</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span> <span class="ruby-identifier">input</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">data</span> }
364
+ 21: <span class="ruby-identifier">read</span> <span class="ruby-comment cmt"># or true or nil?</span>
365
+ 22: <span class="ruby-keyword kw">end</span></pre>
366
+ </div>
367
+
368
+ </div>
369
+
370
+
371
+
372
+
373
+ </div>
374
+
375
+
376
+ </div>
377
+
378
+
379
+ </div>
380
+
381
+
382
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
383
+
384
+ <p>Disabled; run with --debug to generate this.</p>
385
+
386
+ </div>
387
+
388
+ <div id="validator-badges">
389
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
390
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
391
+ Rdoc Generator</a> 1.1.6</small>.</p>
392
+ </div>
393
+
394
+ </body>
395
+ </html>
396
+