backup 3.0.19 → 3.0.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +9 -8
  3. data/Gemfile.lock +19 -1
  4. data/Guardfile +13 -9
  5. data/README.md +93 -31
  6. data/backup.gemspec +3 -3
  7. data/bin/backup +6 -283
  8. data/lib/backup.rb +101 -72
  9. data/lib/backup/archive.rb +21 -9
  10. data/lib/backup/binder.rb +22 -0
  11. data/lib/backup/cleaner.rb +36 -0
  12. data/lib/backup/cli/helpers.rb +103 -0
  13. data/lib/backup/cli/utility.rb +308 -0
  14. data/lib/backup/compressor/base.rb +2 -2
  15. data/lib/backup/compressor/pbzip2.rb +76 -0
  16. data/lib/backup/configuration/compressor/pbzip2.rb +28 -0
  17. data/lib/backup/configuration/database/riak.rb +25 -0
  18. data/lib/backup/configuration/encryptor/open_ssl.rb +6 -0
  19. data/lib/backup/configuration/helpers.rb +5 -18
  20. data/lib/backup/configuration/notifier/base.rb +13 -0
  21. data/lib/backup/configuration/notifier/hipchat.rb +41 -0
  22. data/lib/backup/configuration/notifier/mail.rb +38 -0
  23. data/lib/backup/configuration/notifier/prowl.rb +23 -0
  24. data/lib/backup/configuration/storage/cloudfiles.rb +4 -0
  25. data/lib/backup/configuration/storage/dropbox.rb +8 -4
  26. data/lib/backup/database/base.rb +10 -2
  27. data/lib/backup/database/mongodb.rb +16 -19
  28. data/lib/backup/database/mysql.rb +2 -2
  29. data/lib/backup/database/postgresql.rb +2 -2
  30. data/lib/backup/database/redis.rb +15 -7
  31. data/lib/backup/database/riak.rb +45 -0
  32. data/lib/backup/dependency.rb +21 -7
  33. data/lib/backup/encryptor/base.rb +1 -1
  34. data/lib/backup/encryptor/open_ssl.rb +20 -5
  35. data/lib/backup/errors.rb +124 -0
  36. data/lib/backup/finder.rb +11 -3
  37. data/lib/backup/logger.rb +121 -82
  38. data/lib/backup/model.rb +103 -44
  39. data/lib/backup/notifier/base.rb +50 -0
  40. data/lib/backup/notifier/campfire.rb +32 -52
  41. data/lib/backup/notifier/hipchat.rb +99 -0
  42. data/lib/backup/notifier/mail.rb +100 -61
  43. data/lib/backup/notifier/presently.rb +31 -40
  44. data/lib/backup/notifier/prowl.rb +73 -0
  45. data/lib/backup/notifier/twitter.rb +29 -39
  46. data/lib/backup/packager.rb +25 -0
  47. data/lib/backup/splitter.rb +62 -0
  48. data/lib/backup/storage/base.rb +178 -18
  49. data/lib/backup/storage/cloudfiles.rb +34 -28
  50. data/lib/backup/storage/dropbox.rb +64 -67
  51. data/lib/backup/storage/ftp.rb +48 -40
  52. data/lib/backup/storage/local.rb +33 -28
  53. data/lib/backup/storage/ninefold.rb +40 -26
  54. data/lib/backup/storage/object.rb +8 -6
  55. data/lib/backup/storage/rsync.rb +61 -51
  56. data/lib/backup/storage/s3.rb +29 -27
  57. data/lib/backup/storage/scp.rb +56 -36
  58. data/lib/backup/storage/sftp.rb +49 -33
  59. data/lib/backup/syncer/base.rb +1 -1
  60. data/lib/backup/syncer/rsync.rb +1 -1
  61. data/lib/backup/template.rb +46 -0
  62. data/lib/backup/version.rb +1 -1
  63. data/spec/archive_spec.rb +34 -9
  64. data/spec/backup_spec.rb +1 -1
  65. data/spec/cli/helpers_spec.rb +35 -0
  66. data/spec/cli/utility_spec.rb +38 -0
  67. data/spec/compressor/bzip2_spec.rb +1 -1
  68. data/spec/compressor/gzip_spec.rb +1 -1
  69. data/spec/compressor/lzma_spec.rb +1 -1
  70. data/spec/compressor/pbzip2_spec.rb +63 -0
  71. data/spec/configuration/base_spec.rb +1 -1
  72. data/spec/configuration/compressor/bzip2_spec.rb +1 -1
  73. data/spec/configuration/compressor/gzip_spec.rb +1 -1
  74. data/spec/configuration/compressor/lzma_spec.rb +1 -1
  75. data/spec/configuration/database/base_spec.rb +1 -1
  76. data/spec/configuration/database/mongodb_spec.rb +1 -1
  77. data/spec/configuration/database/mysql_spec.rb +1 -1
  78. data/spec/configuration/database/postgresql_spec.rb +1 -1
  79. data/spec/configuration/database/redis_spec.rb +1 -1
  80. data/spec/configuration/database/riak_spec.rb +31 -0
  81. data/spec/configuration/encryptor/gpg_spec.rb +1 -1
  82. data/spec/configuration/encryptor/open_ssl_spec.rb +4 -1
  83. data/spec/configuration/notifier/campfire_spec.rb +1 -1
  84. data/spec/configuration/notifier/hipchat_spec.rb +43 -0
  85. data/spec/configuration/notifier/mail_spec.rb +34 -22
  86. data/spec/configuration/notifier/presently_spec.rb +1 -1
  87. data/spec/configuration/notifier/prowl_spec.rb +28 -0
  88. data/spec/configuration/notifier/twitter_spec.rb +1 -1
  89. data/spec/configuration/storage/cloudfiles_spec.rb +19 -16
  90. data/spec/configuration/storage/dropbox_spec.rb +1 -1
  91. data/spec/configuration/storage/ftp_spec.rb +1 -1
  92. data/spec/configuration/storage/local_spec.rb +1 -1
  93. data/spec/configuration/storage/ninefold_spec.rb +1 -1
  94. data/spec/configuration/storage/rsync_spec.rb +1 -1
  95. data/spec/configuration/storage/s3_spec.rb +1 -1
  96. data/spec/configuration/storage/scp_spec.rb +1 -1
  97. data/spec/configuration/storage/sftp_spec.rb +1 -1
  98. data/spec/configuration/syncer/rsync_spec.rb +1 -1
  99. data/spec/configuration/syncer/s3_spec.rb +1 -1
  100. data/spec/database/base_spec.rb +10 -1
  101. data/spec/database/mongodb_spec.rb +34 -7
  102. data/spec/database/mysql_spec.rb +8 -7
  103. data/spec/database/postgresql_spec.rb +8 -7
  104. data/spec/database/redis_spec.rb +39 -9
  105. data/spec/database/riak_spec.rb +50 -0
  106. data/spec/encryptor/gpg_spec.rb +1 -1
  107. data/spec/encryptor/open_ssl_spec.rb +77 -20
  108. data/spec/errors_spec.rb +306 -0
  109. data/spec/finder_spec.rb +91 -0
  110. data/spec/logger_spec.rb +254 -33
  111. data/spec/model_spec.rb +120 -15
  112. data/spec/notifier/campfire_spec.rb +127 -52
  113. data/spec/notifier/hipchat_spec.rb +193 -0
  114. data/spec/notifier/mail_spec.rb +290 -74
  115. data/spec/notifier/presently_spec.rb +290 -73
  116. data/spec/notifier/prowl_spec.rb +149 -0
  117. data/spec/notifier/twitter_spec.rb +106 -41
  118. data/spec/spec_helper.rb +8 -2
  119. data/spec/splitter_spec.rb +71 -0
  120. data/spec/storage/base_spec.rb +280 -19
  121. data/spec/storage/cloudfiles_spec.rb +38 -22
  122. data/spec/storage/dropbox_spec.rb +17 -13
  123. data/spec/storage/ftp_spec.rb +145 -55
  124. data/spec/storage/local_spec.rb +6 -6
  125. data/spec/storage/ninefold_spec.rb +70 -29
  126. data/spec/storage/object_spec.rb +44 -44
  127. data/spec/storage/rsync_spec.rb +186 -63
  128. data/spec/storage/s3_spec.rb +23 -24
  129. data/spec/storage/scp_spec.rb +116 -41
  130. data/spec/storage/sftp_spec.rb +124 -46
  131. data/spec/syncer/rsync_spec.rb +3 -3
  132. data/spec/syncer/s3_spec.rb +1 -1
  133. data/spec/version_spec.rb +1 -1
  134. data/templates/cli/utility/archive +13 -0
  135. data/{lib/templates → templates/cli/utility}/compressor/bzip2 +1 -1
  136. data/{lib/templates → templates/cli/utility}/compressor/gzip +1 -1
  137. data/{lib/templates → templates/cli/utility}/compressor/lzma +0 -0
  138. data/templates/cli/utility/compressor/pbzip2 +7 -0
  139. data/templates/cli/utility/config +31 -0
  140. data/{lib/templates → templates/cli/utility}/database/mongodb +1 -1
  141. data/{lib/templates → templates/cli/utility}/database/mysql +1 -1
  142. data/{lib/templates → templates/cli/utility}/database/postgresql +1 -1
  143. data/{lib/templates → templates/cli/utility}/database/redis +1 -1
  144. data/templates/cli/utility/database/riak +8 -0
  145. data/{lib/templates → templates/cli/utility}/encryptor/gpg +1 -1
  146. data/templates/cli/utility/encryptor/openssl +9 -0
  147. data/templates/cli/utility/model.erb +23 -0
  148. data/{lib/templates → templates/cli/utility}/notifier/campfire +2 -1
  149. data/templates/cli/utility/notifier/hipchat +15 -0
  150. data/{lib/templates → templates/cli/utility}/notifier/mail +6 -1
  151. data/{lib/templates → templates/cli/utility}/notifier/presently +1 -0
  152. data/templates/cli/utility/notifier/prowl +11 -0
  153. data/{lib/templates → templates/cli/utility}/notifier/twitter +2 -1
  154. data/templates/cli/utility/splitter +7 -0
  155. data/templates/cli/utility/storage/cloudfiles +12 -0
  156. data/{lib/templates → templates/cli/utility}/storage/dropbox +1 -1
  157. data/{lib/templates → templates/cli/utility}/storage/ftp +0 -0
  158. data/templates/cli/utility/storage/local +7 -0
  159. data/{lib/templates → templates/cli/utility}/storage/ninefold +1 -1
  160. data/templates/cli/utility/storage/rsync +11 -0
  161. data/{lib/templates → templates/cli/utility}/storage/s3 +0 -2
  162. data/templates/cli/utility/storage/scp +11 -0
  163. data/templates/cli/utility/storage/sftp +11 -0
  164. data/{lib/templates → templates/cli/utility}/syncer/rsync +1 -1
  165. data/{lib/templates → templates/cli/utility}/syncer/s3 +1 -1
  166. data/templates/general/links +11 -0
  167. data/templates/general/version.erb +2 -0
  168. data/templates/notifier/mail/failure.erb +9 -0
  169. data/templates/notifier/mail/success.erb +7 -0
  170. data/templates/notifier/mail/warning.erb +9 -0
  171. data/templates/storage/dropbox/authorization_url.erb +6 -0
  172. data/templates/storage/dropbox/authorized.erb +4 -0
  173. data/templates/storage/dropbox/cache_file_written.erb +10 -0
  174. metadata +81 -45
  175. data/lib/backup/cli.rb +0 -110
  176. data/lib/backup/exception/command_failed.rb +0 -8
  177. data/lib/backup/exception/command_not_found.rb +0 -8
  178. data/lib/backup/notifier/binder.rb +0 -32
  179. data/lib/backup/notifier/templates/notify_failure.erb +0 -33
  180. data/lib/backup/notifier/templates/notify_success.erb +0 -16
  181. data/lib/templates/archive +0 -7
  182. data/lib/templates/encryptor/openssl +0 -8
  183. data/lib/templates/readme +0 -15
  184. data/lib/templates/storage/cloudfiles +0 -11
  185. data/lib/templates/storage/local +0 -7
  186. data/lib/templates/storage/rsync +0 -11
  187. data/lib/templates/storage/scp +0 -11
  188. data/lib/templates/storage/sftp +0 -11
@@ -0,0 +1,6 @@
1
+
2
+ Visit the following URL to authorize your Dropbox App with Backup:
3
+
4
+ <%= @session.authorize_url %>
5
+
6
+ Hit "Enter/Return" once you're authorized.
@@ -0,0 +1,4 @@
1
+
2
+ Backup has successfully been authorized!
3
+ Writing session cache file to:
4
+ <%= @cached_file %>
@@ -0,0 +1,10 @@
1
+
2
+ Cache data written! You will no longer need to manually authorize this
3
+ Dropbox account via an authorization URL on this machine.
4
+
5
+ Note: If you run Backup with this Dropbox account in another location,
6
+ or on other machines, you will need to either authorize them the same
7
+ way, or simply copy over the cache file from:
8
+ <%= @cached_file %>
9
+ to the cache directory on your other machines to use this Dropbox
10
+ account there as well.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.19
4
+ version: 3.0.20
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-16 00:00:00.000000000 Z
12
+ date: 2011-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70185029728160 !ruby/object:Gem::Requirement
16
+ requirement: &70199932850880 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,18 +21,18 @@ dependencies:
21
21
  version: 0.14.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70185029728160
24
+ version_requirements: *70199932850880
25
25
  - !ruby/object:Gem::Dependency
26
- name: popen4
27
- requirement: &70185029726640 !ruby/object:Gem::Requirement
26
+ name: POpen4
27
+ requirement: &70199932850360 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: 0.1.2
32
+ version: 0.1.4
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70185029726640
35
+ version_requirements: *70199932850360
36
36
  description:
37
37
  email: meskyanichi@gmail.com
38
38
  executables:
@@ -51,29 +51,37 @@ files:
51
51
  - bin/backup
52
52
  - lib/backup.rb
53
53
  - lib/backup/archive.rb
54
- - lib/backup/cli.rb
54
+ - lib/backup/binder.rb
55
+ - lib/backup/cleaner.rb
56
+ - lib/backup/cli/helpers.rb
57
+ - lib/backup/cli/utility.rb
55
58
  - lib/backup/compressor/base.rb
56
59
  - lib/backup/compressor/bzip2.rb
57
60
  - lib/backup/compressor/gzip.rb
58
61
  - lib/backup/compressor/lzma.rb
62
+ - lib/backup/compressor/pbzip2.rb
59
63
  - lib/backup/configuration/base.rb
60
64
  - lib/backup/configuration/compressor/base.rb
61
65
  - lib/backup/configuration/compressor/bzip2.rb
62
66
  - lib/backup/configuration/compressor/gzip.rb
63
67
  - lib/backup/configuration/compressor/lzma.rb
68
+ - lib/backup/configuration/compressor/pbzip2.rb
64
69
  - lib/backup/configuration/database/base.rb
65
70
  - lib/backup/configuration/database/mongodb.rb
66
71
  - lib/backup/configuration/database/mysql.rb
67
72
  - lib/backup/configuration/database/postgresql.rb
68
73
  - lib/backup/configuration/database/redis.rb
74
+ - lib/backup/configuration/database/riak.rb
69
75
  - lib/backup/configuration/encryptor/base.rb
70
76
  - lib/backup/configuration/encryptor/gpg.rb
71
77
  - lib/backup/configuration/encryptor/open_ssl.rb
72
78
  - lib/backup/configuration/helpers.rb
73
79
  - lib/backup/configuration/notifier/base.rb
74
80
  - lib/backup/configuration/notifier/campfire.rb
81
+ - lib/backup/configuration/notifier/hipchat.rb
75
82
  - lib/backup/configuration/notifier/mail.rb
76
83
  - lib/backup/configuration/notifier/presently.rb
84
+ - lib/backup/configuration/notifier/prowl.rb
77
85
  - lib/backup/configuration/notifier/twitter.rb
78
86
  - lib/backup/configuration/storage/base.rb
79
87
  - lib/backup/configuration/storage/cloudfiles.rb
@@ -92,23 +100,24 @@ files:
92
100
  - lib/backup/database/mysql.rb
93
101
  - lib/backup/database/postgresql.rb
94
102
  - lib/backup/database/redis.rb
103
+ - lib/backup/database/riak.rb
95
104
  - lib/backup/dependency.rb
96
105
  - lib/backup/encryptor/base.rb
97
106
  - lib/backup/encryptor/gpg.rb
98
107
  - lib/backup/encryptor/open_ssl.rb
99
- - lib/backup/exception/command_failed.rb
100
- - lib/backup/exception/command_not_found.rb
108
+ - lib/backup/errors.rb
101
109
  - lib/backup/finder.rb
102
110
  - lib/backup/logger.rb
103
111
  - lib/backup/model.rb
104
112
  - lib/backup/notifier/base.rb
105
- - lib/backup/notifier/binder.rb
106
113
  - lib/backup/notifier/campfire.rb
114
+ - lib/backup/notifier/hipchat.rb
107
115
  - lib/backup/notifier/mail.rb
108
116
  - lib/backup/notifier/presently.rb
109
- - lib/backup/notifier/templates/notify_failure.erb
110
- - lib/backup/notifier/templates/notify_success.erb
117
+ - lib/backup/notifier/prowl.rb
111
118
  - lib/backup/notifier/twitter.rb
119
+ - lib/backup/packager.rb
120
+ - lib/backup/splitter.rb
112
121
  - lib/backup/storage/base.rb
113
122
  - lib/backup/storage/cloudfiles.rb
114
123
  - lib/backup/storage/dropbox.rb
@@ -123,38 +132,16 @@ files:
123
132
  - lib/backup/syncer/base.rb
124
133
  - lib/backup/syncer/rsync.rb
125
134
  - lib/backup/syncer/s3.rb
135
+ - lib/backup/template.rb
126
136
  - lib/backup/version.rb
127
- - lib/templates/archive
128
- - lib/templates/compressor/bzip2
129
- - lib/templates/compressor/gzip
130
- - lib/templates/compressor/lzma
131
- - lib/templates/database/mongodb
132
- - lib/templates/database/mysql
133
- - lib/templates/database/postgresql
134
- - lib/templates/database/redis
135
- - lib/templates/encryptor/gpg
136
- - lib/templates/encryptor/openssl
137
- - lib/templates/notifier/campfire
138
- - lib/templates/notifier/mail
139
- - lib/templates/notifier/presently
140
- - lib/templates/notifier/twitter
141
- - lib/templates/readme
142
- - lib/templates/storage/cloudfiles
143
- - lib/templates/storage/dropbox
144
- - lib/templates/storage/ftp
145
- - lib/templates/storage/local
146
- - lib/templates/storage/ninefold
147
- - lib/templates/storage/rsync
148
- - lib/templates/storage/s3
149
- - lib/templates/storage/scp
150
- - lib/templates/storage/sftp
151
- - lib/templates/syncer/rsync
152
- - lib/templates/syncer/s3
153
137
  - spec/archive_spec.rb
154
138
  - spec/backup_spec.rb
139
+ - spec/cli/helpers_spec.rb
140
+ - spec/cli/utility_spec.rb
155
141
  - spec/compressor/bzip2_spec.rb
156
142
  - spec/compressor/gzip_spec.rb
157
143
  - spec/compressor/lzma_spec.rb
144
+ - spec/compressor/pbzip2_spec.rb
158
145
  - spec/configuration/base_spec.rb
159
146
  - spec/configuration/compressor/bzip2_spec.rb
160
147
  - spec/configuration/compressor/gzip_spec.rb
@@ -164,11 +151,14 @@ files:
164
151
  - spec/configuration/database/mysql_spec.rb
165
152
  - spec/configuration/database/postgresql_spec.rb
166
153
  - spec/configuration/database/redis_spec.rb
154
+ - spec/configuration/database/riak_spec.rb
167
155
  - spec/configuration/encryptor/gpg_spec.rb
168
156
  - spec/configuration/encryptor/open_ssl_spec.rb
169
157
  - spec/configuration/notifier/campfire_spec.rb
158
+ - spec/configuration/notifier/hipchat_spec.rb
170
159
  - spec/configuration/notifier/mail_spec.rb
171
160
  - spec/configuration/notifier/presently_spec.rb
161
+ - spec/configuration/notifier/prowl_spec.rb
172
162
  - spec/configuration/notifier/twitter_spec.rb
173
163
  - spec/configuration/storage/cloudfiles_spec.rb
174
164
  - spec/configuration/storage/dropbox_spec.rb
@@ -186,15 +176,21 @@ files:
186
176
  - spec/database/mysql_spec.rb
187
177
  - spec/database/postgresql_spec.rb
188
178
  - spec/database/redis_spec.rb
179
+ - spec/database/riak_spec.rb
189
180
  - spec/encryptor/gpg_spec.rb
190
181
  - spec/encryptor/open_ssl_spec.rb
182
+ - spec/errors_spec.rb
183
+ - spec/finder_spec.rb
191
184
  - spec/logger_spec.rb
192
185
  - spec/model_spec.rb
193
186
  - spec/notifier/campfire_spec.rb
187
+ - spec/notifier/hipchat_spec.rb
194
188
  - spec/notifier/mail_spec.rb
195
189
  - spec/notifier/presently_spec.rb
190
+ - spec/notifier/prowl_spec.rb
196
191
  - spec/notifier/twitter_spec.rb
197
192
  - spec/spec_helper.rb
193
+ - spec/splitter_spec.rb
198
194
  - spec/storage/base_spec.rb
199
195
  - spec/storage/cloudfiles_spec.rb
200
196
  - spec/storage/dropbox_spec.rb
@@ -209,6 +205,46 @@ files:
209
205
  - spec/syncer/rsync_spec.rb
210
206
  - spec/syncer/s3_spec.rb
211
207
  - spec/version_spec.rb
208
+ - templates/cli/utility/archive
209
+ - templates/cli/utility/compressor/bzip2
210
+ - templates/cli/utility/compressor/gzip
211
+ - templates/cli/utility/compressor/lzma
212
+ - templates/cli/utility/compressor/pbzip2
213
+ - templates/cli/utility/config
214
+ - templates/cli/utility/database/mongodb
215
+ - templates/cli/utility/database/mysql
216
+ - templates/cli/utility/database/postgresql
217
+ - templates/cli/utility/database/redis
218
+ - templates/cli/utility/database/riak
219
+ - templates/cli/utility/encryptor/gpg
220
+ - templates/cli/utility/encryptor/openssl
221
+ - templates/cli/utility/model.erb
222
+ - templates/cli/utility/notifier/campfire
223
+ - templates/cli/utility/notifier/hipchat
224
+ - templates/cli/utility/notifier/mail
225
+ - templates/cli/utility/notifier/presently
226
+ - templates/cli/utility/notifier/prowl
227
+ - templates/cli/utility/notifier/twitter
228
+ - templates/cli/utility/splitter
229
+ - templates/cli/utility/storage/cloudfiles
230
+ - templates/cli/utility/storage/dropbox
231
+ - templates/cli/utility/storage/ftp
232
+ - templates/cli/utility/storage/local
233
+ - templates/cli/utility/storage/ninefold
234
+ - templates/cli/utility/storage/rsync
235
+ - templates/cli/utility/storage/s3
236
+ - templates/cli/utility/storage/scp
237
+ - templates/cli/utility/storage/sftp
238
+ - templates/cli/utility/syncer/rsync
239
+ - templates/cli/utility/syncer/s3
240
+ - templates/general/links
241
+ - templates/general/version.erb
242
+ - templates/notifier/mail/failure.erb
243
+ - templates/notifier/mail/success.erb
244
+ - templates/notifier/mail/warning.erb
245
+ - templates/storage/dropbox/authorization_url.erb
246
+ - templates/storage/dropbox/authorized.erb
247
+ - templates/storage/dropbox/cache_file_written.erb
212
248
  homepage: http://rubygems.org/gems/backup
213
249
  licenses: []
214
250
  post_install_message:
@@ -233,9 +269,9 @@ rubygems_version: 1.8.10
233
269
  signing_key:
234
270
  specification_version: 3
235
271
  summary: Backup is a RubyGem, written for Linux and Mac OSX, that allows you to easily
236
- perform backup operations on both your remote, as well as your local environment.
237
- It provides you with an elegant DSL in Ruby for modeling (configuring) your backups.
238
- Backup has built-in support for various databases, storage protocols/services, syncers,
239
- compressors, encryptors and notifiers which you can mix and match. It was built
240
- with modularity, extensibility and simplicity in mind.
272
+ perform backup operations on both your remote and local environments. It provides
273
+ you with an elegant DSL in Ruby for modeling your backups. Backup has built-in support
274
+ for various databases, storage protocols/services, syncers, compressors, encryptors
275
+ and notifiers which you can mix and match. It was built with modularity, extensibility
276
+ and simplicity in mind.
241
277
  test_files: []
data/lib/backup/cli.rb DELETED
@@ -1,110 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Backup
4
- module CLI
5
-
6
- ##
7
- # Wrapper method for %x[] to run CL commands
8
- # through a ruby method. This helps with test coverage and
9
- # improves readability.
10
- #
11
- # It'll first remove all prefixing slashes ( / ) by using .gsub(/^\s+/, '')
12
- # This allows for the EOS blocks to be indented without actually using any
13
- # prefixing spaces. This cleans up the implementation code.
14
- #
15
- # Every time the Backup::CLI#run method is invoked, it'll invoke
16
- # the Backup::CLI#raise_if_command_not_found method after running the
17
- # requested command on the OS.
18
- #
19
- # Backup::CLI#raise_if_command_not_found takes a single argument, the utility name.
20
- # the command.slice(0, command.index(/\s/)).split('/')[-1] line will extract only the utility
21
- # name (e.g. mongodump, pgdump, etc) from a command like "/usr/local/bin/mongodump <options>"
22
- # and pass that in to the Backup::CLI#raise_if_command_not_found
23
- def run(command)
24
- command.gsub!(/^\s+/, '')
25
- raise_if_command_not_found!(
26
- command_name(command)
27
- )
28
-
29
- pid, stdin, stdout, stderr = Open4::popen4(command)
30
- ignored, @status = Process::waitpid2(pid)
31
- @stdout = stdout.read
32
- @stderr = stderr.read
33
-
34
- raise_if_command_failed!(command_name(command), @status)
35
- end
36
-
37
- ##
38
- # Wrapper method for FileUtils.mkdir_p to create directories
39
- # through a ruby method. This helps with test coverage and
40
- # improves readability
41
- def mkdir(path)
42
- FileUtils.mkdir_p(path)
43
- end
44
-
45
- ##
46
- # Wrapper for the FileUtils.rm_rf to remove files and folders
47
- # through a ruby method. This helps with test coverage and
48
- # improves readability
49
- def rm(path)
50
- FileUtils.rm_rf(path)
51
- end
52
-
53
- ##
54
- # Tries to find the full path of the specified utility. If the full
55
- # path is found, it'll return that. Otherwise it'll just return the
56
- # name of the utility. If the 'utility_path' is defined, it'll check
57
- # to see if it isn't an empty string, and if it isn't, it'll go ahead and
58
- # always use that path rather than auto-detecting it
59
- def utility(name)
60
- if respond_to?(:utility_path)
61
- if utility_path.is_a?(String) and not utility_path.empty?
62
- return utility_path
63
- end
64
- end
65
-
66
- if path = %x[which #{name}].chomp and not path.empty?
67
- return path
68
- end
69
- name
70
- end
71
-
72
- def command_name(command)
73
- command.slice(0, command.index(/\s/)).split('/')[-1]
74
- end
75
-
76
- ##
77
- # If the command that was previously run via this Ruby process returned
78
- # error code "32512", the invoked utility (e.g. mysqldump, pgdump, etc) could not be found.
79
- # If this is the case then this method will throw an exception, informing the user of this problem.
80
- #
81
- # Since this raises an exception, it'll stop the entire backup process, clean up the temp files
82
- # and notify the user via the built-in notifiers if these are set.
83
- def raise_if_command_not_found!(utility)
84
- if $?.to_i.eql?(32512)
85
- raise Exception::CommandNotFound , "Could not find the utility \"#{utility}\" on \"#{RUBY_PLATFORM}\".\n" +
86
- "If this is a database utility, try defining the 'utility_path' option in the configuration file.\n" +
87
- "See the Database Wiki for more information about the Utility Path option."
88
- end
89
- end
90
-
91
- ##
92
- # If the command that was previously run via this Ruby process returned
93
- # a non-zero error code, the invoked utility (e.g. mysqldump, pgdump, etc) failed to run.
94
- # If this is the case then this method will throw an exception, informing the user of this problem.
95
- #
96
- # Since this raises an exception, it'll stop the entire backup process, clean up the temp files
97
- # and notify the user via the built-in notifiers if these are set.
98
- def raise_if_command_failed!(utility, status)
99
- unless status.to_i.eql?(0)
100
- raise Exception::CommandFailed , "Failed to run \"#{utility}\" on \"#{RUBY_PLATFORM}\".\n" +
101
- "The status code returned was #{status}\n" +
102
- "STDOUT was:\n" +
103
- @stdout +
104
- "STDERR was:\n" +
105
- @stderr
106
- end
107
- end
108
-
109
- end
110
- end
@@ -1,8 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Backup
4
- module Exception
5
- class CommandFailed < StandardError
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Backup
4
- module Exception
5
- class CommandNotFound < StandardError
6
- end
7
- end
8
- end
@@ -1,32 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Backup
4
- module Notifier
5
- class Binder
6
-
7
- ##
8
- # Shortcut to create a new instance of a binder, setting
9
- # the instance variables using a Hash of key/values and getting
10
- # the instance's binding. This returns the binding of the new Binder instance
11
- def self.bind(key_and_values = {})
12
- Binder.new(key_and_values).get_binding
13
- end
14
-
15
- ##
16
- # Creates a new Backup::Notifier::Binder instance. Loops through the provided
17
- # Hash to set instance variables
18
- def initialize(key_and_values)
19
- key_and_values.each do |key, value|
20
- instance_variable_set("@#{key}", value)
21
- end
22
- end
23
-
24
- ##
25
- # Returns the binding (needs a wrapper method because #binding is a private method)
26
- def get_binding
27
- binding
28
- end
29
-
30
- end
31
- end
32
- end
@@ -1,33 +0,0 @@
1
-
2
- There seemed to be a problem backing up <%= @model.label %> (<%= @model.trigger %>).
3
-
4
- ===========================================================================
5
- Exception that got raised:
6
- <%= @exception.class %> - <%= @exception.to_s %>
7
- ===========================================================================
8
- <%= @exception.backtrace.join("\n") %>
9
- ===========================================================================
10
-
11
-
12
- You are running Backup version:
13
- <%= Backup::Version.current %>
14
-
15
- You are running Ruby version:
16
- <%= RUBY_VERSION %> (patchlevel <%= RUBY_PATCHLEVEL %>)
17
-
18
- On platform:
19
- <%= RUBY_PLATFORM %>
20
-
21
- ---------------------------------------------------------------------------
22
-
23
- View all Backup gem releases here:
24
- http://rubygems.org/gems/backup
25
-
26
- View the Backup git repository here:
27
- https://github.com/meskyanichi/backup
28
-
29
- View the Backup issues here:
30
- https://github.com/meskyanichi/backup/issues
31
-
32
- View the Backup wiki here:
33
- https://github.com/meskyanichi/backup/wiki