<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> Module: Doing::Util::Backup — Documentation by YARD 0.9.34 </title> <link rel="stylesheet" href="../../css/style.css" type="text/css" /> <link rel="stylesheet" href="../../css/common.css" type="text/css" /> <script type="text/javascript"> pathId = "Doing::Util::Backup"; relpath = '../../'; </script> <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script> <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script> </head> <body> <div class="nav_wrap"> <iframe id="nav" src="../../class_list.html?1"></iframe> <div id="resizer"></div> </div> <div id="main" tabindex="-1"> <div id="header"> <div id="menu"> <a href="../../_index.html">Index (B)</a> » <span class='title'><span class='object_link'><a href="../../Doing.html" title="Doing (module)">Doing</a></span></span> » <span class='title'><span class='object_link'><a href="../Util.html" title="Doing::Util (module)">Util</a></span></span> » <span class="title">Backup</span> </div> <div id="search"> <a class="full_list_link" id="class_list_link" href="../../class_list.html"> <svg width="24" height="24"> <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect> <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect> <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect> </svg> </a> </div> <div class="clear"></div> </div> <div id="content"><h1>Module: Doing::Util::Backup </h1> <div class="box_info"> <dl> <dt>Extended by:</dt> <dd><span class='object_link'><a href="" title="Doing::Util::Backup (module)">Backup</a></span></dd> </dl> <dl> <dt>Includes:</dt> <dd><span class='object_link'><a href="../Util.html" title="Doing::Util (module)">Doing::Util</a></span></dd> </dl> <dl> <dt>Included in:</dt> <dd><span class='object_link'><a href="" title="Doing::Util::Backup (module)">Backup</a></span></dd> </dl> <dl> <dt>Defined in:</dt> <dd>lib/doing/util_backup.rb</dd> </dl> </div> <h2>Overview</h2><div class="docstring"> <div class="discussion"> <p>Backup utils</p> </div> </div> <div class="tags"> </div> <h2> Instance Method Summary <small><a href="#" class="summary_toggle">collapse</a></small> </h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="#last_backup-instance_method" title="#last_backup (instance method)">#<strong>last_backup</strong>(filename = nil, count: 1) ⇒ String </a> </span> <span class="summary_desc"><div class='inline'><p>Retrieve the most recent backup.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#prune_backups-instance_method" title="#prune_backups (instance method)">#<strong>prune_backups</strong>(filename, limit = 10) ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Delete all but most recent 5 backups.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#redo_backup-instance_method" title="#redo_backup (instance method)">#<strong>redo_backup</strong>(filename = nil, count: 1) ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Undo last undo.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#restore_last_backup-instance_method" title="#restore_last_backup (instance method)">#<strong>restore_last_backup</strong>(filename = nil, count: 1) ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Restore the most recent backup.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#select_backup-instance_method" title="#select_backup (instance method)">#<strong>select_backup</strong>(filename = nil) ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Select from recent backups.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#select_redo-instance_method" title="#select_redo (instance method)">#<strong>select_redo</strong>(filename = nil) ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Select from recent undos.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#write_backup-instance_method" title="#write_backup (instance method)">#<strong>write_backup</strong>(filename = nil) ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Writes a copy of the content to a dated backup file in a hidden directory.</p> </div></span> </li> </ul> <h3 class="inherited">Methods included from <span class='object_link'><a href="../Util.html" title="Doing::Util (module)">Doing::Util</a></span></h3> <p class="inherited"><span class='object_link'><a href="../Util.html#args_for_editor-instance_method" title="Doing::Util#args_for_editor (method)">#args_for_editor</a></span>, <span class='object_link'><a href="../Util.html#deep_merge_hashes-instance_method" title="Doing::Util#deep_merge_hashes (method)">#deep_merge_hashes</a></span>, <span class='object_link'><a href="../Util.html#deep_merge_hashes!-instance_method" title="Doing::Util#deep_merge_hashes! (method)">#deep_merge_hashes!</a></span>, <span class='object_link'><a href="../Util.html#default_editor-instance_method" title="Doing::Util#default_editor (method)">#default_editor</a></span>, <span class='object_link'><a href="../Util.html#duplicable%3F-instance_method" title="Doing::Util#duplicable? (method)">#duplicable?</a></span>, <span class='object_link'><a href="../Util.html#duplicate_frozen_values-instance_method" title="Doing::Util#duplicate_frozen_values (method)">#duplicate_frozen_values</a></span>, <span class='object_link'><a href="../Util.html#editor_with_args-instance_method" title="Doing::Util#editor_with_args (method)">#editor_with_args</a></span>, <span class='object_link'><a href="../Util.html#exec_available-instance_method" title="Doing::Util#exec_available (method)">#exec_available</a></span>, <span class='object_link'><a href="../Util.html#find_default_editor-instance_method" title="Doing::Util#find_default_editor (method)">#find_default_editor</a></span>, <span class='object_link'><a href="../Util.html#first_available_exec-instance_method" title="Doing::Util#first_available_exec (method)">#first_available_exec</a></span>, <span class='object_link'><a href="../Util.html#mergable%3F-instance_method" title="Doing::Util#mergable? (method)">#mergable?</a></span>, <span class='object_link'><a href="../Util.html#merge_default_proc-instance_method" title="Doing::Util#merge_default_proc (method)">#merge_default_proc</a></span>, <span class='object_link'><a href="../Util.html#merge_values-instance_method" title="Doing::Util#merge_values (method)">#merge_values</a></span>, <span class='object_link'><a href="../Util.html#safe_load_file-instance_method" title="Doing::Util#safe_load_file (method)">#safe_load_file</a></span>, <span class='object_link'><a href="../Util.html#user_home-instance_method" title="Doing::Util#user_home (method)">#user_home</a></span>, <span class='object_link'><a href="../Util.html#write_to_file-instance_method" title="Doing::Util#write_to_file (method)">#write_to_file</a></span></p> <div id="instance_method_details" class="method_details_list"> <h2>Instance Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="last_backup-instance_method"> #<strong>last_backup</strong>(filename = nil, count: 1) ⇒ <tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt> </h3><div class="docstring"> <div class="discussion"> <p>Retrieve the most recent backup</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>filename</span> <span class='type'></span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The filename</p> </div> </li> </ul> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span> — <div class='inline'><p>filename</p> </div> </li> </ul> </div> </div> <div class="method_details "> <h3 class="signature " id="prune_backups-instance_method"> #<strong>prune_backups</strong>(filename, limit = 10) ⇒ <tt><span class='object_link'><a href="../../Object.html" title="Object (class)">Object</a></span></tt> </h3><div class="docstring"> <div class="discussion"> <p>Delete all but most recent 5 backups</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>limit</span> <span class='type'></span> <em class="default">(defaults to: <tt>10</tt>)</em> — <div class='inline'><p>Maximum number of backups to retain</p> </div> </li> </ul> </div> </div> <div class="method_details "> <h3 class="signature " id="redo_backup-instance_method"> #<strong>redo_backup</strong>(filename = nil, count: 1) ⇒ <tt><span class='object_link'><a href="../../Object.html" title="Object (class)">Object</a></span></tt> </h3><div class="docstring"> <div class="discussion"> <p>Undo last undo</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>filename</span> <span class='type'></span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The filename</p> </div> </li> </ul> <p class="tag_title">Raises:</p> <ul class="raise"> <li> <span class='type'>(<tt>HistoryLimitError</tt>)</span> </li> </ul> </div> </div> <div class="method_details "> <h3 class="signature " id="restore_last_backup-instance_method"> #<strong>restore_last_backup</strong>(filename = nil, count: 1) ⇒ <tt><span class='object_link'><a href="../../Object.html" title="Object (class)">Object</a></span></tt> </h3><div class="docstring"> <div class="discussion"> <p>Restore the most recent backup. If a filename is provided, only backups of that filename will be used.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>filename</span> <span class='type'></span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The filename to restore, if different from default</p> </div> </li> </ul> <p class="tag_title">Raises:</p> <ul class="raise"> <li> <span class='type'>(<tt>HistoryLimitError</tt>)</span> </li> </ul> </div> </div> <div class="method_details "> <h3 class="signature " id="select_backup-instance_method"> #<strong>select_backup</strong>(filename = nil) ⇒ <tt><span class='object_link'><a href="../../Object.html" title="Object (class)">Object</a></span></tt> </h3><div class="docstring"> <div class="discussion"> <p>Select from recent backups. If a filename is provided, only backups of that filename will be used.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>filename</span> <span class='type'></span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The filename to restore</p> </div> </li> </ul> <p class="tag_title">Raises:</p> <ul class="raise"> <li> <span class='type'>(<tt>MissingBackupFile</tt>)</span> </li> </ul> </div> </div> <div class="method_details "> <h3 class="signature " id="select_redo-instance_method"> #<strong>select_redo</strong>(filename = nil) ⇒ <tt><span class='object_link'><a href="../../Object.html" title="Object (class)">Object</a></span></tt> </h3><div class="docstring"> <div class="discussion"> <p>Select from recent undos. If a filename is provided, only backups of that filename will be used.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>filename</span> <span class='type'></span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The filename to restore</p> </div> </li> </ul> <p class="tag_title">Raises:</p> <ul class="raise"> <li> <span class='type'>(<tt>HistoryLimitError</tt>)</span> </li> </ul> </div> </div> <div class="method_details "> <h3 class="signature " id="write_backup-instance_method"> #<strong>write_backup</strong>(filename = nil) ⇒ <tt><span class='object_link'><a href="../../Object.html" title="Object (class)">Object</a></span></tt> </h3><div class="docstring"> <div class="discussion"> <p>Writes a copy of the content to a dated backup file in a hidden directory</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>filename</span> <span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The filename</p> </div> </li> </ul> </div> </div> </div> </div> <div id="footer"> Generated on Thu Aug 17 09:53:01 2023 by <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.9.34 (ruby-3.2.0). </div> </div> </body> </html>