kirigami 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +7 -0
- data/Gemfile.lock +97 -94
- data/docs/Kirigami/Configuration.html +447 -0
- data/docs/Kirigami/Image.html +971 -0
- data/docs/Kirigami/Railtie.html +124 -0
- data/docs/Kirigami.html +157 -0
- data/docs/_index.html +152 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +496 -0
- data/docs/file.README.html +162 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +162 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +163 -0
- data/docs/top-level-namespace.html +110 -0
- data/kirigami.gemspec +4 -4
- data/lib/kirigami/version.rb +1 -1
- metadata +35 -16
@@ -0,0 +1,971 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Kirigami::Image
|
8
|
+
|
9
|
+
— Kirigami
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Kirigami::Image";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (I)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Kirigami.html" title="Kirigami (module)">Kirigami</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Image</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Kirigami::Image
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Kirigami::Image</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/kirigami/image.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
<p>An Image file to be compressed and cut via Kirigami</p>
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
<div class="tags">
|
110
|
+
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
117
|
+
<ul class="summary">
|
118
|
+
|
119
|
+
<li class="public ">
|
120
|
+
<span class="summary_signature">
|
121
|
+
|
122
|
+
<a href="#max_size-instance_method" title="#max_size (instance method)">#<strong>max_size</strong> ⇒ Object </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<span class="note title readonly">readonly</span>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
<span class="summary_desc"><div class='inline'><p>An ImageMagick Image Geometry for the target file size <a href="http://www.imagemagick.org/script/command-line-processing.php#geometry">http://www.imagemagick.org/script/command-line-processing.php#geometry</a>.</p>
|
142
|
+
</div></span>
|
143
|
+
|
144
|
+
</li>
|
145
|
+
|
146
|
+
|
147
|
+
<li class="public ">
|
148
|
+
<span class="summary_signature">
|
149
|
+
|
150
|
+
<a href="#path-instance_method" title="#path (instance method)">#<strong>path</strong> ⇒ Object </a>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
</span>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
<span class="note title readonly">readonly</span>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="summary_desc"><div class='inline'><p>The filepath of the image to be cut.</p>
|
170
|
+
</div></span>
|
171
|
+
|
172
|
+
</li>
|
173
|
+
|
174
|
+
|
175
|
+
</ul>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<h2>
|
182
|
+
Instance Method Summary
|
183
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
184
|
+
</h2>
|
185
|
+
|
186
|
+
<ul class="summary">
|
187
|
+
|
188
|
+
<li class="private ">
|
189
|
+
<span class="summary_signature">
|
190
|
+
|
191
|
+
<a href="#backup_filename-instance_method" title="#backup_filename (instance method)">#<strong>backup_filename</strong> ⇒ Object </a>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
</span>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
<span class="note title private">private</span>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<span class="summary_desc"><div class='inline'><p>The filename for the backup File.</p>
|
206
|
+
</div></span>
|
207
|
+
|
208
|
+
</li>
|
209
|
+
|
210
|
+
|
211
|
+
<li class="private ">
|
212
|
+
<span class="summary_signature">
|
213
|
+
|
214
|
+
<a href="#backup_filepath-instance_method" title="#backup_filepath (instance method)">#<strong>backup_filepath</strong> ⇒ Object </a>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
</span>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
<span class="note title private">private</span>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
<span class="summary_desc"><div class='inline'><p>The absolute filepath for the backup File.</p>
|
229
|
+
</div></span>
|
230
|
+
|
231
|
+
</li>
|
232
|
+
|
233
|
+
|
234
|
+
<li class="private ">
|
235
|
+
<span class="summary_signature">
|
236
|
+
|
237
|
+
<a href="#create_backup_copy-instance_method" title="#create_backup_copy (instance method)">#<strong>create_backup_copy</strong> ⇒ Object </a>
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
</span>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<span class="note title private">private</span>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
<span class="summary_desc"><div class='inline'><p>Create a backup copy of the File first.</p>
|
252
|
+
</div></span>
|
253
|
+
|
254
|
+
</li>
|
255
|
+
|
256
|
+
|
257
|
+
<li class="public ">
|
258
|
+
<span class="summary_signature">
|
259
|
+
|
260
|
+
<a href="#cut!-instance_method" title="#cut! (instance method)">#<strong>cut!</strong> ⇒ Object </a>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
</span>
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
<span class="summary_desc"><div class='inline'><p>Cuts the File down to size! Creates a backup copy first, if required.</p>
|
275
|
+
</div></span>
|
276
|
+
|
277
|
+
</li>
|
278
|
+
|
279
|
+
|
280
|
+
<li class="private ">
|
281
|
+
<span class="summary_signature">
|
282
|
+
|
283
|
+
<a href="#filename-instance_method" title="#filename (instance method)">#<strong>filename</strong> ⇒ Object </a>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
</span>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
<span class="note title private">private</span>
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<span class="summary_desc"><div class='inline'><p>The filename for the target File.</p>
|
298
|
+
</div></span>
|
299
|
+
|
300
|
+
</li>
|
301
|
+
|
302
|
+
|
303
|
+
<li class="public ">
|
304
|
+
<span class="summary_signature">
|
305
|
+
|
306
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(path, max_size) ⇒ Image </a>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
</span>
|
311
|
+
|
312
|
+
|
313
|
+
<span class="note title constructor">constructor</span>
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
<span class="summary_desc"><div class='inline'><p>Create a new Image.</p>
|
323
|
+
</div></span>
|
324
|
+
|
325
|
+
</li>
|
326
|
+
|
327
|
+
|
328
|
+
<li class="private ">
|
329
|
+
<span class="summary_signature">
|
330
|
+
|
331
|
+
<a href="#jpeg%3F-instance_method" title="#jpeg? (instance method)">#<strong>jpeg?</strong> ⇒ Boolean </a>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
</span>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
<span class="note title private">private</span>
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
<span class="summary_desc"><div class='inline'><p>Is the target File a JPEG?.</p>
|
346
|
+
</div></span>
|
347
|
+
|
348
|
+
</li>
|
349
|
+
|
350
|
+
|
351
|
+
<li class="private ">
|
352
|
+
<span class="summary_signature">
|
353
|
+
|
354
|
+
<a href="#target_filepath-instance_method" title="#target_filepath (instance method)">#<strong>target_filepath</strong> ⇒ Object </a>
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
</span>
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
<span class="note title private">private</span>
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
<span class="summary_desc"><div class='inline'><p>The absolute filepath for the target File.</p>
|
369
|
+
</div></span>
|
370
|
+
|
371
|
+
</li>
|
372
|
+
|
373
|
+
|
374
|
+
</ul>
|
375
|
+
|
376
|
+
|
377
|
+
<div id="constructor_details" class="method_details_list">
|
378
|
+
<h2>Constructor Details</h2>
|
379
|
+
|
380
|
+
<div class="method_details first">
|
381
|
+
<h3 class="signature first" id="initialize-instance_method">
|
382
|
+
|
383
|
+
#<strong>initialize</strong>(path, max_size) ⇒ <tt><span class='object_link'><a href="" title="Kirigami::Image (class)">Image</a></span></tt>
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
</h3><div class="docstring">
|
390
|
+
<div class="discussion">
|
391
|
+
<p>Create a new Image</p>
|
392
|
+
|
393
|
+
|
394
|
+
</div>
|
395
|
+
</div>
|
396
|
+
<div class="tags">
|
397
|
+
<p class="tag_title">Parameters:</p>
|
398
|
+
<ul class="param">
|
399
|
+
|
400
|
+
<li>
|
401
|
+
|
402
|
+
<span class='name'>max_size</span>
|
403
|
+
|
404
|
+
|
405
|
+
<span class='type'></span>
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
—
|
410
|
+
<div class='inline'><p>An ImageSize to specify the size and name of image.</p>
|
411
|
+
</div>
|
412
|
+
|
413
|
+
</li>
|
414
|
+
|
415
|
+
</ul>
|
416
|
+
|
417
|
+
|
418
|
+
</div><table class="source_code">
|
419
|
+
<tr>
|
420
|
+
<td>
|
421
|
+
<pre class="lines">
|
422
|
+
|
423
|
+
|
424
|
+
22
|
425
|
+
23
|
426
|
+
24
|
427
|
+
25</pre>
|
428
|
+
</td>
|
429
|
+
<td>
|
430
|
+
<pre class="code"><span class="info file"># File 'lib/kirigami/image.rb', line 22</span>
|
431
|
+
|
432
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_max_size'>max_size</span><span class='rparen'>)</span>
|
433
|
+
<span class='ivar'>@path</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
|
434
|
+
<span class='ivar'>@max_size</span> <span class='op'>=</span> <span class='id identifier rubyid_max_size'>max_size</span>
|
435
|
+
<span class='kw'>end</span></pre>
|
436
|
+
</td>
|
437
|
+
</tr>
|
438
|
+
</table>
|
439
|
+
</div>
|
440
|
+
|
441
|
+
</div>
|
442
|
+
|
443
|
+
<div id="instance_attr_details" class="attr_details">
|
444
|
+
<h2>Instance Attribute Details</h2>
|
445
|
+
|
446
|
+
|
447
|
+
<span id=""></span>
|
448
|
+
<div class="method_details first">
|
449
|
+
<h3 class="signature first" id="max_size-instance_method">
|
450
|
+
|
451
|
+
#<strong>max_size</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
</h3><div class="docstring">
|
458
|
+
<div class="discussion">
|
459
|
+
<p>An ImageMagick Image Geometry for the target file size
|
460
|
+
<a href="http://www.imagemagick.org/script/command-line-processing.php#geometry">http://www.imagemagick.org/script/command-line-processing.php#geometry</a></p>
|
461
|
+
|
462
|
+
|
463
|
+
</div>
|
464
|
+
</div>
|
465
|
+
<div class="tags">
|
466
|
+
|
467
|
+
<p class="tag_title">Returns:</p>
|
468
|
+
<ul class="return">
|
469
|
+
|
470
|
+
<li>
|
471
|
+
|
472
|
+
|
473
|
+
<span class='type'></span>
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
<div class='inline'><p>String</p>
|
479
|
+
</div>
|
480
|
+
|
481
|
+
</li>
|
482
|
+
|
483
|
+
</ul>
|
484
|
+
|
485
|
+
</div><table class="source_code">
|
486
|
+
<tr>
|
487
|
+
<td>
|
488
|
+
<pre class="lines">
|
489
|
+
|
490
|
+
|
491
|
+
10
|
492
|
+
11
|
493
|
+
12</pre>
|
494
|
+
</td>
|
495
|
+
<td>
|
496
|
+
<pre class="code"><span class="info file"># File 'lib/kirigami/image.rb', line 10</span>
|
497
|
+
|
498
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_max_size'>max_size</span>
|
499
|
+
<span class='ivar'>@max_size</span>
|
500
|
+
<span class='kw'>end</span></pre>
|
501
|
+
</td>
|
502
|
+
</tr>
|
503
|
+
</table>
|
504
|
+
</div>
|
505
|
+
|
506
|
+
|
507
|
+
<span id=""></span>
|
508
|
+
<div class="method_details ">
|
509
|
+
<h3 class="signature " id="path-instance_method">
|
510
|
+
|
511
|
+
#<strong>path</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
</h3><div class="docstring">
|
518
|
+
<div class="discussion">
|
519
|
+
<p>The filepath of the image to be cut</p>
|
520
|
+
|
521
|
+
|
522
|
+
</div>
|
523
|
+
</div>
|
524
|
+
<div class="tags">
|
525
|
+
|
526
|
+
<p class="tag_title">Returns:</p>
|
527
|
+
<ul class="return">
|
528
|
+
|
529
|
+
<li>
|
530
|
+
|
531
|
+
|
532
|
+
<span class='type'></span>
|
533
|
+
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
<div class='inline'><p>Pathname</p>
|
538
|
+
</div>
|
539
|
+
|
540
|
+
</li>
|
541
|
+
|
542
|
+
</ul>
|
543
|
+
|
544
|
+
</div><table class="source_code">
|
545
|
+
<tr>
|
546
|
+
<td>
|
547
|
+
<pre class="lines">
|
548
|
+
|
549
|
+
|
550
|
+
17
|
551
|
+
18
|
552
|
+
19</pre>
|
553
|
+
</td>
|
554
|
+
<td>
|
555
|
+
<pre class="code"><span class="info file"># File 'lib/kirigami/image.rb', line 17</span>
|
556
|
+
|
557
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span>
|
558
|
+
<span class='ivar'>@path</span>
|
559
|
+
<span class='kw'>end</span></pre>
|
560
|
+
</td>
|
561
|
+
</tr>
|
562
|
+
</table>
|
563
|
+
</div>
|
564
|
+
|
565
|
+
</div>
|
566
|
+
|
567
|
+
|
568
|
+
<div id="instance_method_details" class="method_details_list">
|
569
|
+
<h2>Instance Method Details</h2>
|
570
|
+
|
571
|
+
|
572
|
+
<div class="method_details first">
|
573
|
+
<h3 class="signature first" id="backup_filename-instance_method">
|
574
|
+
|
575
|
+
#<strong>backup_filename</strong> ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
</h3><div class="docstring">
|
582
|
+
<div class="discussion">
|
583
|
+
<p>The filename for the backup File. Uses <span class='object_link'><a href="#filename-instance_method" title="Kirigami::Image#filename (method)">#filename</a></span> + ".BAK"</p>
|
584
|
+
|
585
|
+
|
586
|
+
</div>
|
587
|
+
</div>
|
588
|
+
<div class="tags">
|
589
|
+
|
590
|
+
<p class="tag_title">Returns:</p>
|
591
|
+
<ul class="return">
|
592
|
+
|
593
|
+
<li>
|
594
|
+
|
595
|
+
|
596
|
+
<span class='type'></span>
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
<div class='inline'><p>String</p>
|
602
|
+
</div>
|
603
|
+
|
604
|
+
</li>
|
605
|
+
|
606
|
+
</ul>
|
607
|
+
|
608
|
+
</div><table class="source_code">
|
609
|
+
<tr>
|
610
|
+
<td>
|
611
|
+
<pre class="lines">
|
612
|
+
|
613
|
+
|
614
|
+
69
|
615
|
+
70
|
616
|
+
71</pre>
|
617
|
+
</td>
|
618
|
+
<td>
|
619
|
+
<pre class="code"><span class="info file"># File 'lib/kirigami/image.rb', line 69</span>
|
620
|
+
|
621
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_backup_filename'>backup_filename</span>
|
622
|
+
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>.BAK</span><span class='tstring_end'>"</span></span>
|
623
|
+
<span class='kw'>end</span></pre>
|
624
|
+
</td>
|
625
|
+
</tr>
|
626
|
+
</table>
|
627
|
+
</div>
|
628
|
+
|
629
|
+
<div class="method_details ">
|
630
|
+
<h3 class="signature " id="backup_filepath-instance_method">
|
631
|
+
|
632
|
+
#<strong>backup_filepath</strong> ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
</h3><div class="docstring">
|
639
|
+
<div class="discussion">
|
640
|
+
<p>The absolute filepath for the backup File</p>
|
641
|
+
|
642
|
+
|
643
|
+
</div>
|
644
|
+
</div>
|
645
|
+
<div class="tags">
|
646
|
+
|
647
|
+
<p class="tag_title">Returns:</p>
|
648
|
+
<ul class="return">
|
649
|
+
|
650
|
+
<li>
|
651
|
+
|
652
|
+
|
653
|
+
<span class='type'></span>
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
<div class='inline'><p>Pathname</p>
|
659
|
+
</div>
|
660
|
+
|
661
|
+
</li>
|
662
|
+
|
663
|
+
</ul>
|
664
|
+
|
665
|
+
</div><table class="source_code">
|
666
|
+
<tr>
|
667
|
+
<td>
|
668
|
+
<pre class="lines">
|
669
|
+
|
670
|
+
|
671
|
+
76
|
672
|
+
77
|
673
|
+
78</pre>
|
674
|
+
</td>
|
675
|
+
<td>
|
676
|
+
<pre class="code"><span class="info file"># File 'lib/kirigami/image.rb', line 76</span>
|
677
|
+
|
678
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_backup_filepath'>backup_filepath</span>
|
679
|
+
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_backup_filename'>backup_filename</span><span class='rparen'>)</span>
|
680
|
+
<span class='kw'>end</span></pre>
|
681
|
+
</td>
|
682
|
+
</tr>
|
683
|
+
</table>
|
684
|
+
</div>
|
685
|
+
|
686
|
+
<div class="method_details ">
|
687
|
+
<h3 class="signature " id="create_backup_copy-instance_method">
|
688
|
+
|
689
|
+
#<strong>create_backup_copy</strong> ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
690
|
+
|
691
|
+
|
692
|
+
|
693
|
+
|
694
|
+
|
695
|
+
</h3><div class="docstring">
|
696
|
+
<div class="discussion">
|
697
|
+
<p>Create a backup copy of the File first</p>
|
698
|
+
|
699
|
+
|
700
|
+
</div>
|
701
|
+
</div>
|
702
|
+
<div class="tags">
|
703
|
+
|
704
|
+
|
705
|
+
</div><table class="source_code">
|
706
|
+
<tr>
|
707
|
+
<td>
|
708
|
+
<pre class="lines">
|
709
|
+
|
710
|
+
|
711
|
+
48
|
712
|
+
49
|
713
|
+
50</pre>
|
714
|
+
</td>
|
715
|
+
<td>
|
716
|
+
<pre class="code"><span class="info file"># File 'lib/kirigami/image.rb', line 48</span>
|
717
|
+
|
718
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_create_backup_copy'>create_backup_copy</span>
|
719
|
+
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_cp'>cp</span><span class='lparen'>(</span><span class='id identifier rubyid_target_filepath'>target_filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_backup_filepath'>backup_filepath</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="../Kirigami.html" title="Kirigami (module)">Kirigami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_safe_mode'>safe_mode</span>
|
720
|
+
<span class='kw'>end</span></pre>
|
721
|
+
</td>
|
722
|
+
</tr>
|
723
|
+
</table>
|
724
|
+
</div>
|
725
|
+
|
726
|
+
<div class="method_details ">
|
727
|
+
<h3 class="signature " id="cut!-instance_method">
|
728
|
+
|
729
|
+
#<strong>cut!</strong> ⇒ <tt>Object</tt>
|
730
|
+
|
731
|
+
|
732
|
+
|
733
|
+
|
734
|
+
|
735
|
+
</h3><div class="docstring">
|
736
|
+
<div class="discussion">
|
737
|
+
<p>Cuts the File down to size! Creates a backup copy first, if required.</p>
|
738
|
+
|
739
|
+
|
740
|
+
</div>
|
741
|
+
</div>
|
742
|
+
<div class="tags">
|
743
|
+
|
744
|
+
|
745
|
+
</div><table class="source_code">
|
746
|
+
<tr>
|
747
|
+
<td>
|
748
|
+
<pre class="lines">
|
749
|
+
|
750
|
+
|
751
|
+
28
|
752
|
+
29
|
753
|
+
30
|
754
|
+
31
|
755
|
+
32
|
756
|
+
33
|
757
|
+
34
|
758
|
+
35
|
759
|
+
36
|
760
|
+
37
|
761
|
+
38
|
762
|
+
39
|
763
|
+
40
|
764
|
+
41</pre>
|
765
|
+
</td>
|
766
|
+
<td>
|
767
|
+
<pre class="code"><span class="info file"># File 'lib/kirigami/image.rb', line 28</span>
|
768
|
+
|
769
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_cut!'>cut!</span>
|
770
|
+
<span class='id identifier rubyid_create_backup_copy'>create_backup_copy</span>
|
771
|
+
<span class='const'>MiniMagick</span><span class='op'>::</span><span class='const'>Tool</span><span class='op'>::</span><span class='const'>Mogrify</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_mogrify'>mogrify</span><span class='op'>|</span>
|
772
|
+
<span class='id identifier rubyid_mogrify'>mogrify</span><span class='period'>.</span><span class='id identifier rubyid_resize'>resize</span><span class='lparen'>(</span><span class='id identifier rubyid_max_size'>max_size</span><span class='rparen'>)</span>
|
773
|
+
<span class='id identifier rubyid_mogrify'>mogrify</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
|
774
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_jpeg?'>jpeg?</span>
|
775
|
+
<span class='id identifier rubyid_mogrify'>mogrify</span><span class='period'>.</span><span class='id identifier rubyid_colorspace'>colorspace</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Kirigami.html" title="Kirigami (module)">Kirigami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_jpeg_colorspace'>jpeg_colorspace</span><span class='rparen'>)</span>
|
776
|
+
<span class='id identifier rubyid_mogrify'>mogrify</span><span class='period'>.</span><span class='id identifier rubyid_sampling_factor'>sampling_factor</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Kirigami.html" title="Kirigami (module)">Kirigami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_jpeg_sampling_factor'>jpeg_sampling_factor</span><span class='rparen'>)</span>
|
777
|
+
<span class='id identifier rubyid_mogrify'>mogrify</span><span class='period'>.</span><span class='id identifier rubyid_interlace'>interlace</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Kirigami.html" title="Kirigami (module)">Kirigami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_jpeg_interlacing'>jpeg_interlacing</span><span class='rparen'>)</span>
|
778
|
+
<span class='id identifier rubyid_mogrify'>mogrify</span><span class='period'>.</span><span class='id identifier rubyid_quality'>quality</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Kirigami.html" title="Kirigami (module)">Kirigami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_jpeg_compression_quality'>jpeg_compression_quality</span><span class='rparen'>)</span>
|
779
|
+
<span class='kw'>end</span>
|
780
|
+
<span class='id identifier rubyid_mogrify'>mogrify</span> <span class='op'><<</span> <span class='id identifier rubyid_target_filepath'>target_filepath</span>
|
781
|
+
<span class='kw'>end</span>
|
782
|
+
<span class='kw'>end</span></pre>
|
783
|
+
</td>
|
784
|
+
</tr>
|
785
|
+
</table>
|
786
|
+
</div>
|
787
|
+
|
788
|
+
<div class="method_details ">
|
789
|
+
<h3 class="signature " id="filename-instance_method">
|
790
|
+
|
791
|
+
#<strong>filename</strong> ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
|
797
|
+
</h3><div class="docstring">
|
798
|
+
<div class="discussion">
|
799
|
+
<p>The filename for the target File</p>
|
800
|
+
|
801
|
+
|
802
|
+
</div>
|
803
|
+
</div>
|
804
|
+
<div class="tags">
|
805
|
+
|
806
|
+
<p class="tag_title">Returns:</p>
|
807
|
+
<ul class="return">
|
808
|
+
|
809
|
+
<li>
|
810
|
+
|
811
|
+
|
812
|
+
<span class='type'></span>
|
813
|
+
|
814
|
+
|
815
|
+
|
816
|
+
|
817
|
+
<div class='inline'><p>String</p>
|
818
|
+
</div>
|
819
|
+
|
820
|
+
</li>
|
821
|
+
|
822
|
+
</ul>
|
823
|
+
|
824
|
+
</div><table class="source_code">
|
825
|
+
<tr>
|
826
|
+
<td>
|
827
|
+
<pre class="lines">
|
828
|
+
|
829
|
+
|
830
|
+
62
|
831
|
+
63
|
832
|
+
64</pre>
|
833
|
+
</td>
|
834
|
+
<td>
|
835
|
+
<pre class="code"><span class="info file"># File 'lib/kirigami/image.rb', line 62</span>
|
836
|
+
|
837
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_filename'>filename</span>
|
838
|
+
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
839
|
+
<span class='kw'>end</span></pre>
|
840
|
+
</td>
|
841
|
+
</tr>
|
842
|
+
</table>
|
843
|
+
</div>
|
844
|
+
|
845
|
+
<div class="method_details ">
|
846
|
+
<h3 class="signature " id="jpeg?-instance_method">
|
847
|
+
|
848
|
+
#<strong>jpeg?</strong> ⇒ <tt>Boolean</tt> <span class="extras">(private)</span>
|
849
|
+
|
850
|
+
|
851
|
+
|
852
|
+
|
853
|
+
|
854
|
+
</h3><div class="docstring">
|
855
|
+
<div class="discussion">
|
856
|
+
<p>Is the target File a JPEG?</p>
|
857
|
+
|
858
|
+
|
859
|
+
</div>
|
860
|
+
</div>
|
861
|
+
<div class="tags">
|
862
|
+
|
863
|
+
<p class="tag_title">Returns:</p>
|
864
|
+
<ul class="return">
|
865
|
+
|
866
|
+
<li>
|
867
|
+
|
868
|
+
|
869
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
870
|
+
|
871
|
+
|
872
|
+
|
873
|
+
—
|
874
|
+
<div class='inline'><p>Boolean</p>
|
875
|
+
</div>
|
876
|
+
|
877
|
+
</li>
|
878
|
+
|
879
|
+
</ul>
|
880
|
+
|
881
|
+
</div><table class="source_code">
|
882
|
+
<tr>
|
883
|
+
<td>
|
884
|
+
<pre class="lines">
|
885
|
+
|
886
|
+
|
887
|
+
83
|
888
|
+
84
|
889
|
+
85</pre>
|
890
|
+
</td>
|
891
|
+
<td>
|
892
|
+
<pre class="code"><span class="info file"># File 'lib/kirigami/image.rb', line 83</span>
|
893
|
+
|
894
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_jpeg?'>jpeg?</span>
|
895
|
+
<span class='id identifier rubyid_filename'>filename</span><span class='period'>.</span><span class='id identifier rubyid_ends_with?'>ends_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>.jpg</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
896
|
+
<span class='kw'>end</span></pre>
|
897
|
+
</td>
|
898
|
+
</tr>
|
899
|
+
</table>
|
900
|
+
</div>
|
901
|
+
|
902
|
+
<div class="method_details ">
|
903
|
+
<h3 class="signature " id="target_filepath-instance_method">
|
904
|
+
|
905
|
+
#<strong>target_filepath</strong> ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
906
|
+
|
907
|
+
|
908
|
+
|
909
|
+
|
910
|
+
|
911
|
+
</h3><div class="docstring">
|
912
|
+
<div class="discussion">
|
913
|
+
<p>The absolute filepath for the target File</p>
|
914
|
+
|
915
|
+
|
916
|
+
</div>
|
917
|
+
</div>
|
918
|
+
<div class="tags">
|
919
|
+
|
920
|
+
<p class="tag_title">Returns:</p>
|
921
|
+
<ul class="return">
|
922
|
+
|
923
|
+
<li>
|
924
|
+
|
925
|
+
|
926
|
+
<span class='type'></span>
|
927
|
+
|
928
|
+
|
929
|
+
|
930
|
+
|
931
|
+
<div class='inline'><p>Pathname</p>
|
932
|
+
</div>
|
933
|
+
|
934
|
+
</li>
|
935
|
+
|
936
|
+
</ul>
|
937
|
+
|
938
|
+
</div><table class="source_code">
|
939
|
+
<tr>
|
940
|
+
<td>
|
941
|
+
<pre class="lines">
|
942
|
+
|
943
|
+
|
944
|
+
55
|
945
|
+
56
|
946
|
+
57</pre>
|
947
|
+
</td>
|
948
|
+
<td>
|
949
|
+
<pre class="code"><span class="info file"># File 'lib/kirigami/image.rb', line 55</span>
|
950
|
+
|
951
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_target_filepath'>target_filepath</span>
|
952
|
+
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
|
953
|
+
<span class='kw'>end</span></pre>
|
954
|
+
</td>
|
955
|
+
</tr>
|
956
|
+
</table>
|
957
|
+
</div>
|
958
|
+
|
959
|
+
</div>
|
960
|
+
|
961
|
+
</div>
|
962
|
+
|
963
|
+
<div id="footer">
|
964
|
+
Generated on Thu Aug 13 16:39:31 2020 by
|
965
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
966
|
+
0.9.24 (ruby-2.6.6).
|
967
|
+
</div>
|
968
|
+
|
969
|
+
</div>
|
970
|
+
</body>
|
971
|
+
</html>
|