backup_paradise 1.3.1

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 (50) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +408 -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 +368 -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 +502 -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 +220 -0
  19. data/lib/backup_paradise/gui/gtk3/simple_backup_widget/create.rb +70 -0
  20. data/lib/backup_paradise/gui/gtk3/simple_backup_widget/misc.rb +33 -0
  21. data/lib/backup_paradise/gui/gtk3/simple_backup_widget/simple_backup_widget.rb +160 -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 +587 -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 +86 -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 +188 -0
  41. data/lib/backup_paradise/toplevel_methods/opnn.rb +27 -0
  42. data/lib/backup_paradise/utility_scripts/backup/backup.rb +1901 -0
  43. data/lib/backup_paradise/version/version.rb +19 -0
  44. data/lib/backup_paradise/windows/README.md +1 -0
  45. data/lib/backup_paradise/windows/windows.rb +101 -0
  46. data/lib/backup_paradise/www/backup.cgi +63 -0
  47. data/lib/backup_paradise/yaml/config.yml +82 -0
  48. data/lib/backup_paradise.rb +5 -0
  49. data/test/testing_toplevel_functionality.rb +11 -0
  50. metadata +194 -0
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'backup_paradise/version/version.rb'
6
+ # =========================================================================== #
7
+ module BackupParadise
8
+
9
+ # ========================================================================= #
10
+ # === VERSION
11
+ # ========================================================================= #
12
+ VERSION = '1.3.1'
13
+
14
+ # ========================================================================= #
15
+ # === LAST_UPDATE
16
+ # ========================================================================= #
17
+ LAST_UPDATE = '16.03.2023'
18
+
19
+ end
@@ -0,0 +1 @@
1
+ This directory may contain code that we will use on windows.
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'backup_paradise/windows/windows.rb'
6
+ # BackupParadise::Windows.backup_ingrid_directory
7
+ # =========================================================================== #
8
+ module BackupParadise
9
+
10
+ module Windows # === BackupParadise::Windows
11
+
12
+ require 'fileutils'
13
+ require 'backup_paradise/toplevel_methods/misc.rb'
14
+
15
+ alias e puts
16
+
17
+ # ========================================================================= #
18
+ # === BackupParadise::Windows.e
19
+ # ========================================================================= #
20
+ def self.e(i = '')
21
+ puts i
22
+ end
23
+
24
+ # ========================================================================= #
25
+ # === BackupParadise::Windows.return_the_current_time
26
+ # ========================================================================= #
27
+ def self.return_the_current_time
28
+ Time.now.strftime('%d.%m.%Y')
29
+ end
30
+
31
+ # ========================================================================= #
32
+ # === BackupParadise.do_use_fileutils_for_the_copy_action
33
+ # ========================================================================= #
34
+ def self.do_use_fileutils_for_the_copy_action
35
+ BackupParadise::CONFIG['use_system_cp'] = false
36
+ end
37
+
38
+ # ========================================================================= #
39
+ # === BackupParadise::Windows.backup_ingrid_directory
40
+ #
41
+ # This will try to backup c:\\ingrid\. It only works on windows really.
42
+ #
43
+ # The trailing '.' is necessary, so that the content of the directory
44
+ # is copied, rather than the directory itself and THEN its content.
45
+ # ========================================================================= #
46
+ def self.backup_ingrid_directory(
47
+ from = 'c://ingrid/.',
48
+ to = :infer_the_first_external_device
49
+ )
50
+ case to
51
+ # ======================================================================= #
52
+ # === :infer_the_first_external_device
53
+ #
54
+ # Here we will infer which external device is the first one.
55
+ # ======================================================================= #
56
+ when :infer_the_first_external_device
57
+ begin
58
+ require 'mountpoints'
59
+ rescue LoadError; end
60
+ if Object.const_defined? :Mountpoints
61
+ to = Mountpoints[]
62
+ else # else we will use a hardcoded approach.
63
+ e 'Assuming a hardcoded path at: e://'
64
+ to = "e://"
65
+ end
66
+ end
67
+ if to.is_a? Array
68
+ to = to.first
69
+ end
70
+ unless to.include? '_'
71
+ from = from.to_s.dup
72
+ from.chop! if from.end_with? '/'
73
+ if from.start_with?('c://') and BackupParadise.are_we_on_linux?
74
+ from[0,4] = ''
75
+ end
76
+ _ = to.to_s+
77
+ File.basename(from.to_s.delete('.'))+ # We remove '.' to avoid "ingrid/." stuff.
78
+ '_'+
79
+ return_the_current_time
80
+ _ = _.squeeze '/'
81
+ e 'Now creating the directory '+_+'.'
82
+ FileUtils.mkdir_p(_)
83
+ to = _
84
+ end
85
+ if File.directory?(from) and !from.end_with?('/', '.')
86
+ from = from.dup if from.frozen?
87
+ from << '/'
88
+ end
89
+ if File.directory?(to) and !to.end_with?('/')
90
+ to = to.dup if to.frozen?
91
+ to << '/'
92
+ end
93
+ do_use_fileutils_for_the_copy_action
94
+ BackupParadise.simple_backup(from, to)
95
+ end
96
+
97
+ end; end
98
+
99
+ if __FILE__ == $PROGRAM_NAME
100
+ BackupParadise::Windows.backup_ingrid_directory
101
+ end # backupingriddirectory
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # This file may also mix non-objectified HTML tags.
6
+ # =========================================================================== #
7
+ # http://localhost/programming/ruby/src/cyberweb/examples/advanced/hybrid_experiment.cgi
8
+ # =========================================================================== #
9
+ require 'cyberweb/requires/require_objectified_html_tags_files.rb'
10
+ require 'cyberweb/requires/require_the_toplevel_methods_files.rb'
11
+ require 'cyberweb/requires/require_the_html_template.rb'
12
+ require 'cyberweb/web_images/map_symbol_to_image_location.rb'
13
+ require 'cyberweb/javascript/drag_and_drop.rb'
14
+ require 'cyberweb/toplevel_methods/jquery.rb'
15
+ require 'backup_paradise'
16
+
17
+ alias ee print
18
+
19
+ Cyberweb.require_objectified_html_tags_files
20
+ Cyberweb.require_toplevel_methods_files
21
+
22
+ include Cyberweb::Objectified::HtmlTags
23
+ include Cyberweb
24
+
25
+ ee "Content-type: text/html\n\n"
26
+ ee '<html><head>'
27
+
28
+ Title.report('Backup-related actions')
29
+ ee '<style>'
30
+ ee Cyberweb.return_content_of_all_the_CSS_files
31
+ ee '</style>'
32
+ ee Cyberweb.return_jquery_string
33
+ ee '</head>'
34
+ ee '<body class="mar4px">'
35
+
36
+ ee Cyberweb.params?
37
+ # =========================================================================== #
38
+ # Hello world div:
39
+ # =========================================================================== #
40
+ ee '<form method="POST" id="backup_form" name="backup_form" class="FS1_5em mars1em mart1em" action="">'
41
+
42
+ ee 'Backup c:\ingrid\\<br><br>'
43
+ _ = submit_button
44
+ _.name = 'do_backup_for_ingrid'
45
+ _.value = 'Do backup c:\ingrid\\'
46
+ _.bblack2
47
+ _.css_class 'pad8px mar4px mars2em FS1_3em'
48
+ _.style 'border: 3px dotted tomato'
49
+ _.report
50
+ # ee '<img src="../../../../../../../data/images/'+Cyberweb.get_webimage(:backup_image)+'">'
51
+ ee '<input name="do_backup_for_ingrid" type="image" src="../../../../../../../data/images/'+
52
+ Cyberweb.get_webimage(:backup_image)+'" border="0" alt="Submit"/>'
53
+
54
+ # <form class="spacer" action="" method="post">
55
+ # <input class="submit" type="submit" value="Submit" />
56
+ # </form>
57
+
58
+
59
+
60
+ ee '</form>'
61
+
62
+ ee '</body>'
63
+ ee '</html>'
@@ -0,0 +1,82 @@
1
+ # =========================================================================== #
2
+ # === config.yml
3
+ #
4
+ # This file contains some useful configuration setting for the
5
+ # backup_paradise gem.
6
+ # =========================================================================== #
7
+ # x = YAML.load_file('config.yml')
8
+ # =========================================================================== #
9
+
10
+ # =========================================================================== #
11
+ # === use_this_program_to_rename_tabs
12
+ #
13
+ # Set this to either dcop, mrxvt or false. If false, we won't rename.
14
+ # =========================================================================== #
15
+ use_this_program_to_rename_tabs: konsole
16
+
17
+ # =========================================================================== #
18
+ # === show_popup_notification
19
+ #
20
+ # On Linux system. If true, we use xmessage command to popup after the
21
+ # backup-operation has finished.
22
+ # =========================================================================== #
23
+ show_popup_notification: false
24
+
25
+ # =========================================================================== #
26
+ # === use_system_cp
27
+ #
28
+ # If true, then we will use the system cp rather than FileUtils. On
29
+ # windows, it may be better to set this to false and use the pure
30
+ # ruby way to copy files instead.
31
+ # =========================================================================== #
32
+ use_system_cp: true
33
+
34
+ # =========================================================================== #
35
+ # === local_audio_directory
36
+ #
37
+ # If you want to designate another local audio directory then modify the
38
+ # next value.
39
+ # =========================================================================== #
40
+ local_audio_directory: /home/x/songs
41
+
42
+ # =========================================================================== #
43
+ # === backup_these_directories
44
+ #
45
+ # This variable can be used to denote an Array of directories that will
46
+ # be copied. That way the user can overrule the directories that he or
47
+ # she wants to backup.
48
+ #
49
+ # The sorting here is somewhat important - the backup_paradise gem will
50
+ # iterate over the Array 1:1, so the entries that come first, will also
51
+ # be copied first.
52
+ #
53
+ # A trailing '/' is not necessary here, but it would not be harmful to
54
+ # include it either.
55
+ # =========================================================================== #
56
+ backup_these_directories:
57
+ - /home/x/books
58
+ # - /home/x/boot_and_iso # Since as of February 2023 this will be stored on another device.
59
+ - /home/x/data
60
+ - /home/x/songs
61
+ - /home/x/src
62
+ - /home/x/studium
63
+ - /home/x/programming
64
+ # - /home/x/video # Takes too long to backup in total.
65
+
66
+ # =========================================================================== #
67
+ # === Mount paths
68
+ #
69
+ # Here you can specify which paths are to be used, for the backup-action.
70
+ #
71
+ # For instance, on most Linux systems you may want to use /mnt/usb1/
72
+ # rather than /Mount/USB1/.
73
+ #
74
+ # I recommend to keep a trailing / for these entries.
75
+ # =========================================================================== #
76
+ usb1: /Mount/USB1/
77
+ usb2: /Mount/USB2/
78
+ usb3: /Mount/USB3/
79
+ usb4: /Mount/USB4/
80
+ usb5: /Mount/USB5/
81
+ hdd1: /Mount/HDD1/
82
+ hdd2: /Mount/HDD2/
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'backup_paradise/requires/require_the_backup_paradise_project.rb'
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'backup_paradise'
6
+
7
+ alias e puts
8
+
9
+ e 'Next testing whether we can backup the audio directory into the USB1 device.'
10
+
11
+ BackupParadise.simple_backup(:audio, :usb1)
metadata ADDED
@@ -0,0 +1,194 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: backup_paradise
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.1
5
+ platform: ruby
6
+ authors:
7
+ - Robert A. Heiler
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-03-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: colours
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: convert_global_env
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mountpoints
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: opn
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: roebe
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: save_file
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: |2+
98
+
99
+ This project can be used for backup-related tasks, although it is
100
+ primarily adjusted to my own personal use cases, so it may not
101
+ be of much use to other ruby users. Still - in the event that someone
102
+ wants to give it a try or re-use existing ideas for inspiration,
103
+ feel free to have a look at it.
104
+
105
+ For more documentation have a look at the official
106
+ homepage, at:
107
+
108
+ https://www.rubydoc.info/gems/backup_paradise/
109
+
110
+ email: shevy@inbox.lt
111
+ executables:
112
+ - backup_for_ingrid
113
+ - backup_paradise
114
+ - windows_backup_paradise
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - README.md
119
+ - backup_paradise.gemspec
120
+ - bin/backup_for_ingrid
121
+ - bin/backup_paradise
122
+ - bin/windows_backup_paradise
123
+ - doc/README.gen
124
+ - doc/TODO.md
125
+ - lib/backup_paradise.rb
126
+ - lib/backup_paradise/actions/README.md
127
+ - lib/backup_paradise/actions/backup.rb
128
+ - lib/backup_paradise/base/base.rb
129
+ - lib/backup_paradise/base/colours.rb
130
+ - lib/backup_paradise/base/namespace.rb
131
+ - lib/backup_paradise/base/tab.rb
132
+ - lib/backup_paradise/colours/colours.rb
133
+ - lib/backup_paradise/constants/constants.rb
134
+ - lib/backup_paradise/gui/glimmer/libui/backup_for_ingrid/backup_for_ingrid.rb
135
+ - lib/backup_paradise/gui/gtk2/OLD_backup.rb
136
+ - lib/backup_paradise/gui/gtk3/simple_backup_widget/create.rb
137
+ - lib/backup_paradise/gui/gtk3/simple_backup_widget/misc.rb
138
+ - lib/backup_paradise/gui/gtk3/simple_backup_widget/simple_backup_widget.rb
139
+ - lib/backup_paradise/gui/libui/backup_for_ingrid/backup_for_ingrid.rb
140
+ - lib/backup_paradise/gui/libui/simple_backup_widget/simple_backup_widget.rb
141
+ - lib/backup_paradise/gui/shared_code/simple_backup_widget/simple_backup_widget_module.rb
142
+ - lib/backup_paradise/gui/tk/backup.rb
143
+ - lib/backup_paradise/images/BACKUP_IMAGE.png
144
+ - lib/backup_paradise/images/right_arrow.png
145
+ - lib/backup_paradise/project/project.rb
146
+ - lib/backup_paradise/requires/require_the_backup_paradise_project.rb
147
+ - lib/backup_paradise/requires/require_yaml.rb
148
+ - lib/backup_paradise/tab/tab.rb
149
+ - lib/backup_paradise/toplevel_methods/cliner.rb
150
+ - lib/backup_paradise/toplevel_methods/config.rb
151
+ - lib/backup_paradise/toplevel_methods/create_and_remove.rb
152
+ - lib/backup_paradise/toplevel_methods/e.rb
153
+ - lib/backup_paradise/toplevel_methods/esystem.rb
154
+ - lib/backup_paradise/toplevel_methods/files_and_directories.rb
155
+ - lib/backup_paradise/toplevel_methods/help.rb
156
+ - lib/backup_paradise/toplevel_methods/misc.rb
157
+ - lib/backup_paradise/toplevel_methods/mountpoint.rb
158
+ - lib/backup_paradise/toplevel_methods/opnn.rb
159
+ - lib/backup_paradise/utility_scripts/backup/backup.rb
160
+ - lib/backup_paradise/version/version.rb
161
+ - lib/backup_paradise/windows/README.md
162
+ - lib/backup_paradise/windows/windows.rb
163
+ - lib/backup_paradise/www/backup.cgi
164
+ - lib/backup_paradise/yaml/config.yml
165
+ - test/testing_toplevel_functionality.rb
166
+ homepage: https://rubygems.org/gems/backup_paradise
167
+ licenses:
168
+ - MIT
169
+ metadata: {}
170
+ post_install_message:
171
+ rdoc_options: []
172
+ require_paths:
173
+ - lib
174
+ required_ruby_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: 2.7.6
179
+ required_rubygems_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: 3.4.8
184
+ requirements: []
185
+ rubygems_version: 3.4.8
186
+ signing_key:
187
+ specification_version: 4
188
+ summary: 'This project can be used for backup-related tasks, although it is primarily
189
+ adjusted to my own personal use cases, so it may not be of much use to other ruby
190
+ users. Still - in the event that someone wants to give it a try or re-use existing
191
+ ideas for inspiration, feel free to have a look at it. For more documentation have
192
+ a look at the official homepage, at: https://www.rubydoc.info/gems/backup_paradise/'
193
+ test_files: []
194
+ ...