pwkeep 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile.lock +3 -13
- data/README.md +4 -2
- data/Rakefile +5 -0
- data/doc/PWKeep.html +323 -0
- data/doc/PWKeep/Config.html +192 -0
- data/doc/PWKeep/Editor.html +778 -0
- data/doc/PWKeep/EditorApplication.html +1221 -0
- data/doc/PWKeep/Exception.html +123 -0
- data/doc/PWKeep/Main.html +805 -0
- data/doc/PWKeep/StatusBar.html +436 -0
- data/doc/PWKeep/Storage.html +1128 -0
- data/doc/_index.html +191 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.README.html +145 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +145 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +371 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/pwkeep.rb +0 -1
- data/lib/pwkeep/editor.rb +8 -457
- data/lib/pwkeep/main.rb +36 -13
- data/lib/pwkeep/storage.rb +22 -12
- data/pwkeep.gemspec +2 -2
- metadata +26 -4
@@ -0,0 +1,778 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: PWKeep::Editor
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.6.2
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (E)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../PWKeep.html" title="PWKeep (module)">PWKeep</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Editor</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: PWKeep::Editor
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">PWKeep::Editor</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/pwkeep/editor.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
107
|
+
<ul class="summary">
|
108
|
+
|
109
|
+
<li class="public ">
|
110
|
+
<span class="summary_signature">
|
111
|
+
|
112
|
+
<a href="#file-instance_method" title="#file (instance method)">- (Object) <strong>file</strong> </a>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
</span>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<span class="note title readonly">readonly</span>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<span class="summary_desc"><div class='inline'>
|
132
|
+
<p>Returns the value of attribute file.</p>
|
133
|
+
</div></span>
|
134
|
+
|
135
|
+
</li>
|
136
|
+
|
137
|
+
|
138
|
+
<li class="public ">
|
139
|
+
<span class="summary_signature">
|
140
|
+
|
141
|
+
<a href="#history-instance_method" title="#history (instance method)">- (Object) <strong>history</strong> </a>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
</span>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
<span class="note title readonly">readonly</span>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<span class="summary_desc"><div class='inline'>
|
161
|
+
<p>Returns the value of attribute history.</p>
|
162
|
+
</div></span>
|
163
|
+
|
164
|
+
</li>
|
165
|
+
|
166
|
+
|
167
|
+
<li class="public ">
|
168
|
+
<span class="summary_signature">
|
169
|
+
|
170
|
+
<a href="#saved_content-instance_method" title="#saved_content (instance method)">- (Object) <strong>saved_content</strong> </a>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
</span>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
<span class="note title readonly">readonly</span>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
<span class="summary_desc"><div class='inline'>
|
190
|
+
<p>Returns the value of attribute saved_content.</p>
|
191
|
+
</div></span>
|
192
|
+
|
193
|
+
</li>
|
194
|
+
|
195
|
+
|
196
|
+
</ul>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<h2>
|
203
|
+
Instance Method Summary
|
204
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
205
|
+
</h2>
|
206
|
+
|
207
|
+
<ul class="summary">
|
208
|
+
|
209
|
+
<li class="public ">
|
210
|
+
<span class="summary_signature">
|
211
|
+
|
212
|
+
<a href="#content-instance_method" title="#content (instance method)">- (Object) <strong>content</strong> </a>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
</span>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
227
|
+
|
228
|
+
</li>
|
229
|
+
|
230
|
+
|
231
|
+
<li class="public ">
|
232
|
+
<span class="summary_signature">
|
233
|
+
|
234
|
+
<a href="#find-instance_method" title="#find (instance method)">- (Object) <strong>find</strong>(text) </a>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
</span>
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
249
|
+
|
250
|
+
</li>
|
251
|
+
|
252
|
+
|
253
|
+
<li class="public ">
|
254
|
+
<span class="summary_signature">
|
255
|
+
|
256
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Editor) <strong>initialize</strong>(data, options) </a>
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
</span>
|
261
|
+
|
262
|
+
|
263
|
+
<span class="note title constructor">constructor</span>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
<span class="summary_desc"><div class='inline'>
|
273
|
+
<p>A new instance of Editor.</p>
|
274
|
+
</div></span>
|
275
|
+
|
276
|
+
</li>
|
277
|
+
|
278
|
+
|
279
|
+
<li class="public ">
|
280
|
+
<span class="summary_signature">
|
281
|
+
|
282
|
+
<a href="#modified%3F-instance_method" title="#modified? (instance method)">- (Boolean) <strong>modified?</strong> </a>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
</span>
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
297
|
+
|
298
|
+
</li>
|
299
|
+
|
300
|
+
|
301
|
+
<li class="public ">
|
302
|
+
<span class="summary_signature">
|
303
|
+
|
304
|
+
<a href="#save-instance_method" title="#save (instance method)">- (Object) <strong>save</strong> </a>
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
</span>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
319
|
+
|
320
|
+
</li>
|
321
|
+
|
322
|
+
|
323
|
+
<li class="public ">
|
324
|
+
<span class="summary_signature">
|
325
|
+
|
326
|
+
<a href="#store_session-instance_method" title="#store_session (instance method)">- (Object) <strong>store_session</strong> </a>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
</span>
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
341
|
+
|
342
|
+
</li>
|
343
|
+
|
344
|
+
|
345
|
+
</ul>
|
346
|
+
|
347
|
+
|
348
|
+
<div id="constructor_details" class="method_details_list">
|
349
|
+
<h2>Constructor Details</h2>
|
350
|
+
|
351
|
+
<div class="method_details first">
|
352
|
+
<h3 class="signature first" id="initialize-instance_method">
|
353
|
+
|
354
|
+
- (<tt><span class='object_link'><a href="" title="PWKeep::Editor (class)">Editor</a></span></tt>) <strong>initialize</strong>(data, options)
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
</h3><div class="docstring">
|
361
|
+
<div class="discussion">
|
362
|
+
|
363
|
+
<p>A new instance of Editor</p>
|
364
|
+
|
365
|
+
|
366
|
+
</div>
|
367
|
+
</div>
|
368
|
+
<div class="tags">
|
369
|
+
|
370
|
+
|
371
|
+
</div><table class="source_code">
|
372
|
+
<tr>
|
373
|
+
<td>
|
374
|
+
<pre class="lines">
|
375
|
+
|
376
|
+
|
377
|
+
357
|
378
|
+
358
|
379
|
+
359
|
380
|
+
360
|
381
|
+
361
|
382
|
+
362
|
383
|
+
363
|
384
|
+
364
|
385
|
+
365
|
386
|
+
366
|
387
|
+
367
|
388
|
+
368
|
389
|
+
369
|
390
|
+
370
|
391
|
+
371
|
392
|
+
372
|
393
|
+
373</pre>
|
394
|
+
</td>
|
395
|
+
<td>
|
396
|
+
<pre class="code"><span class="info file"># File 'lib/pwkeep/editor.rb', line 357</span>
|
397
|
+
|
398
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
399
|
+
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
|
400
|
+
|
401
|
+
<span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span>
|
402
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:language</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='const'>LanguageSniffer</span><span class='period'>.</span><span class='id identifier rubyid_detect'>detect</span><span class='lparen'>(</span><span class='ivar'>@file</span><span class='comma'>,</span> <span class='symbol'>:content</span> <span class='op'>=></span> <span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_language'>language</span>
|
403
|
+
<span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_tabs_to_spaces!'>tabs_to_spaces!</span> <span class='kw'>if</span> <span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:convert_tabs</span><span class='rbracket'>]</span>
|
404
|
+
|
405
|
+
<span class='comment'># cleanup newline formats
|
406
|
+
</span> <span class='ivar'>@newline</span> <span class='op'>=</span> <span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\r\n|\r|\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
407
|
+
<span class='ivar'>@newline</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='ivar'>@newline</span> <span class='op'>?</span> <span class='ivar'>@newline</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
408
|
+
<span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_gsub!'>gsub!</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\r\n?</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
409
|
+
|
410
|
+
<span class='ivar'>@saved_content</span> <span class='op'>=</span> <span class='id identifier rubyid_content'>content</span>
|
411
|
+
<span class='ivar'>@text_area</span> <span class='op'>=</span> <span class='const'>Ruco</span><span class='op'>::</span><span class='const'>EditorArea</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='ivar'>@options</span><span class='rparen'>)</span>
|
412
|
+
<span class='ivar'>@history</span> <span class='op'>=</span> <span class='ivar'>@text_area</span><span class='period'>.</span><span class='id identifier rubyid_history'>history</span>
|
413
|
+
<span class='id identifier rubyid_restore_session'>restore_session</span>
|
414
|
+
<span class='kw'>end</span></pre>
|
415
|
+
</td>
|
416
|
+
</tr>
|
417
|
+
</table>
|
418
|
+
</div>
|
419
|
+
|
420
|
+
</div>
|
421
|
+
|
422
|
+
<div id="instance_attr_details" class="attr_details">
|
423
|
+
<h2>Instance Attribute Details</h2>
|
424
|
+
|
425
|
+
|
426
|
+
<span id=""></span>
|
427
|
+
<div class="method_details first">
|
428
|
+
<h3 class="signature first" id="file-instance_method">
|
429
|
+
|
430
|
+
- (<tt>Object</tt>) <strong>file</strong> <span class="extras">(readonly)</span>
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
</h3><div class="docstring">
|
437
|
+
<div class="discussion">
|
438
|
+
|
439
|
+
<p>Returns the value of attribute file</p>
|
440
|
+
|
441
|
+
|
442
|
+
</div>
|
443
|
+
</div>
|
444
|
+
<div class="tags">
|
445
|
+
|
446
|
+
|
447
|
+
</div><table class="source_code">
|
448
|
+
<tr>
|
449
|
+
<td>
|
450
|
+
<pre class="lines">
|
451
|
+
|
452
|
+
|
453
|
+
344
|
454
|
+
345
|
455
|
+
346</pre>
|
456
|
+
</td>
|
457
|
+
<td>
|
458
|
+
<pre class="code"><span class="info file"># File 'lib/pwkeep/editor.rb', line 344</span>
|
459
|
+
|
460
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_file'>file</span>
|
461
|
+
<span class='ivar'>@file</span>
|
462
|
+
<span class='kw'>end</span></pre>
|
463
|
+
</td>
|
464
|
+
</tr>
|
465
|
+
</table>
|
466
|
+
</div>
|
467
|
+
|
468
|
+
|
469
|
+
<span id=""></span>
|
470
|
+
<div class="method_details ">
|
471
|
+
<h3 class="signature " id="history-instance_method">
|
472
|
+
|
473
|
+
- (<tt>Object</tt>) <strong>history</strong> <span class="extras">(readonly)</span>
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
</h3><div class="docstring">
|
480
|
+
<div class="discussion">
|
481
|
+
|
482
|
+
<p>Returns the value of attribute history</p>
|
483
|
+
|
484
|
+
|
485
|
+
</div>
|
486
|
+
</div>
|
487
|
+
<div class="tags">
|
488
|
+
|
489
|
+
|
490
|
+
</div><table class="source_code">
|
491
|
+
<tr>
|
492
|
+
<td>
|
493
|
+
<pre class="lines">
|
494
|
+
|
495
|
+
|
496
|
+
346
|
497
|
+
347
|
498
|
+
348</pre>
|
499
|
+
</td>
|
500
|
+
<td>
|
501
|
+
<pre class="code"><span class="info file"># File 'lib/pwkeep/editor.rb', line 346</span>
|
502
|
+
|
503
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_history'>history</span>
|
504
|
+
<span class='ivar'>@history</span>
|
505
|
+
<span class='kw'>end</span></pre>
|
506
|
+
</td>
|
507
|
+
</tr>
|
508
|
+
</table>
|
509
|
+
</div>
|
510
|
+
|
511
|
+
|
512
|
+
<span id=""></span>
|
513
|
+
<div class="method_details ">
|
514
|
+
<h3 class="signature " id="saved_content-instance_method">
|
515
|
+
|
516
|
+
- (<tt>Object</tt>) <strong>saved_content</strong> <span class="extras">(readonly)</span>
|
517
|
+
|
518
|
+
|
519
|
+
|
520
|
+
|
521
|
+
|
522
|
+
</h3><div class="docstring">
|
523
|
+
<div class="discussion">
|
524
|
+
|
525
|
+
<p>Returns the value of attribute saved_content</p>
|
526
|
+
|
527
|
+
|
528
|
+
</div>
|
529
|
+
</div>
|
530
|
+
<div class="tags">
|
531
|
+
|
532
|
+
|
533
|
+
</div><table class="source_code">
|
534
|
+
<tr>
|
535
|
+
<td>
|
536
|
+
<pre class="lines">
|
537
|
+
|
538
|
+
|
539
|
+
347
|
540
|
+
348
|
541
|
+
349</pre>
|
542
|
+
</td>
|
543
|
+
<td>
|
544
|
+
<pre class="code"><span class="info file"># File 'lib/pwkeep/editor.rb', line 347</span>
|
545
|
+
|
546
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_saved_content'>saved_content</span>
|
547
|
+
<span class='ivar'>@saved_content</span>
|
548
|
+
<span class='kw'>end</span></pre>
|
549
|
+
</td>
|
550
|
+
</tr>
|
551
|
+
</table>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
</div>
|
555
|
+
|
556
|
+
|
557
|
+
<div id="instance_method_details" class="method_details_list">
|
558
|
+
<h2>Instance Method Details</h2>
|
559
|
+
|
560
|
+
|
561
|
+
<div class="method_details first">
|
562
|
+
<h3 class="signature first" id="content-instance_method">
|
563
|
+
|
564
|
+
- (<tt>Object</tt>) <strong>content</strong>
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
</h3><table class="source_code">
|
571
|
+
<tr>
|
572
|
+
<td>
|
573
|
+
<pre class="lines">
|
574
|
+
|
575
|
+
|
576
|
+
408
|
577
|
+
409
|
578
|
+
410</pre>
|
579
|
+
</td>
|
580
|
+
<td>
|
581
|
+
<pre class="code"><span class="info file"># File 'lib/pwkeep/editor.rb', line 408</span>
|
582
|
+
|
583
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_content'>content</span>
|
584
|
+
<span class='id identifier rubyid_text_area'>text_area</span><span class='period'>.</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span> <span class='comment'># no modifications allowed
|
585
|
+
</span><span class='kw'>end</span></pre>
|
586
|
+
</td>
|
587
|
+
</tr>
|
588
|
+
</table>
|
589
|
+
</div>
|
590
|
+
|
591
|
+
<div class="method_details ">
|
592
|
+
<h3 class="signature " id="find-instance_method">
|
593
|
+
|
594
|
+
- (<tt>Object</tt>) <strong>find</strong>(text)
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
</h3><table class="source_code">
|
601
|
+
<tr>
|
602
|
+
<td>
|
603
|
+
<pre class="lines">
|
604
|
+
|
605
|
+
|
606
|
+
375
|
607
|
+
376
|
608
|
+
377
|
609
|
+
378
|
610
|
+
379
|
611
|
+
380
|
612
|
+
381
|
613
|
+
382
|
614
|
+
383
|
615
|
+
384
|
616
|
+
385
|
617
|
+
386</pre>
|
618
|
+
</td>
|
619
|
+
<td>
|
620
|
+
<pre class="code"><span class="info file"># File 'lib/pwkeep/editor.rb', line 375</span>
|
621
|
+
|
622
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
|
623
|
+
<span class='id identifier rubyid_move'>move</span><span class='lparen'>(</span><span class='symbol'>:relative</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span><span class='int'>0</span><span class='rparen'>)</span> <span class='comment'># reset selection
|
624
|
+
</span> <span class='id identifier rubyid_start'>start</span> <span class='op'>=</span> <span class='id identifier rubyid_text_area'>text_area</span><span class='period'>.</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='comma'>,</span> <span class='id identifier rubyid_text_area'>text_area</span><span class='period'>.</span><span class='id identifier rubyid_index_for_position'>index_for_position</span><span class='op'>+</span><span class='int'>1</span><span class='rparen'>)</span>
|
625
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_start'>start</span>
|
626
|
+
|
627
|
+
<span class='comment'># select the found word
|
628
|
+
</span> <span class='id identifier rubyid_finish'>finish</span> <span class='op'>=</span> <span class='id identifier rubyid_start'>start</span> <span class='op'>+</span> <span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
|
629
|
+
<span class='id identifier rubyid_move'>move</span><span class='lparen'>(</span><span class='symbol'>:to_index</span><span class='comma'>,</span> <span class='id identifier rubyid_finish'>finish</span><span class='rparen'>)</span>
|
630
|
+
<span class='id identifier rubyid_selecting'>selecting</span><span class='lbrace'>{</span> <span class='id identifier rubyid_move'>move</span><span class='lparen'>(</span><span class='symbol'>:to_index</span><span class='comma'>,</span> <span class='id identifier rubyid_start'>start</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
631
|
+
|
632
|
+
<span class='kw'>true</span>
|
633
|
+
<span class='kw'>end</span></pre>
|
634
|
+
</td>
|
635
|
+
</tr>
|
636
|
+
</table>
|
637
|
+
</div>
|
638
|
+
|
639
|
+
<div class="method_details ">
|
640
|
+
<h3 class="signature " id="modified?-instance_method">
|
641
|
+
|
642
|
+
- (<tt>Boolean</tt>) <strong>modified?</strong>
|
643
|
+
|
644
|
+
|
645
|
+
|
646
|
+
|
647
|
+
|
648
|
+
</h3><div class="docstring">
|
649
|
+
<div class="discussion">
|
650
|
+
|
651
|
+
|
652
|
+
</div>
|
653
|
+
</div>
|
654
|
+
<div class="tags">
|
655
|
+
|
656
|
+
<p class="tag_title">Returns:</p>
|
657
|
+
<ul class="return">
|
658
|
+
|
659
|
+
<li>
|
660
|
+
|
661
|
+
|
662
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
</li>
|
667
|
+
|
668
|
+
</ul>
|
669
|
+
|
670
|
+
</div><table class="source_code">
|
671
|
+
<tr>
|
672
|
+
<td>
|
673
|
+
<pre class="lines">
|
674
|
+
|
675
|
+
|
676
|
+
388
|
677
|
+
389
|
678
|
+
390</pre>
|
679
|
+
</td>
|
680
|
+
<td>
|
681
|
+
<pre class="code"><span class="info file"># File 'lib/pwkeep/editor.rb', line 388</span>
|
682
|
+
|
683
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_modified?'>modified?</span>
|
684
|
+
<span class='ivar'>@saved_content</span> <span class='op'>!=</span> <span class='id identifier rubyid_text_area'>text_area</span><span class='period'>.</span><span class='id identifier rubyid_content'>content</span>
|
685
|
+
<span class='kw'>end</span></pre>
|
686
|
+
</td>
|
687
|
+
</tr>
|
688
|
+
</table>
|
689
|
+
</div>
|
690
|
+
|
691
|
+
<div class="method_details ">
|
692
|
+
<h3 class="signature " id="save-instance_method">
|
693
|
+
|
694
|
+
- (<tt>Object</tt>) <strong>save</strong>
|
695
|
+
|
696
|
+
|
697
|
+
|
698
|
+
|
699
|
+
|
700
|
+
</h3><table class="source_code">
|
701
|
+
<tr>
|
702
|
+
<td>
|
703
|
+
<pre class="lines">
|
704
|
+
|
705
|
+
|
706
|
+
392
|
707
|
+
393
|
708
|
+
394
|
709
|
+
395
|
710
|
+
396
|
711
|
+
397
|
712
|
+
398
|
713
|
+
399
|
714
|
+
400
|
715
|
+
401
|
716
|
+
402
|
717
|
+
403</pre>
|
718
|
+
</td>
|
719
|
+
<td>
|
720
|
+
<pre class="code"><span class="info file"># File 'lib/pwkeep/editor.rb', line 392</span>
|
721
|
+
|
722
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_save'>save</span>
|
723
|
+
<span class='id identifier rubyid_lines'>lines</span> <span class='op'>=</span> <span class='id identifier rubyid_text_area'>text_area</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:lines</span><span class='rparen'>)</span>
|
724
|
+
<span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:rstrip!</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:remove_trailing_whitespace_on_save</span><span class='rbracket'>]</span>
|
725
|
+
<span class='id identifier rubyid_lines'>lines</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:blank_line_before_eof_on_save</span><span class='rbracket'>]</span> <span class='kw'>and</span> <span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>!~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\s*$</span><span class='regexp_end'>/</span></span>
|
726
|
+
<span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='id identifier rubyid_lines'>lines</span> <span class='op'>*</span> <span class='ivar'>@newline</span>
|
727
|
+
|
728
|
+
<span class='ivar'>@saved_content</span> <span class='op'>=</span> <span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\r?\n</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
729
|
+
|
730
|
+
<span class='kw'>true</span>
|
731
|
+
<span class='kw'>rescue</span> <span class='const'>Object</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
732
|
+
<span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span>
|
733
|
+
<span class='kw'>end</span></pre>
|
734
|
+
</td>
|
735
|
+
</tr>
|
736
|
+
</table>
|
737
|
+
</div>
|
738
|
+
|
739
|
+
<div class="method_details ">
|
740
|
+
<h3 class="signature " id="store_session-instance_method">
|
741
|
+
|
742
|
+
- (<tt>Object</tt>) <strong>store_session</strong>
|
743
|
+
|
744
|
+
|
745
|
+
|
746
|
+
|
747
|
+
|
748
|
+
</h3><table class="source_code">
|
749
|
+
<tr>
|
750
|
+
<td>
|
751
|
+
<pre class="lines">
|
752
|
+
|
753
|
+
|
754
|
+
405
|
755
|
+
406</pre>
|
756
|
+
</td>
|
757
|
+
<td>
|
758
|
+
<pre class="code"><span class="info file"># File 'lib/pwkeep/editor.rb', line 405</span>
|
759
|
+
|
760
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_store_session'>store_session</span>
|
761
|
+
<span class='kw'>end</span></pre>
|
762
|
+
</td>
|
763
|
+
</tr>
|
764
|
+
</table>
|
765
|
+
</div>
|
766
|
+
|
767
|
+
</div>
|
768
|
+
|
769
|
+
</div>
|
770
|
+
|
771
|
+
<div id="footer">
|
772
|
+
Generated on Thu Jan 9 16:06:07 2014 by
|
773
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
774
|
+
0.8.6.2 (ruby-1.9.3).
|
775
|
+
</div>
|
776
|
+
|
777
|
+
</body>
|
778
|
+
</html>
|