backup_paradise 1.2.40

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.

Potentially problematic release.


This version of backup_paradise might be problematic. Click here for more details.

Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +390 -0
  3. data/backup_paradise.gemspec +50 -0
  4. data/bin/backup_for_ingrid +10 -0
  5. data/bin/backup_paradise +7 -0
  6. data/bin/windows_backup_paradise +9 -0
  7. data/doc/README.gen +347 -0
  8. data/doc/TODO.md +130 -0
  9. data/lib/backup_paradise/actions/README.md +2 -0
  10. data/lib/backup_paradise/actions/backup.rb +62 -0
  11. data/lib/backup_paradise/base/base.rb +493 -0
  12. data/lib/backup_paradise/base/colours.rb +137 -0
  13. data/lib/backup_paradise/base/namespace.rb +16 -0
  14. data/lib/backup_paradise/base/tab.rb +47 -0
  15. data/lib/backup_paradise/colours/colours.rb +88 -0
  16. data/lib/backup_paradise/constants/constants.rb +162 -0
  17. data/lib/backup_paradise/gui/glimmer/libui/backup_for_ingrid/backup_for_ingrid.rb +87 -0
  18. data/lib/backup_paradise/gui/gtk2/OLD_backup.rb +222 -0
  19. data/lib/backup_paradise/gui/gtk3/simple_backup_widget/create.rb +64 -0
  20. data/lib/backup_paradise/gui/gtk3/simple_backup_widget/misc.rb +34 -0
  21. data/lib/backup_paradise/gui/gtk3/simple_backup_widget/simple_backup_widget.rb +167 -0
  22. data/lib/backup_paradise/gui/libui/backup_for_ingrid/backup_for_ingrid.rb +99 -0
  23. data/lib/backup_paradise/gui/libui/simple_backup_widget/simple_backup_widget.rb +119 -0
  24. data/lib/backup_paradise/gui/shared_code/simple_backup_widget/simple_backup_widget_module.rb +595 -0
  25. data/lib/backup_paradise/gui/tk/backup.rb +108 -0
  26. data/lib/backup_paradise/images/BACKUP_IMAGE.png +0 -0
  27. data/lib/backup_paradise/images/right_arrow.png +0 -0
  28. data/lib/backup_paradise/project/project.rb +40 -0
  29. data/lib/backup_paradise/requires/require_the_backup_paradise_project.rb +18 -0
  30. data/lib/backup_paradise/requires/require_yaml.rb +7 -0
  31. data/lib/backup_paradise/tab/tab.rb +87 -0
  32. data/lib/backup_paradise/toplevel_methods/cliner.rb +16 -0
  33. data/lib/backup_paradise/toplevel_methods/config.rb +77 -0
  34. data/lib/backup_paradise/toplevel_methods/create_and_remove.rb +63 -0
  35. data/lib/backup_paradise/toplevel_methods/e.rb +16 -0
  36. data/lib/backup_paradise/toplevel_methods/esystem.rb +19 -0
  37. data/lib/backup_paradise/toplevel_methods/files_and_directories.rb +181 -0
  38. data/lib/backup_paradise/toplevel_methods/help.rb +93 -0
  39. data/lib/backup_paradise/toplevel_methods/misc.rb +153 -0
  40. data/lib/backup_paradise/toplevel_methods/mountpoint.rb +185 -0
  41. data/lib/backup_paradise/toplevel_methods/opnn.rb +25 -0
  42. data/lib/backup_paradise/utility_scripts/backup/backup.rb +1416 -0
  43. data/lib/backup_paradise/utility_scripts/backup/constants.rb +44 -0
  44. data/lib/backup_paradise/utility_scripts/backup/initialize.rb +71 -0
  45. data/lib/backup_paradise/utility_scripts/backup/menu.rb +361 -0
  46. data/lib/backup_paradise/utility_scripts/backup/run.rb +20 -0
  47. data/lib/backup_paradise/version/version.rb +19 -0
  48. data/lib/backup_paradise/windows/README.md +1 -0
  49. data/lib/backup_paradise/windows/windows.rb +101 -0
  50. data/lib/backup_paradise/www/backup.cgi +63 -0
  51. data/lib/backup_paradise/yaml/config.yml +78 -0
  52. data/lib/backup_paradise.rb +5 -0
  53. data/test/testing_toplevel_functionality.rb +11 -0
  54. metadata +198 -0
@@ -0,0 +1,493 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'backup_paradise/base/base.rb'
6
+ # < ::BackupParadise::Base
7
+ # =========================================================================== #
8
+ module BackupParadise
9
+
10
+ class Base
11
+
12
+ require 'backup_paradise/constants/constants.rb'
13
+ require 'backup_paradise/project/project.rb'
14
+ require 'backup_paradise/toplevel_methods/config.rb'
15
+ require 'backup_paradise/toplevel_methods/e.rb'
16
+ require 'backup_paradise/toplevel_methods/files_and_directories.rb'
17
+ require 'backup_paradise/toplevel_methods/misc.rb'
18
+ require 'backup_paradise/base/colours.rb'
19
+ require 'backup_paradise/base/namespace.rb'
20
+ require 'backup_paradise/base/tab.rb'
21
+
22
+ # ========================================================================= #
23
+ # Next, external code is loaded.
24
+ # ========================================================================= #
25
+ begin
26
+ require 'roebe/time/time.rb'
27
+ rescue LoadError; end
28
+
29
+ begin
30
+ require 'opn'
31
+ rescue LoadError; end
32
+
33
+ begin
34
+ require 'roebe/toplevel_methods/write_what_into.rb'
35
+ rescue LoadError => error
36
+ puts 'Please install the roebe-gem ( gem install roebe ).'
37
+ pp error
38
+ end
39
+
40
+ # ========================================================================= #
41
+ # === BackupParadise.e
42
+ # ========================================================================= #
43
+ def e(i = '')
44
+ BackupParadise.e(i)
45
+ end
46
+
47
+ # ========================================================================= #
48
+ # === reset (reset tag)
49
+ # ========================================================================= #
50
+ def reset
51
+ # ======================================================================= #
52
+ # === @use_this_program_to_rename_tabs
53
+ # ======================================================================= #
54
+ @use_this_program_to_rename_tabs = nil
55
+ end
56
+
57
+ # ========================================================================= #
58
+ # === rds
59
+ # ========================================================================= #
60
+ def rds(i)
61
+ BackupParadise.rds(i)
62
+ end
63
+
64
+ # ========================================================================= #
65
+ # === no_such_directory_exists_at
66
+ # ========================================================================= #
67
+ def no_such_directory_exists_at(i)
68
+ e "No such directory exists at `#{sdir(i)}`."
69
+ end
70
+
71
+ # ========================================================================= #
72
+ # === exit_program (exit tag)
73
+ #
74
+ # This method should be used when we have to exit from the
75
+ # backup_paradise project.
76
+ #
77
+ # The reason why a separate exit-method has been added is so that we
78
+ # can change this at a later time possibly, if we wish to do further
79
+ # checks before exiting.
80
+ # ========================================================================= #
81
+ def exit_program(be_verbose = false)
82
+ if be_verbose
83
+ e 'Quit was called, thus we exit now.'
84
+ end
85
+ if @use_this_program_to_rename_tabs
86
+ rename_tab(@use_this_program_to_rename_tabs)
87
+ end
88
+ exit
89
+ end
90
+
91
+ # ========================================================================= #
92
+ # === home_dir_of_user_x?
93
+ # ========================================================================= #
94
+ def home_dir_of_user_x?
95
+ '/home/x/'
96
+ end
97
+
98
+ # ========================================================================= #
99
+ # === cliner
100
+ # ========================================================================= #
101
+ def cliner
102
+ BackupParadise.cliner
103
+ end
104
+
105
+ # ========================================================================= #
106
+ # === no_target_at
107
+ # ========================================================================= #
108
+ def no_target_at(i)
109
+ e "No target at #{sfile(i)} could be found."
110
+ end
111
+
112
+ # ========================================================================= #
113
+ # === delete_symlink
114
+ # ========================================================================= #
115
+ def delete_symlink(i)
116
+ if File.symlink? i
117
+ File.delete(i)
118
+ end
119
+ end
120
+
121
+ # ========================================================================= #
122
+ # === register_sigint
123
+ # ========================================================================= #
124
+ def register_sigint
125
+ Signal.trap('SIGINT') { exit_program }
126
+ end
127
+
128
+ # ========================================================================= #
129
+ # === rename
130
+ # ========================================================================= #
131
+ def rename(a, b)
132
+ if File.exist? b
133
+ e "Can not rename to #{sfancy(b)} as that target already exists."
134
+ else
135
+ FileUtils.mv(a, b)
136
+ end
137
+ end
138
+
139
+ # ========================================================================= #
140
+ # === dd_mm_yyyy
141
+ #
142
+ # This method will return a String such as "25.12.2018".
143
+ # ========================================================================= #
144
+ def dd_mm_yyyy
145
+ if Object.const_defined? :Roebe
146
+ ::Roebe::Time.dd_mm_yyyy # Tap into the Roebe namespace for this.
147
+ else
148
+ Time.now.strftime('%d.%m.%Y')
149
+ end
150
+ end
151
+
152
+ # ========================================================================= #
153
+ # === return_current_date_and_time
154
+ #
155
+ # This method will return a String such as:
156
+ #
157
+ # "24.05.2018-03:48:50"
158
+ #
159
+ # ========================================================================= #
160
+ def return_current_date_and_time
161
+ "#{dd_mm_yyyy}-#{hh_mm_ss}"
162
+ end; alias return_full_date return_current_date_and_time # === return_full_date
163
+ alias date_and_time? return_current_date_and_time # === date_and_time?
164
+
165
+ require 'backup_paradise/toplevel_methods/opnn.rb'
166
+ # ========================================================================= #
167
+ # === opnn
168
+ # ========================================================================= #
169
+ def opnn(i = NAMESPACE)
170
+ if i.is_a? String
171
+ i = {
172
+ namespace: i,
173
+ use_colours: use_colours?
174
+ }
175
+ end
176
+ BackupParadise.opnn(i)
177
+ end
178
+
179
+ # ========================================================================= #
180
+ # === esystem
181
+ # ========================================================================= #
182
+ def esystem(i)
183
+ e i
184
+ system i
185
+ end
186
+
187
+ # ========================================================================= #
188
+ # === n_files_in?
189
+ #
190
+ # This method will return how many files are in the given directory.
191
+ # ========================================================================= #
192
+ def n_files_in?(i)
193
+ _ = 0
194
+ if File.directory? i
195
+ _ = Dir["#{i}*"].size
196
+ end
197
+ _
198
+ end
199
+
200
+ # ========================================================================= #
201
+ # === create_directory
202
+ #
203
+ # The first argument to this method should be the name of the directory
204
+ # that has to be created, such as 'foobar/'.
205
+ # ========================================================================= #
206
+ def create_directory(
207
+ i, options = { mode_to_use: 0755 }
208
+ )
209
+ BackupParadise.create_directory(i, options)
210
+ end; alias mkdir create_directory # === mkdir
211
+
212
+ # ========================================================================= #
213
+ # === cd_to_the_mounted_device
214
+ # ========================================================================= #
215
+ def cd_to_the_mounted_device
216
+ cd target_mountpoint?
217
+ end
218
+
219
+ # ========================================================================= #
220
+ # === do_symlink
221
+ # ========================================================================= #
222
+ def do_symlink(
223
+ from_this_target, create_a_symlink_here
224
+ )
225
+ if File.exist? create_a_symlink_here
226
+ no_target_at(create_a_symlink_here)
227
+ else
228
+ File.symlink(from_this_target, create_a_symlink_here)
229
+ end
230
+ end
231
+
232
+ # ========================================================================= #
233
+ # === delete_files
234
+ # ========================================================================= #
235
+ def delete_files(
236
+ i, be_verbose = false
237
+ )
238
+ case be_verbose
239
+ when :be_verbose
240
+ be_verbose = true
241
+ end
242
+ if i.is_a? Array
243
+ i.each {|entry| delete_files(entry, be_verbose) }
244
+ else
245
+ if File.file? i
246
+ if be_verbose
247
+ opnn; e "Now deleting the file `#{sfile(i)}`."
248
+ end
249
+ File.delete(i)
250
+ else
251
+ e sfancy(i)+' is not not a file - we thus can not delete it.'
252
+ end
253
+ end
254
+ end; alias delete_file delete_files # === delete_file
255
+ alias remove_these_files delete_files # === remove_these_files
256
+
257
+ # ========================================================================= #
258
+ # === remove_directory
259
+ # ========================================================================= #
260
+ def remove_directory(i)
261
+ BackupParadise.remove_directory(i)
262
+ end
263
+
264
+ # ========================================================================= #
265
+ # === copy_file
266
+ # ========================================================================= #
267
+ def copy_file(from, to)
268
+ BackupParadise.copy_file(from, to)
269
+ end; alias copy_this_file copy_file # === copy_this_file
270
+
271
+ # ========================================================================= #
272
+ # === write_what_into
273
+ # ========================================================================= #
274
+ def write_what_into(what, into)
275
+ ::Roebe.write_what_into(what, into)
276
+ end
277
+
278
+ # ========================================================================= #
279
+ # === append_what_into
280
+ # ========================================================================= #
281
+ def append_what_into(what, into)
282
+ ::Roebe.append_what_into(what, into)
283
+ end
284
+
285
+ # ========================================================================= #
286
+ # === data_directory?
287
+ # ========================================================================= #
288
+ def data_directory?
289
+ DATA_DIRECTORY
290
+ end; alias data_dir? data_directory? # === data_dir?
291
+
292
+ # ========================================================================= #
293
+ # === size?
294
+ # ========================================================================= #
295
+ def size?(i)
296
+ BackupParadise.size?(i)
297
+ end
298
+
299
+ # ========================================================================= #
300
+ # === no_file_exists_at
301
+ # ========================================================================= #
302
+ def no_file_exists_at(i)
303
+ e "No file exists at `#{sfile(i)}`."
304
+ end
305
+
306
+ # ========================================================================= #
307
+ # === target_mountpoint?
308
+ #
309
+ # Designate to which target we will backup.
310
+ # ========================================================================= #
311
+ def target_mountpoint?
312
+ BackupParadise.target_mountpoint?
313
+ end; alias main_target? target_mountpoint? # === main_target?
314
+ alias backup_to_this_directory? target_mountpoint? # === backup_to_this_directory?
315
+ alias mount_point? target_mountpoint? # === mount_point?
316
+ alias mount_target? target_mountpoint? # === mount_target?
317
+
318
+ # ========================================================================= #
319
+ # === use_system_cp
320
+ # ========================================================================= #
321
+ def use_system_cp?
322
+ ::BackupParadise.use_system_cp?
323
+ end
324
+
325
+ # ========================================================================= #
326
+ # === hh_mm_ss
327
+ # ========================================================================= #
328
+ def hh_mm_ss
329
+ if Object.const_defined? :Roebe
330
+ ::Roebe::Time.hh_mm_ss # This will yield something like: "03:53:55"
331
+ else
332
+ Time.now.strftime('%H:%M:%S')
333
+ end
334
+ end; alias current_time hh_mm_ss # === current_time
335
+
336
+ # ========================================================================= #
337
+ # === has_superuser_abilities?
338
+ # ========================================================================= #
339
+ def has_superuser_abilities?
340
+ Process.uid.zero?
341
+ end
342
+
343
+ # ========================================================================= #
344
+ # === chdir (cd tag)
345
+ #
346
+ # Change directory via this method here.
347
+ # ========================================================================= #
348
+ def chdir(i)
349
+ BackupParadise.change_directory(i)
350
+ end; alias cd chdir # === cd
351
+ alias change_directory chdir # === change_directory
352
+
353
+ # ========================================================================= #
354
+ # === report_total_size_of
355
+ #
356
+ # Use this method to report the total size of a specific directory. We
357
+ # expect the input to this method thus be a (local) directory.
358
+ # ========================================================================= #
359
+ def report_total_size_of(i)
360
+ size_result = size?(i)
361
+ kb_size = (size_result.to_f / 1000.0).round(2)
362
+ mb_size = (kb_size.to_f / 1000.0).round(2)
363
+ gb_size = (mb_size.to_f / 1000.0).round(2)
364
+ e "#{rev}Total size of files in bytes at #{sdir(i)}: "\
365
+ "#{seagreen(size_result)} bytes."
366
+ e 'This corresponds to '+
367
+ orangered(kb_size.to_s)+lightcoral(' KB ')+
368
+ orangered(mb_size.to_s)+lightcoral(' MB ')+
369
+ orangered(gb_size.to_s)+lightcoral(' GB')+'.'
370
+ end; alias report_file_size_of report_total_size_of # === report_file_size_of
371
+
372
+ # ========================================================================= #
373
+ # === remove
374
+ # ========================================================================= #
375
+ def remove(i)
376
+ BackupParadise.remove(i)
377
+ end
378
+
379
+ # ========================================================================= #
380
+ # === remove_file
381
+ # ========================================================================= #
382
+ def remove_file(i)
383
+ File.delete(i) if File.file?(i)
384
+ end
385
+
386
+ # ========================================================================= #
387
+ # === set_target_mountpoint
388
+ # ========================================================================= #
389
+ def set_target_mountpoint(i)
390
+ i = i.to_s
391
+ case i
392
+ when 'chroot'
393
+ i = '/Depot/Chroot/' unless File.exist?('chroot')
394
+ # ======================================================================= #
395
+ # Specify some shortcuts to be used here.
396
+ # ======================================================================= #
397
+ when '1',
398
+ '2',
399
+ '3',
400
+ '4',
401
+ '5',
402
+ '6',
403
+ '7',
404
+ '8',
405
+ '9',
406
+ 'usb1',
407
+ 'usb2',
408
+ 'usb3',
409
+ 'usb4',
410
+ 'usb5',
411
+ 'usb6',
412
+ 'tousb1',
413
+ 'tousb2',
414
+ 'tousb3',
415
+ 'tousb4',
416
+ 'tousb5'
417
+ i = i.dup if i.frozen?
418
+ if BackupParadise.is_this_a_shortcut?(i)
419
+ i = BackupParadise.return_the_assumed_mountpoint_from_this_input(i)
420
+ else
421
+ if i.start_with? 'usb'
422
+ i.sub!(/^usb/,'')
423
+ elsif i.start_with? 'to'
424
+ i.sub!(/^to(-| |_)?usb/,'')
425
+ end
426
+ i = "/Mount/USB#{i}/"
427
+ end
428
+ end
429
+ BackupParadise.target_mountpoint = i
430
+ end; alias set_target_device set_target_mountpoint # === set_target_device
431
+ alias set_backup_to_this_directory set_target_mountpoint # === set_backup_to_this_directory
432
+ alias set_target set_target_mountpoint # === set_target
433
+ alias set_main_target set_target_mountpoint # === set_main_target
434
+
435
+ # ========================================================================= #
436
+ # === copy_recursively
437
+ #
438
+ # This method can be used to copy the source to the target in a
439
+ # recursive manner.
440
+ #
441
+ # The third argument to this method, called `be_verbose`, will
442
+ # feedback what is done, to the user, if it has a value of true.
443
+ # Symbols such as :be_verbose can be used as an "alias" to true.
444
+ # If it is set to false, or :be_silent, then no output will be
445
+ # issued to the user.
446
+ # ========================================================================= #
447
+ def copy_recursively(
448
+ this_directory, # from (also called source)
449
+ backup_to_this_target, # to (also called target)
450
+ be_verbose = :be_verbose
451
+ )
452
+ ::BackupParadise.copy_recursively(
453
+ this_directory,
454
+ backup_to_this_target,
455
+ be_verbose
456
+ )
457
+ end; alias cpr copy_recursively # === cpr
458
+ alias backup_this_directory_if_it_exists copy_recursively # === backup_this_directory_if_it_exists
459
+
460
+ # ========================================================================= #
461
+ # === target_hdd_does_not_have_enough_space_left?
462
+ # ========================================================================= #
463
+ def target_hdd_does_not_have_enough_space_left? # FIXME
464
+ false # for now this is always false. stub
465
+ # MINIMAL_FILESIZE
466
+ end
467
+
468
+ # ========================================================================= #
469
+ # === are_we_on_windows?
470
+ #
471
+ # Query whether the underlying operating system is windows or whether
472
+ # it is not.
473
+ # ========================================================================= #
474
+ def are_we_on_windows?
475
+ ::BackupParadise.send(__method__)
476
+ end
477
+
478
+ # ========================================================================= #
479
+ # === all_important_directories?
480
+ #
481
+ # Feed back which directories are the most important ones.
482
+ # ========================================================================= #
483
+ def all_important_directories?
484
+ CONFIG['backup_these_directories'].map {|entry|
485
+ unless entry.end_with?('/')
486
+ entry = entry.dup if entry.frozen?
487
+ entry << '/' # Keep a trailing /; it looks better that way.
488
+ end
489
+ entry
490
+ }
491
+ end
492
+
493
+ end; end
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'backup_paradise/base/colours.rb'
6
+ # =========================================================================== #
7
+ module BackupParadise
8
+
9
+ class Base
10
+
11
+ require 'backup_paradise/colours/colours.rb'
12
+
13
+ # ========================================================================= #
14
+ # === use_colours?
15
+ # ========================================================================= #
16
+ def use_colours?
17
+ BackupParadise.use_colours?
18
+ end
19
+
20
+ # ========================================================================= #
21
+ # === simp
22
+ # ========================================================================= #
23
+ def simp(i = '')
24
+ BackupParadise.simp(i)
25
+ end
26
+
27
+ # ========================================================================= #
28
+ # === sdir
29
+ # ========================================================================= #
30
+ def sdir(i = '')
31
+ BackupParadise.sdir(i)
32
+ end
33
+
34
+ # ========================================================================= #
35
+ # === sfile
36
+ # ========================================================================= #
37
+ def sfile(i = '')
38
+ BackupParadise.sfile(i)
39
+ end
40
+
41
+ # ========================================================================= #
42
+ # === sfancy
43
+ # ========================================================================= #
44
+ def sfancy(i = '')
45
+ BackupParadise.sfancy(i)
46
+ end
47
+
48
+ # ========================================================================= #
49
+ # === tomato
50
+ # ========================================================================= #
51
+ def tomato(i)
52
+ BackupParadise.tomato(i)
53
+ end
54
+
55
+ # ========================================================================= #
56
+ # === royalblue
57
+ # ========================================================================= #
58
+ def royalblue(i)
59
+ BackupParadise.royalblue(i)
60
+ end
61
+
62
+ # ========================================================================= #
63
+ # === rosybrown
64
+ # ========================================================================= #
65
+ def rosybrown(i)
66
+ if use_colours?
67
+ return ::Colours.rosybrown(i)
68
+ end
69
+ i
70
+ end
71
+
72
+ # ========================================================================= #
73
+ # === seagreen
74
+ # ========================================================================= #
75
+ def seagreen(i)
76
+ if use_colours?
77
+ return ::Colours.seagreen(i)
78
+ end
79
+ i
80
+ end
81
+
82
+ # ========================================================================= #
83
+ # === steelblue
84
+ # ========================================================================= #
85
+ def steelblue(i)
86
+ if use_colours?
87
+ return ::Colours.steelblue(i)
88
+ end
89
+ return i
90
+ end
91
+
92
+ # ========================================================================= #
93
+ # === orangered
94
+ # ========================================================================= #
95
+ def orangered(i)
96
+ if use_colours?
97
+ return ::Colours.orangered(i)
98
+ end
99
+ return i
100
+ end
101
+
102
+ # ========================================================================= #
103
+ # === lightcoral
104
+ # ========================================================================= #
105
+ def lightcoral(i)
106
+ if use_colours?
107
+ return ::Colours.lightcoral(i)
108
+ end
109
+ return i
110
+ end
111
+
112
+ # ========================================================================= #
113
+ # === rev
114
+ # ========================================================================= #
115
+ def rev
116
+ if Object.const_defined? :Colours
117
+ Colours.rev
118
+ else
119
+ ''
120
+ end
121
+ end
122
+
123
+ # ========================================================================= #
124
+ # === print_rev
125
+ # ========================================================================= #
126
+ def print_rev
127
+ print rev
128
+ end
129
+
130
+ # ========================================================================= #
131
+ # === cyan
132
+ # ========================================================================= #
133
+ def cyan
134
+ Colours::CYAN
135
+ end
136
+
137
+ end; end
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'backup_paradise/base/namespace.rb'
6
+ # =========================================================================== #
7
+ module BackupParadise
8
+
9
+ class Base
10
+
11
+ # ========================================================================= #
12
+ # === NAMESPACE
13
+ # ========================================================================= #
14
+ NAMESPACE = inspect
15
+
16
+ end; end
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'backup_paradise/base/tab.rb'
6
+ # =========================================================================== #
7
+ module BackupParadise
8
+
9
+ class Base
10
+
11
+ require 'backup_paradise/tab/tab.rb'
12
+ require 'backup_paradise/toplevel_methods/config.rb'
13
+
14
+ # ========================================================================= #
15
+ # === use_this_program_to_rename_tabs?
16
+ # ========================================================================= #
17
+ def use_this_program_to_rename_tabs?
18
+ BackupParadise.use_this_program_to_rename_tabs?
19
+ end
20
+
21
+ # ========================================================================= #
22
+ # === rename_tab
23
+ #
24
+ # This method can be used to rename the tab of e. g. mrxvt or KDE konsole.
25
+ # ========================================================================= #
26
+ def rename_tab(
27
+ use_this_terminal = use_this_program_to_rename_tabs?, # or :mrxvt
28
+ use_this_as_new_title = 'Hello world!'
29
+ )
30
+ BackupParadise::Tab.rename_tab(
31
+ use_this_terminal,
32
+ use_this_as_new_title
33
+ )
34
+ end
35
+
36
+ # ========================================================================= #
37
+ # === tab_title
38
+ #
39
+ # This is as above, but uses the default terminal.
40
+ # ========================================================================= #
41
+ def tab_title(
42
+ i = ''
43
+ )
44
+ rename_tab(use_this_program_to_rename_tabs?, i)
45
+ end
46
+
47
+ end; end