syc-backup 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/README.rdoc +48 -0
  2. data/Rakefile +7 -0
  3. data/bin/sycbackup +6 -0
  4. data/doc/Backup.html +186 -0
  5. data/doc/Backup/CronEdit.html +381 -0
  6. data/doc/Backup/Environment.html +231 -0
  7. data/doc/Backup/FileBackup.html +363 -0
  8. data/doc/Backup/MySQLBackup.html +305 -0
  9. data/doc/Backup/Options.html +328 -0
  10. data/doc/Backup/Process.html +261 -0
  11. data/doc/Backup/Runner.html +244 -0
  12. data/doc/README_rdoc.html +202 -0
  13. data/doc/Rakefile.html +118 -0
  14. data/doc/TestCronEdit.html +211 -0
  15. data/doc/TestEnvironment.html +156 -0
  16. data/doc/TestFileBackup.html +237 -0
  17. data/doc/TestMySQLBackup.html +167 -0
  18. data/doc/TestOptions.html +156 -0
  19. data/doc/TestProcess.html +236 -0
  20. data/doc/created.rid +18 -0
  21. data/doc/images/add.png +0 -0
  22. data/doc/images/brick.png +0 -0
  23. data/doc/images/brick_link.png +0 -0
  24. data/doc/images/bug.png +0 -0
  25. data/doc/images/bullet_black.png +0 -0
  26. data/doc/images/bullet_toggle_minus.png +0 -0
  27. data/doc/images/bullet_toggle_plus.png +0 -0
  28. data/doc/images/date.png +0 -0
  29. data/doc/images/delete.png +0 -0
  30. data/doc/images/find.png +0 -0
  31. data/doc/images/loadingAnimation.gif +0 -0
  32. data/doc/images/macFFBgHack.png +0 -0
  33. data/doc/images/package.png +0 -0
  34. data/doc/images/page_green.png +0 -0
  35. data/doc/images/page_white_text.png +0 -0
  36. data/doc/images/page_white_width.png +0 -0
  37. data/doc/images/plugin.png +0 -0
  38. data/doc/images/ruby.png +0 -0
  39. data/doc/images/tag_blue.png +0 -0
  40. data/doc/images/tag_green.png +0 -0
  41. data/doc/images/transparent.png +0 -0
  42. data/doc/images/wrench.png +0 -0
  43. data/doc/images/wrench_orange.png +0 -0
  44. data/doc/images/zoom.png +0 -0
  45. data/doc/index.html +106 -0
  46. data/doc/js/darkfish.js +153 -0
  47. data/doc/js/jquery.js +18 -0
  48. data/doc/js/navigation.js +142 -0
  49. data/doc/js/search.js +94 -0
  50. data/doc/js/search_index.js +1 -0
  51. data/doc/js/searcher.js +228 -0
  52. data/doc/rdoc.css +543 -0
  53. data/doc/table_of_contents.html +148 -0
  54. data/lib/backup/cron_edit.rb +127 -0
  55. data/lib/backup/environment.rb +44 -0
  56. data/lib/backup/file_backup.rb +94 -0
  57. data/lib/backup/mysql_backup.rb +58 -0
  58. data/lib/backup/options.rb +199 -0
  59. data/lib/backup/process.rb +99 -0
  60. data/lib/backup/runner.rb +79 -0
  61. data/lib/backup_version.rb +9 -0
  62. data/syc-backup-0.0.1.gem +0 -0
  63. data/syc-backup-0.0.3.gem +0 -0
  64. data/sycbackup.gemspec +20 -0
  65. data/test/test_cron_edit.rb +49 -0
  66. data/test/test_environment.rb +22 -0
  67. data/test/test_file_backup.rb +70 -0
  68. data/test/test_mysql_backup.rb +71 -0
  69. data/test/test_options.rb +189 -0
  70. data/test/test_process.rb +40 -0
  71. metadata +123 -0
@@ -0,0 +1,261 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class Backup::Process - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../index.html">Home</a>
28
+ <a href="../table_of_contents.html#classes">Classes</a>
29
+ <a href="../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/backup/process.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link">Object
63
+
64
+ </nav>
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <nav id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+
71
+ <ul class="link-list">
72
+
73
+ <li><a href="#method-c-new">::new</a>
74
+
75
+ <li><a href="#method-i-backup">#backup</a>
76
+
77
+ </ul>
78
+ </nav>
79
+
80
+ </div>
81
+
82
+ <div id="project-metadata">
83
+ <nav id="fileindex-section" class="section project-section">
84
+ <h3 class="section-header">Pages</h3>
85
+
86
+ <ul>
87
+
88
+ <li class="file"><a href="../README_rdoc.html">README</a>
89
+
90
+ <li class="file"><a href="../Rakefile.html">Rakefile</a>
91
+
92
+ </ul>
93
+ </nav>
94
+
95
+ <nav id="classindex-section" class="section project-section">
96
+ <h3 class="section-header">Class and Module Index</h3>
97
+
98
+ <ul class="link-list">
99
+
100
+ <li><a href="../Backup.html">Backup</a>
101
+
102
+ <li><a href="../Backup/CronEdit.html">Backup::CronEdit</a>
103
+
104
+ <li><a href="../Backup/Environment.html">Backup::Environment</a>
105
+
106
+ <li><a href="../Backup/FileBackup.html">Backup::FileBackup</a>
107
+
108
+ <li><a href="../Backup/MySQLBackup.html">Backup::MySQLBackup</a>
109
+
110
+ <li><a href="../Backup/Options.html">Backup::Options</a>
111
+
112
+ <li><a href="../Backup/Process.html">Backup::Process</a>
113
+
114
+ <li><a href="../Backup/Runner.html">Backup::Runner</a>
115
+
116
+ <li><a href="../TestCronEdit.html">TestCronEdit</a>
117
+
118
+ <li><a href="../TestEnvironment.html">TestEnvironment</a>
119
+
120
+ <li><a href="../TestFileBackup.html">TestFileBackup</a>
121
+
122
+ <li><a href="../TestMySQLBackup.html">TestMySQLBackup</a>
123
+
124
+ <li><a href="../TestOptions.html">TestOptions</a>
125
+
126
+ <li><a href="../TestProcess.html">TestProcess</a>
127
+
128
+ </ul>
129
+ </nav>
130
+
131
+ </div>
132
+ </nav>
133
+
134
+ <div id="documentation">
135
+ <h1 class="class">class Backup::Process</h1>
136
+
137
+ <div id="description" class="description">
138
+
139
+ <p>Conducts the backups of a MySQL database and files.</p>
140
+
141
+ </div><!-- description -->
142
+
143
+
144
+
145
+
146
+ <section id="5Buntitled-5D" class="documentation-section">
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+ <!-- Methods -->
156
+
157
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
158
+ <h3 class="section-header">Public Class Methods</h3>
159
+
160
+
161
+ <div id="method-c-new" class="method-detail ">
162
+
163
+ <div class="method-heading">
164
+ <span class="method-name">new</span><span
165
+ class="method-args">(backup_folder, files, override, no_compress)</span>
166
+ <span class="method-click-advice">click to toggle source</span>
167
+ </div>
168
+
169
+
170
+ <div class="method-description">
171
+
172
+ <p>Takes the backup_folder where the files are backed up to. If override is
173
+ provided the files in the backup folder are overridden. no_compress will
174
+ prevent compressing the backed up files and will just copy them to the
175
+ provided backup folder</p>
176
+
177
+
178
+
179
+ <div class="method-source-code" id="new-source">
180
+ <pre><span class="ruby-comment"># File lib/backup/process.rb, line 17</span>
181
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">backup_folder</span>, <span class="ruby-identifier">files</span>, <span class="ruby-identifier">override</span>, <span class="ruby-identifier">no_compress</span>)
182
+ <span class="ruby-ivar">@backup_folder</span> = <span class="ruby-identifier">backup_folder</span>
183
+ <span class="ruby-ivar">@files</span> = <span class="ruby-identifier">files</span>
184
+ <span class="ruby-ivar">@override</span> = <span class="ruby-identifier">override</span>
185
+ <span class="ruby-ivar">@no_compress</span> = <span class="ruby-identifier">no_compress</span>
186
+ <span class="ruby-keyword">end</span></pre>
187
+ </div><!-- new-source -->
188
+
189
+ </div>
190
+
191
+
192
+
193
+
194
+ </div><!-- new-method -->
195
+
196
+
197
+ </section><!-- public-class-method-details -->
198
+
199
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
200
+ <h3 class="section-header">Public Instance Methods</h3>
201
+
202
+
203
+ <div id="method-i-backup" class="method-detail ">
204
+
205
+ <div class="method-heading">
206
+ <span class="method-name">backup</span><span
207
+ class="method-args">()</span>
208
+ <span class="method-click-advice">click to toggle source</span>
209
+ </div>
210
+
211
+
212
+ <div class="method-description">
213
+
214
+ <p>Creates the backup of the database and the files. If at least one of the
215
+ provided files doesn’t exist the application will print an error message
216
+ with the inexistent files and terminates</p>
217
+
218
+
219
+
220
+ <div class="method-source-code" id="backup-source">
221
+ <pre><span class="ruby-comment"># File lib/backup/process.rb, line 27</span>
222
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">backup</span>
223
+ <span class="ruby-identifier">inexistent_files</span> = <span class="ruby-identifier">check_for_inexistent_files</span>
224
+ <span class="ruby-keyword">unless</span> <span class="ruby-identifier">inexistent_files</span>.<span class="ruby-identifier">empty?</span>
225
+ <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Cannot backup inexistent files&quot;</span>
226
+ <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">inexistent_files</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot; &quot;</span>)
227
+ <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
228
+ <span class="ruby-keyword">end</span>
229
+
230
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span> <span class="ruby-ivar">@backup_folder</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-ivar">@backup_folder</span>
231
+
232
+ <span class="ruby-keyword">if</span> <span class="ruby-ivar">@no_compress</span>
233
+ <span class="ruby-identifier">copy_files</span>
234
+ <span class="ruby-keyword">else</span>
235
+ <span class="ruby-identifier">compress_files_and_copy</span>
236
+ <span class="ruby-keyword">end</span>
237
+
238
+ <span class="ruby-keyword">end</span></pre>
239
+ </div><!-- backup-source -->
240
+
241
+ </div>
242
+
243
+
244
+
245
+
246
+ </div><!-- backup-method -->
247
+
248
+
249
+ </section><!-- public-instance-method-details -->
250
+
251
+ </section><!-- 5Buntitled-5D -->
252
+
253
+ </div><!-- documentation -->
254
+
255
+
256
+ <footer id="validator-badges">
257
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
258
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
259
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
260
+ </footer>
261
+
@@ -0,0 +1,244 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class Backup::Runner - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../index.html">Home</a>
28
+ <a href="../table_of_contents.html#classes">Classes</a>
29
+ <a href="../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/backup/runner.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link">Object
63
+
64
+ </nav>
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <nav id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+
71
+ <ul class="link-list">
72
+
73
+ <li><a href="#method-c-new">::new</a>
74
+
75
+ <li><a href="#method-i-run">#run</a>
76
+
77
+ </ul>
78
+ </nav>
79
+
80
+ </div>
81
+
82
+ <div id="project-metadata">
83
+ <nav id="fileindex-section" class="section project-section">
84
+ <h3 class="section-header">Pages</h3>
85
+
86
+ <ul>
87
+
88
+ <li class="file"><a href="../README_rdoc.html">README</a>
89
+
90
+ <li class="file"><a href="../Rakefile.html">Rakefile</a>
91
+
92
+ </ul>
93
+ </nav>
94
+
95
+ <nav id="classindex-section" class="section project-section">
96
+ <h3 class="section-header">Class and Module Index</h3>
97
+
98
+ <ul class="link-list">
99
+
100
+ <li><a href="../Backup.html">Backup</a>
101
+
102
+ <li><a href="../Backup/CronEdit.html">Backup::CronEdit</a>
103
+
104
+ <li><a href="../Backup/Environment.html">Backup::Environment</a>
105
+
106
+ <li><a href="../Backup/FileBackup.html">Backup::FileBackup</a>
107
+
108
+ <li><a href="../Backup/MySQLBackup.html">Backup::MySQLBackup</a>
109
+
110
+ <li><a href="../Backup/Options.html">Backup::Options</a>
111
+
112
+ <li><a href="../Backup/Process.html">Backup::Process</a>
113
+
114
+ <li><a href="../Backup/Runner.html">Backup::Runner</a>
115
+
116
+ <li><a href="../TestCronEdit.html">TestCronEdit</a>
117
+
118
+ <li><a href="../TestEnvironment.html">TestEnvironment</a>
119
+
120
+ <li><a href="../TestFileBackup.html">TestFileBackup</a>
121
+
122
+ <li><a href="../TestMySQLBackup.html">TestMySQLBackup</a>
123
+
124
+ <li><a href="../TestOptions.html">TestOptions</a>
125
+
126
+ <li><a href="../TestProcess.html">TestProcess</a>
127
+
128
+ </ul>
129
+ </nav>
130
+
131
+ </div>
132
+ </nav>
133
+
134
+ <div id="documentation">
135
+ <h1 class="class">class Backup::Runner</h1>
136
+
137
+ <div id="description" class="description">
138
+
139
+ <p>Is invoked from the command line application and invokes the application’s
140
+ optons as provided by the user on the command line</p>
141
+
142
+ </div><!-- description -->
143
+
144
+
145
+
146
+
147
+ <section id="5Buntitled-5D" class="documentation-section">
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ <!-- Methods -->
157
+
158
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
159
+ <h3 class="section-header">Public Class Methods</h3>
160
+
161
+
162
+ <div id="method-c-new" class="method-detail ">
163
+
164
+ <div class="method-heading">
165
+ <span class="method-name">new</span><span
166
+ class="method-args">(argv)</span>
167
+ <span class="method-click-advice">click to toggle source</span>
168
+ </div>
169
+
170
+
171
+ <div class="method-description">
172
+
173
+ <p>Takes the command line options and parses them</p>
174
+
175
+
176
+
177
+ <div class="method-source-code" id="new-source">
178
+ <pre><span class="ruby-comment"># File lib/backup/runner.rb, line 14</span>
179
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">argv</span>)
180
+ <span class="ruby-ivar">@options</span> = <span class="ruby-constant">Options</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">argv</span>)
181
+ <span class="ruby-keyword">end</span></pre>
182
+ </div><!-- new-source -->
183
+
184
+ </div>
185
+
186
+
187
+
188
+
189
+ </div><!-- new-method -->
190
+
191
+
192
+ </section><!-- public-class-method-details -->
193
+
194
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
195
+ <h3 class="section-header">Public Instance Methods</h3>
196
+
197
+
198
+ <div id="method-i-run" class="method-detail ">
199
+
200
+ <div class="method-heading">
201
+ <span class="method-name">run</span><span
202
+ class="method-args">()</span>
203
+ <span class="method-click-advice">click to toggle source</span>
204
+ </div>
205
+
206
+
207
+ <div class="method-description">
208
+
209
+ <p>Operates on the options and invokes the respective functions</p>
210
+
211
+
212
+
213
+ <div class="method-source-code" id="run-source">
214
+ <pre><span class="ruby-comment"># File lib/backup/runner.rb, line 19</span>
215
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">run</span>
216
+ <span class="ruby-keyword">if</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">cron</span>
217
+ <span class="ruby-identifier">create_cron</span>
218
+ <span class="ruby-keyword">else</span>
219
+ <span class="ruby-identifier">create_backup</span>
220
+ <span class="ruby-keyword">end</span>
221
+ <span class="ruby-keyword">end</span></pre>
222
+ </div><!-- run-source -->
223
+
224
+ </div>
225
+
226
+
227
+
228
+
229
+ </div><!-- run-method -->
230
+
231
+
232
+ </section><!-- public-instance-method-details -->
233
+
234
+ </section><!-- 5Buntitled-5D -->
235
+
236
+ </div><!-- documentation -->
237
+
238
+
239
+ <footer id="validator-badges">
240
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
241
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
242
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
243
+ </footer>
244
+