clipboard 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -11,7 +11,8 @@ begin
11
11
  gem.homepage = "http://github.com/janlelis/clipboard"
12
12
  gem.authors = ["Jan Lelis"]
13
13
  gem.add_development_dependency "jeweler", ">= 0"
14
- gem.add_dependency('zucker', '>= 7')
14
+ gem.add_dependency('zucker', '>= 8')
15
+ gem.add_dependency('ffi')
15
16
  gem.requirements << 'on linux (or other X), you need xclip. Install it on debian/ubuntu with sudo apt-get install xclip'
16
17
 
17
18
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.1
1
+ 0.9.2
data/clipboard.gemspec CHANGED
@@ -1,65 +1,31 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{clipboard}
8
- s.version = "0.9.1"
8
+ s.version = "0.9.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jan Lelis"]
12
- s.date = %q{2010-10-14}
12
+ s.date = %q{2010-11-18}
13
13
  s.description = %q{Access the clipboard on all systems (Clipboard.copy & Clipboard.paste)}
14
14
  s.email = %q{mail@janlelis.de}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.rdoc"
17
+ "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
- ".document",
21
- ".gitignore",
22
- "Gemfile",
23
- "LICENSE",
24
- "README.rdoc",
25
- "Rakefile",
26
- "VERSION",
27
- "clipboard.gemspec",
28
- "doc/Clipboard.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"
20
+ "LICENSE",
21
+ "README.rdoc",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "clipboard.gemspec",
25
+ "lib/clipboard.rb",
26
+ "version.rb"
60
27
  ]
61
28
  s.homepage = %q{http://github.com/janlelis/clipboard}
62
- s.rdoc_options = ["--charset=UTF-8"]
63
29
  s.require_paths = ["lib"]
64
30
  s.requirements = ["on linux (or other X), you need xclip. Install it on debian/ubuntu with sudo apt-get install xclip"]
65
31
  s.rubygems_version = %q{1.3.7}
@@ -71,14 +37,17 @@ Gem::Specification.new do |s|
71
37
 
72
38
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
73
39
  s.add_development_dependency(%q<jeweler>, [">= 0"])
74
- s.add_runtime_dependency(%q<zucker>, [">= 7"])
40
+ s.add_runtime_dependency(%q<zucker>, [">= 8"])
41
+ s.add_runtime_dependency(%q<ffi>, [">= 0"])
75
42
  else
76
43
  s.add_dependency(%q<jeweler>, [">= 0"])
77
- s.add_dependency(%q<zucker>, [">= 7"])
44
+ s.add_dependency(%q<zucker>, [">= 8"])
45
+ s.add_dependency(%q<ffi>, [">= 0"])
78
46
  end
79
47
  else
80
48
  s.add_dependency(%q<jeweler>, [">= 0"])
81
- s.add_dependency(%q<zucker>, [">= 7"])
49
+ s.add_dependency(%q<zucker>, [">= 8"])
50
+ s.add_dependency(%q<ffi>, [">= 0"])
82
51
  end
83
52
  end
84
53
 
data/lib/clipboard.rb CHANGED
@@ -4,6 +4,8 @@ require 'zucker/version'
4
4
  require File.expand_path '../../version', __FILE__
5
5
 
6
6
  module Clipboard
7
+ extend self
8
+
7
9
  if OS.windows?
8
10
  CF_TEXT = 1
9
11
  CF_UNICODETEXT = 13
@@ -35,7 +37,7 @@ module Clipboard
35
37
  end
36
38
 
37
39
  # see http://www.codeproject.com/KB/clipboard/archerclipboard1.aspx
38
- def self.paste(_=nil)
40
+ def paste(_=nil)
39
41
  ret = ""
40
42
  if 0 != User32.open( 0 )
41
43
  hclip = User32.get( CF_UNICODETEXT )
@@ -64,30 +66,30 @@ module Clipboard
64
66
  ret || ""
65
67
  end
66
68
 
67
- def self.clear
69
+ def clear
68
70
  if 0 != User32.open( 0 )
69
71
  User32.empty( )
70
72
  User32.close( )
71
73
  end
72
74
  paste
73
75
  end
74
-
75
- def self.copy(data_to_copy)
76
- if RubyVersion >= 1.9 && 0 != User32.open( 0 )
77
- User32.empty( )
78
- data = data_to_copy.encode("UTF-16LE") # TODO catch bad encodings
79
- data << 0 << 0
80
- handler = Kernel32.alloc( GMEM_MOVEABLE, data.bytesize )
81
- pointer_to_data = Kernel32.lock( handler )
82
- pointer_to_data.put_bytes( 0, data, 0, data.bytesize )
83
- Kernel32.unlock( handler )
84
- User32.set( CF_UNICODETEXT, handler )
85
- User32.close( )
86
- else # don't touch anything
87
- IO.popen( 'clip', 'w' ){ |input| input << data_to_copy } # depends on clip (available by default since Vista)
76
+
77
+ def copy(data_to_copy)
78
+ if RubyVersion >= 1.9 && 0 != User32.open( 0 )
79
+ User32.empty( )
80
+ data = data_to_copy.encode("UTF-16LE") # TODO catch bad encodings
81
+ data << 0 << 0
82
+ handler = Kernel32.alloc( GMEM_MOVEABLE, data.bytesize )
83
+ pointer_to_data = Kernel32.lock( handler )
84
+ pointer_to_data.put_bytes( 0, data, 0, data.bytesize )
85
+ Kernel32.unlock( handler )
86
+ User32.set( CF_UNICODETEXT, handler )
87
+ User32.close( )
88
+ else # don't touch anything
89
+ IO.popen( 'clip', 'w' ){ |input| input << data_to_copy } # depends on clip (available by default since Vista)
90
+ end
91
+ paste
88
92
  end
89
- paste
90
- end
91
93
  else #non-windows
92
94
  require 'open3'
93
95
 
@@ -114,7 +116,7 @@ module Clipboard
114
116
  end
115
117
  end
116
118
 
117
- def self.paste(which = nil)
119
+ def paste(which = nil)
118
120
  selection_string = if CLIPBOARDS.include?(which.to_s)
119
121
  " -selection #{which}"
120
122
  else
@@ -123,11 +125,11 @@ module Clipboard
123
125
  %x[#{ ReadCommand + selection_string }]
124
126
  end
125
127
 
126
- def self.clear
128
+ def clear
127
129
  copy ''
128
130
  end
129
131
 
130
- def self.copy(data)
132
+ def copy(data)
131
133
  WriteCommands.each{ |cmd|
132
134
  IO.popen( cmd, 'w' ){ |input| input << data }
133
135
  }
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clipboard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 9
9
- - 1
10
- version: 0.9.1
8
+ - 2
9
+ version: 0.9.2
11
10
  platform: ruby
12
11
  authors:
13
12
  - Jan Lelis
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-10-14 00:00:00 +02:00
17
+ date: 2010-11-18 00:00:00 +01:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -26,7 +25,6 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 3
30
28
  segments:
31
29
  - 0
32
30
  version: "0"
@@ -40,12 +38,24 @@ dependencies:
40
38
  requirements:
41
39
  - - ">="
42
40
  - !ruby/object:Gem::Version
43
- hash: 13
44
41
  segments:
45
- - 7
46
- version: "7"
42
+ - 8
43
+ version: "8"
47
44
  type: :runtime
48
45
  version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: ffi
48
+ prerelease: false
49
+ requirement: &id003 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 0
56
+ version: "0"
57
+ type: :runtime
58
+ version_requirements: *id003
49
59
  description: Access the clipboard on all systems (Clipboard.copy & Clipboard.paste)
50
60
  email: mail@janlelis.de
51
61
  executables: []
@@ -56,44 +66,11 @@ extra_rdoc_files:
56
66
  - LICENSE
57
67
  - README.rdoc
58
68
  files:
59
- - .document
60
- - .gitignore
61
- - Gemfile
62
69
  - LICENSE
63
70
  - README.rdoc
64
71
  - Rakefile
65
72
  - VERSION
66
73
  - clipboard.gemspec
67
- - doc/Clipboard.html
68
- - doc/README_rdoc.html
69
- - doc/created.rid
70
- - doc/images/brick.png
71
- - doc/images/brick_link.png
72
- - doc/images/bug.png
73
- - doc/images/bullet_black.png
74
- - doc/images/bullet_toggle_minus.png
75
- - doc/images/bullet_toggle_plus.png
76
- - doc/images/date.png
77
- - doc/images/find.png
78
- - doc/images/loadingAnimation.gif
79
- - doc/images/macFFBgHack.png
80
- - doc/images/package.png
81
- - doc/images/page_green.png
82
- - doc/images/page_white_text.png
83
- - doc/images/page_white_width.png
84
- - doc/images/plugin.png
85
- - doc/images/ruby.png
86
- - doc/images/tag_green.png
87
- - doc/images/wrench.png
88
- - doc/images/wrench_orange.png
89
- - doc/images/zoom.png
90
- - doc/index.html
91
- - doc/js/darkfish.js
92
- - doc/js/jquery.js
93
- - doc/js/quicksearch.js
94
- - doc/js/thickbox-compressed.js
95
- - doc/lib/clipboard_rb.html
96
- - doc/rdoc.css
97
74
  - lib/clipboard.rb
98
75
  - version.rb
99
76
  has_rdoc: true
@@ -101,8 +78,8 @@ homepage: http://github.com/janlelis/clipboard
101
78
  licenses: []
102
79
 
103
80
  post_install_message:
104
- rdoc_options:
105
- - --charset=UTF-8
81
+ rdoc_options: []
82
+
106
83
  require_paths:
107
84
  - lib
108
85
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -110,7 +87,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
87
  requirements:
111
88
  - - ">="
112
89
  - !ruby/object:Gem::Version
113
- hash: 3
114
90
  segments:
115
91
  - 0
116
92
  version: "0"
@@ -119,7 +95,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
95
  requirements:
120
96
  - - ">="
121
97
  - !ruby/object:Gem::Version
122
- hash: 3
123
98
  segments:
124
99
  - 0
125
100
  version: "0"
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/.gitignore DELETED
@@ -1,21 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
1
- gemspec
data/doc/Clipboard.html DELETED
@@ -1,404 +0,0 @@
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</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-copy">::copy</a></li>
70
-
71
- <li><a href="#method-c-paste">::paste</a></li>
72
-
73
- <li><a href="#method-c-paste">::paste</a></li>
74
-
75
- </ul>
76
- </div>
77
-
78
-
79
- <!-- Included Modules -->
80
-
81
- </div>
82
-
83
- <div id="project-metadata">
84
-
85
-
86
- <div id="fileindex-section" class="section project-section">
87
- <h3 class="section-header">Files</h3>
88
- <ul>
89
-
90
- <li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
91
-
92
- </ul>
93
- </div>
94
-
95
-
96
- <div id="classindex-section" class="section project-section">
97
- <h3 class="section-header">Class Index
98
- <span class="search-toggle"><img src="./images/find.png"
99
- height="16" width="16" alt="[+]"
100
- title="show/hide quicksearch" /></span></h3>
101
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
102
- <fieldset>
103
- <legend>Quicksearch</legend>
104
- <input type="text" name="quicksearch" value=""
105
- class="quicksearch-field" />
106
- </fieldset>
107
- </form>
108
-
109
- <ul class="link-list">
110
-
111
- <li><a href="./Clipboard.html">Clipboard</a></li>
112
-
113
- </ul>
114
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
115
- </div>
116
-
117
-
118
- </div>
119
- </div>
120
-
121
- <div id="documentation">
122
- <h1 class="module">Clipboard</h1>
123
-
124
- <div id="description">
125
-
126
- </div>
127
-
128
- <!-- Constants -->
129
-
130
- <div id="constants-list" class="section">
131
- <h3 class="section-header">Constants</h3>
132
- <dl>
133
-
134
- <dt><a name="WriteCommands">WriteCommands</a></dt>
135
-
136
- <dd class="description"></dd>
137
-
138
-
139
- <dt><a name="CF_TEXT">CF_TEXT</a></dt>
140
-
141
- <dd class="description"></dd>
142
-
143
-
144
- <dt><a name="CLIPBOARDS">CLIPBOARDS</a></dt>
145
-
146
- <dd class="description"></dd>
147
-
148
-
149
- <dt><a name="WriteCommands">WriteCommands</a></dt>
150
-
151
- <dd class="description"></dd>
152
-
153
-
154
- <dt><a name="ReadCommand">ReadCommand</a></dt>
155
-
156
- <dd class="description"></dd>
157
-
158
-
159
- <dt><a name="CLIPBOARDS">CLIPBOARDS</a></dt>
160
-
161
- <dd class="description"></dd>
162
-
163
-
164
- <dt><a name="WriteCommands">WriteCommands</a></dt>
165
-
166
- <dd class="description"></dd>
167
-
168
-
169
- <dt><a name="ReadCommand">ReadCommand</a></dt>
170
-
171
- <dd class="description"></dd>
172
-
173
-
174
- </dl>
175
- </div>
176
-
177
-
178
- <!-- Attributes -->
179
-
180
-
181
- <!-- Methods -->
182
-
183
- <div id="public-class-method-details" class="method-section section">
184
- <h3 class="section-header">Public Class Methods</h3>
185
-
186
-
187
- <div id="clear-method" class="method-detail ">
188
- <a name="method-c-clear"></a>
189
-
190
- <div class="method-heading">
191
-
192
- <span class="method-name">clear</span><span
193
- class="method-args">()</span>
194
- <span class="method-click-advice">click to toggle source</span>
195
-
196
- </div>
197
-
198
- <div class="method-description">
199
-
200
-
201
-
202
-
203
-
204
- <div class="method-source-code"
205
- id="clear-source">
206
- <pre>
207
- <span class="ruby-comment cmt"># File lib/clipboard.rb, line 83</span>
208
- 83: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clear</span>
209
- 84: <span class="ruby-identifier">copy</span> <span class="ruby-value str">''</span>
210
- 85: <span class="ruby-keyword kw">end</span></pre>
211
- </div>
212
-
213
- </div>
214
-
215
-
216
-
217
-
218
- </div>
219
-
220
-
221
- <div id="clear-method" class="method-detail ">
222
- <a name="method-c-clear"></a>
223
-
224
- <div class="method-heading">
225
-
226
- <span class="method-name">clear</span><span
227
- class="method-args">()</span>
228
- <span class="method-click-advice">click to toggle source</span>
229
-
230
- </div>
231
-
232
- <div class="method-description">
233
-
234
-
235
-
236
-
237
-
238
- <div class="method-source-code"
239
- id="clear-source">
240
- <pre>
241
- <span class="ruby-comment cmt"># File lib/clipboard.rb, line 42</span>
242
- 42: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clear</span>
243
- 43: <span class="ruby-ivar">@open</span>[<span class="ruby-value">0</span>]
244
- 44: <span class="ruby-ivar">@empty</span>[]
245
- 45: <span class="ruby-ivar">@close</span>[]
246
- 46: <span class="ruby-identifier">paste</span>
247
- 47: <span class="ruby-keyword kw">end</span></pre>
248
- </div>
249
-
250
- </div>
251
-
252
-
253
-
254
-
255
- </div>
256
-
257
-
258
- <div id="copy-method" class="method-detail ">
259
- <a name="method-c-copy"></a>
260
-
261
- <div class="method-heading">
262
-
263
- <span class="method-name">copy</span><span
264
- class="method-args">(data)</span>
265
- <span class="method-click-advice">click to toggle source</span>
266
-
267
- </div>
268
-
269
- <div class="method-description">
270
-
271
- <p>
272
- copy for all platforms
273
- </p>
274
-
275
-
276
-
277
- <div class="method-source-code"
278
- id="copy-source">
279
- <pre>
280
- <span class="ruby-comment cmt"># File lib/clipboard.rb, line 89</span>
281
- 89: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">copy</span>(<span class="ruby-identifier">data</span>)
282
- 90: <span class="ruby-constant">WriteCommands</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">cmd</span><span class="ruby-operator">|</span>
283
- 91: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">popen</span>( <span class="ruby-identifier">cmd</span>, <span class="ruby-value str">'w'</span> ){ <span class="ruby-operator">|</span><span class="ruby-identifier">input</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> }
284
- 92: }
285
- 93: <span class="ruby-identifier">paste</span>
286
- 94: <span class="ruby-keyword kw">end</span></pre>
287
- </div>
288
-
289
- </div>
290
-
291
-
292
-
293
-
294
- </div>
295
-
296
-
297
- <div id="paste-method" class="method-detail ">
298
- <a name="method-c-paste"></a>
299
-
300
- <div class="method-heading">
301
-
302
- <span class="method-name">paste</span><span
303
- class="method-args">(which = nil)</span>
304
- <span class="method-click-advice">click to toggle source</span>
305
-
306
- </div>
307
-
308
- <div class="method-description">
309
-
310
-
311
-
312
-
313
-
314
- <div class="method-source-code"
315
- id="paste-source">
316
- <pre>
317
- <span class="ruby-comment cmt"># File lib/clipboard.rb, line 74</span>
318
- 74: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">paste</span>(<span class="ruby-identifier">which</span> = <span class="ruby-keyword kw">nil</span>)
319
- 75: <span class="ruby-identifier">selection_string</span> = <span class="ruby-keyword kw">if</span> <span class="ruby-constant">CLIPBOARDS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">which</span>.<span class="ruby-identifier">to_s</span>)
320
- 76: <span class="ruby-node">&quot; -selection #{which}&quot;</span>
321
- 77: <span class="ruby-keyword kw">else</span>
322
- 78: <span class="ruby-value str">''</span>
323
- 79: <span class="ruby-keyword kw">end</span>
324
- 80: <span class="ruby-node">%[#{ ReadCommand + selection_string }]</span>
325
- 81: <span class="ruby-keyword kw">end</span></pre>
326
- </div>
327
-
328
- </div>
329
-
330
-
331
-
332
-
333
- </div>
334
-
335
-
336
- <div id="paste-method" class="method-detail ">
337
- <a name="method-c-paste"></a>
338
-
339
- <div class="method-heading">
340
-
341
- <span class="method-name">paste</span><span
342
- class="method-args">(_=nil)</span>
343
- <span class="method-click-advice">click to toggle source</span>
344
-
345
- </div>
346
-
347
- <div class="method-description">
348
-
349
- <p>
350
- paste &amp; clear inspired by segment7.net and <a
351
- href="http://www.codeproject.com/KB/clipboard/archerclipboard1.aspx">www.codeproject.com/KB/clipboard/archerclipboard1.aspx</a>
352
- does not work on 1.9, has probably something to do with utf8 strings ?
353
- </p>
354
-
355
-
356
-
357
- <div class="method-source-code"
358
- id="paste-source">
359
- <pre>
360
- <span class="ruby-comment cmt"># File lib/clipboard.rb, line 28</span>
361
- 28: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">paste</span>(<span class="ruby-identifier">_</span>=<span class="ruby-keyword kw">nil</span>)
362
- 29: <span class="ruby-identifier">data</span> = <span class="ruby-value str">&quot;&quot;</span>
363
- 30: <span class="ruby-keyword kw">if</span> <span class="ruby-value">0</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@open</span>[ <span class="ruby-value">0</span> ]
364
- 31: <span class="ruby-identifier">hclip</span> = <span class="ruby-ivar">@get</span>[ <span class="ruby-constant">CF_TEXT</span> ]
365
- 32: <span class="ruby-keyword kw">if</span> <span class="ruby-value">0</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">hclip</span>
366
- 33: <span class="ruby-keyword kw">if</span> <span class="ruby-value">0</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">data</span> = <span class="ruby-ivar">@lock</span>[ <span class="ruby-identifier">hclip</span> ]
367
- 34: <span class="ruby-ivar">@unlock</span>[ <span class="ruby-identifier">hclip</span> ]
368
- 35: <span class="ruby-keyword kw">end</span>
369
- 36: <span class="ruby-keyword kw">end</span>
370
- 37: <span class="ruby-ivar">@close</span>[]
371
- 38: <span class="ruby-keyword kw">end</span>
372
- 39: <span class="ruby-identifier">data</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
373
- 40: <span class="ruby-keyword kw">end</span></pre>
374
- </div>
375
-
376
- </div>
377
-
378
-
379
-
380
-
381
- </div>
382
-
383
-
384
- </div>
385
-
386
-
387
- </div>
388
-
389
-
390
- <div id="rdoc-debugging-section-dump" class="debugging-section">
391
-
392
- <p>Disabled; run with --debug to generate this.</p>
393
-
394
- </div>
395
-
396
- <div id="validator-badges">
397
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
398
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
399
- Rdoc Generator</a> 1.1.6</small>.</p>
400
- </div>
401
-
402
- </body>
403
- </html>
404
-