repackage 1.0.30 → 1.1.8
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.
- checksums.yaml +4 -4
- data/README.md +118 -0
- data/bin/{repackager → repackage} +0 -0
- data/doc/README.gen +75 -0
- data/lib/repackage/class/constants.rb +93 -0
- data/lib/repackage/class/misc.rb +934 -0
- data/lib/repackage/class/repackage.rb +44 -723
- data/lib/repackage/colours/colours.rb +102 -0
- data/lib/repackage/requires/require_the_sinatra_interface.rb +1 -1
- data/lib/repackage/version/version.rb +3 -3
- data/lib/repackage/www/embeddable_interface.rb +5 -4
- data/lib/repackage.rb +1 -1
- data/repackage.gemspec +15 -24
- metadata +19 -53
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 305e9296120b7df792b808b9e6e2fecf744232ff879afef23e00f71edb5dfa91
|
|
4
|
+
data.tar.gz: 561eb87149abf6821192e5d73c984e74a02b56bdc7e96832498d3a1f2aeea6cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e6bea3199d10ae2499ffdb7ce573e282d6877156605f4fabdfd981e622f1b333332a0818a4707eba17f0124eea261b165ebd41c5e4d684d727016ac57b14f01
|
|
7
|
+
data.tar.gz: 2bf513af86a4d57bad2f9c8480c48914b8ff0d14a0ad9b3424fffef3cf349f9595f1ee38dad34779d658f065940e6b777ad2fb65b1e99baf30119e12d394f1e5
|
data/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
[](https://www.gobolinux.org/)
|
|
2
|
+
[](https://www.ruby-lang.org/en/)
|
|
3
|
+
[](https://badge.fury.io/rb/repackage)
|
|
4
|
+
|
|
5
|
+
This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">12.09.2022</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">04:23:04</span> o'clock.
|
|
6
|
+
|
|
7
|
+
# The repackage gem
|
|
8
|
+
|
|
9
|
+
<img src="https://i.imgur.com/7KpnuMj.jpg" style="margin: 0.5em">
|
|
10
|
+
|
|
11
|
+
## Dependencies of the repackage gem
|
|
12
|
+
|
|
13
|
+
In the past the repackage gem specifically depended on four other
|
|
14
|
+
external projects. In <b>May 2022</b> this mandatory list of
|
|
15
|
+
dependencies has been reduced to just <b>one</b>. However had,
|
|
16
|
+
it is still recommended that two of the other three gems are
|
|
17
|
+
installed as well.
|
|
18
|
+
|
|
19
|
+
The official list of dependencies thus recommended for the
|
|
20
|
+
<b>repackage</b> gem is as follows, in alphabetical order:
|
|
21
|
+
|
|
22
|
+
- colours
|
|
23
|
+
- extracter
|
|
24
|
+
- opn
|
|
25
|
+
|
|
26
|
+
## Clean working directory
|
|
27
|
+
|
|
28
|
+
As far as the **repackage** gem is concerned, a working
|
|
29
|
+
directory is needed to extract an archive. On my home
|
|
30
|
+
system this is:
|
|
31
|
+
|
|
32
|
+
/home/Temp/repackage/
|
|
33
|
+
|
|
34
|
+
For most other users this will be:
|
|
35
|
+
|
|
36
|
+
/tmp/repackage/
|
|
37
|
+
|
|
38
|
+
The reason why such a directory is necessary is so that
|
|
39
|
+
we do not begin to pollute any other directory. Some
|
|
40
|
+
archive files, in particular some .zip files, tend to
|
|
41
|
+
be messy and incorrectly archived, extracting right
|
|
42
|
+
into the current working directory as-is. This is not
|
|
43
|
+
always what the user wants to see.
|
|
44
|
+
|
|
45
|
+
This is specified here in the event that you may wonder
|
|
46
|
+
why there is code that checks for this - we have to
|
|
47
|
+
determine which working directory is to be used.
|
|
48
|
+
|
|
49
|
+
## The main class
|
|
50
|
+
|
|
51
|
+
This subsection will mention a few noteworthy tidbits about
|
|
52
|
+
the main class of the repackage gem.
|
|
53
|
+
|
|
54
|
+
The name of the class is class **Repackage::Repackage**. The
|
|
55
|
+
constant called <b>DEFAULT_TARGET_FORMAT_TYPE</b> will be
|
|
56
|
+
used to determine initially into which target format the
|
|
57
|
+
class shall repackage an existing archive. By default this will
|
|
58
|
+
be set to the String '.tar.xz', thus meaning that an archive,
|
|
59
|
+
such as .tar.gz, will be repackaged into a .tar.xz archive
|
|
60
|
+
instead.
|
|
61
|
+
|
|
62
|
+
The constant <b>WORKING_DIRECTORY</b> is used to specify
|
|
63
|
+
a distinct working directory. Currently the default will
|
|
64
|
+
be at <b>/tmp/repackage/</b>, but this may be changed.
|
|
65
|
+
On my own home system I am using /home/Temp/repackage/
|
|
66
|
+
instead, for instance. We thus have to preserve some
|
|
67
|
+
flexibility here.
|
|
68
|
+
|
|
69
|
+
## Executable at bin/repackage
|
|
70
|
+
|
|
71
|
+
Since as of May 2022 there is now an executable called
|
|
72
|
+
<b>repackage</b>. It used to be called repackager,
|
|
73
|
+
but I reconsidered; it seems simpler to remember
|
|
74
|
+
that the gem called <b>repackage</b> comes with an
|
|
75
|
+
executable called <b>repackage</b> rather than
|
|
76
|
+
<b>repackager</b>.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## Contact information and mandatory 2FA coming up in 2022
|
|
80
|
+
|
|
81
|
+
If your creative mind has ideas and specific suggestions to make this gem
|
|
82
|
+
more useful in general, feel free to drop me an email at any time, via:
|
|
83
|
+
|
|
84
|
+
shevy@inbox.lt
|
|
85
|
+
|
|
86
|
+
Before that email I used an email account at Google gmail, but in **2021** I
|
|
87
|
+
decided to slowly abandon gmail for various reasons. In order to limit this
|
|
88
|
+
explanation here, allow me to just briefly state that I do not feel as if I
|
|
89
|
+
want to promote any Google service anymore, for various reasons.
|
|
90
|
+
|
|
91
|
+
Do keep in mind that responding to emails may take some time, depending on
|
|
92
|
+
the amount of work I may have at that moment.
|
|
93
|
+
|
|
94
|
+
In 2022 rubygems.org decided to make 2FA mandatory for every gem owner:
|
|
95
|
+
see https://blog.rubygems.org/2022/06/13/making-packages-more-secure.html
|
|
96
|
+
|
|
97
|
+
As I can not use 2FA, for reasons I will skip explaining here (see
|
|
98
|
+
various github issue discussions in the past), this effectively means that
|
|
99
|
+
Betty Li and others who run the show at rubygems.org will perma-ban me
|
|
100
|
+
from using rubygems as a developer.
|
|
101
|
+
|
|
102
|
+
As I disagree with that decision completely, this will mean that all my
|
|
103
|
+
gems will be removed from rubygems.org prior to that sunset date, e. g.
|
|
104
|
+
before they permanently lock me out from the code that I used
|
|
105
|
+
to maintain. It is pointless to want to discuss this with them anymore -
|
|
106
|
+
they have made up their minds and decided that you can only use
|
|
107
|
+
the code if 2FA is in place, even though the code itself works just
|
|
108
|
+
fine. If you don't use 2FA you are effectively locked out from your
|
|
109
|
+
own code; I consider this a malicious attack. See also how they limited
|
|
110
|
+
discussions to people with mandatory 2FA on the ruby-bugtracker, thus
|
|
111
|
+
banning everyone permanently without 2FA:
|
|
112
|
+
|
|
113
|
+
https://bugs.ruby-lang.org/issues/18800
|
|
114
|
+
|
|
115
|
+
Guess it may indeed be time to finally abandon ruby - not because
|
|
116
|
+
ruby is a bad language, but there are people now in charge who
|
|
117
|
+
really should not be part of ruby in the first place.
|
|
118
|
+
|
|
File without changes
|
data/doc/README.gen
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
ADD_RUBY_BADGE
|
|
2
|
+
ADD_TIME_STAMP
|
|
3
|
+
|
|
4
|
+
# The repackage gem
|
|
5
|
+
|
|
6
|
+
<img src="https://i.imgur.com/7KpnuMj.jpg" style="margin: 0.5em">
|
|
7
|
+
|
|
8
|
+
## Dependencies of the repackage gem
|
|
9
|
+
|
|
10
|
+
In the past the repackage gem specifically depended on four other
|
|
11
|
+
external projects. In <b>May 2022</b> this mandatory list of
|
|
12
|
+
dependencies has been reduced to just <b>one</b>. However had,
|
|
13
|
+
it is still recommended that two of the other three gems are
|
|
14
|
+
installed as well.
|
|
15
|
+
|
|
16
|
+
The official list of dependencies thus recommended for the
|
|
17
|
+
<b>repackage</b> gem is as follows, in alphabetical order:
|
|
18
|
+
|
|
19
|
+
- colours
|
|
20
|
+
- extracter
|
|
21
|
+
- opn
|
|
22
|
+
|
|
23
|
+
## Clean working directory
|
|
24
|
+
|
|
25
|
+
As far as the **repackage** gem is concerned, a working
|
|
26
|
+
directory is needed to extract an archive. On my home
|
|
27
|
+
system this is:
|
|
28
|
+
|
|
29
|
+
/home/Temp/repackage/
|
|
30
|
+
|
|
31
|
+
For most other users this will be:
|
|
32
|
+
|
|
33
|
+
/tmp/repackage/
|
|
34
|
+
|
|
35
|
+
The reason why such a directory is necessary is so that
|
|
36
|
+
we do not begin to pollute any other directory. Some
|
|
37
|
+
archive files, in particular some .zip files, tend to
|
|
38
|
+
be messy and incorrectly archived, extracting right
|
|
39
|
+
into the current working directory as-is. This is not
|
|
40
|
+
always what the user wants to see.
|
|
41
|
+
|
|
42
|
+
This is specified here in the event that you may wonder
|
|
43
|
+
why there is code that checks for this - we have to
|
|
44
|
+
determine which working directory is to be used.
|
|
45
|
+
|
|
46
|
+
## The main class
|
|
47
|
+
|
|
48
|
+
This subsection will mention a few noteworthy tidbits about
|
|
49
|
+
the main class of the repackage gem.
|
|
50
|
+
|
|
51
|
+
The name of the class is class **Repackage::Repackage**. The
|
|
52
|
+
constant called <b>DEFAULT_TARGET_FORMAT_TYPE</b> will be
|
|
53
|
+
used to determine initially into which target format the
|
|
54
|
+
class shall repackage an existing archive. By default this will
|
|
55
|
+
be set to the String '.tar.xz', thus meaning that an archive,
|
|
56
|
+
such as .tar.gz, will be repackaged into a .tar.xz archive
|
|
57
|
+
instead.
|
|
58
|
+
|
|
59
|
+
The constant <b>WORKING_DIRECTORY</b> is used to specify
|
|
60
|
+
a distinct working directory. Currently the default will
|
|
61
|
+
be at <b>/tmp/repackage/</b>, but this may be changed.
|
|
62
|
+
On my own home system I am using /home/Temp/repackage/
|
|
63
|
+
instead, for instance. We thus have to preserve some
|
|
64
|
+
flexibility here.
|
|
65
|
+
|
|
66
|
+
## Executable at bin/repackage
|
|
67
|
+
|
|
68
|
+
Since as of May 2022 there is now an executable called
|
|
69
|
+
<b>repackage</b>. It used to be called repackager,
|
|
70
|
+
but I reconsidered; it seems simpler to remember
|
|
71
|
+
that the gem called <b>repackage</b> comes with an
|
|
72
|
+
executable called <b>repackage</b> rather than
|
|
73
|
+
<b>repackager</b>.
|
|
74
|
+
|
|
75
|
+
ADD_CONTACT_INFORMATION
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/ruby -w
|
|
2
|
+
# Encoding: UTF-8
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# =========================================================================== #
|
|
5
|
+
# require 'repackage/class/constants.rb'
|
|
6
|
+
# =========================================================================== #
|
|
7
|
+
module Repackage
|
|
8
|
+
|
|
9
|
+
class Repackage # === Repackage::Repackage
|
|
10
|
+
|
|
11
|
+
# ========================================================================= #
|
|
12
|
+
# === NAMESPACE
|
|
13
|
+
# ========================================================================= #
|
|
14
|
+
NAMESPACE = inspect
|
|
15
|
+
|
|
16
|
+
# ========================================================================= #
|
|
17
|
+
# === COMMAND_TO_CREATE_A_TAR_XZ_ARCHIVE
|
|
18
|
+
#
|
|
19
|
+
# This is the command that is used when a .tar.xz file is to be created.
|
|
20
|
+
# ========================================================================= #
|
|
21
|
+
COMMAND_TO_CREATE_A_TAR_XZ_ARCHIVE = 'tar -vcJf'
|
|
22
|
+
|
|
23
|
+
# ========================================================================= #
|
|
24
|
+
# === DEFAULT_EXTRACT_TO_THIS_DIRECTORY
|
|
25
|
+
# ========================================================================= #
|
|
26
|
+
if ENV['MY_TEMP']
|
|
27
|
+
DEFAULT_EXTRACT_TO_THIS_DIRECTORY = ENV['MY_TEMP'].to_s+'/repackage/' # Denote where to extract the stuff to.
|
|
28
|
+
else
|
|
29
|
+
DEFAULT_EXTRACT_TO_THIS_DIRECTORY = '/tmp/repackage/'
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# ========================================================================= #
|
|
33
|
+
# === SHALL_WE_DELETE_THE_OLD_ARCHIVE
|
|
34
|
+
#
|
|
35
|
+
# Remove the old source if this constant is true. Since as of June 2021
|
|
36
|
+
# this defaults to false, except in certain conditions met on my home
|
|
37
|
+
# setup where the variable that keeps track of it is turned to true
|
|
38
|
+
# actually. Most other users will probably never need to change this,
|
|
39
|
+
# though, so the default is to false.
|
|
40
|
+
# ========================================================================= #
|
|
41
|
+
SHALL_WE_DELETE_THE_OLD_ARCHIVE = false
|
|
42
|
+
|
|
43
|
+
# ========================================================================= #
|
|
44
|
+
# === COMMAND_TO_CREATE_A_ZIP_ARCHIVE
|
|
45
|
+
#
|
|
46
|
+
# Command to create a .zip archive.
|
|
47
|
+
# ========================================================================= #
|
|
48
|
+
COMMAND_TO_CREATE_A_ZIP_ARCHIVE = 'zip -r '
|
|
49
|
+
|
|
50
|
+
# ========================================================================= #
|
|
51
|
+
# === COMMAND_TO_CREATE_A_TAR_GZ_ARCHIVE
|
|
52
|
+
#
|
|
53
|
+
# Command to create a .tar.gz archive.
|
|
54
|
+
# ========================================================================= #
|
|
55
|
+
COMMAND_TO_CREATE_A_TAR_GZ_ARCHIVE = 'tar cfvz'
|
|
56
|
+
|
|
57
|
+
# ========================================================================= #
|
|
58
|
+
# === COMMAND_TO_CREATE_A_TAR_BZ2_ARCHIVE
|
|
59
|
+
#
|
|
60
|
+
# Command to create a .tar.bz2 archive.
|
|
61
|
+
# ========================================================================= #
|
|
62
|
+
COMMAND_TO_CREATE_A_TAR_BZ2_ARCHIVE = 'tar cfvj'
|
|
63
|
+
|
|
64
|
+
# ========================================================================= #
|
|
65
|
+
# === DEFAULT_TARGET_FORMAT_TYPE
|
|
66
|
+
#
|
|
67
|
+
# The target format comes here, thus allowing the user to change the
|
|
68
|
+
# default.
|
|
69
|
+
# ========================================================================= #
|
|
70
|
+
DEFAULT_TARGET_FORMAT_TYPE = '.tar.xz' # '.tar.bz2' '.zip'
|
|
71
|
+
|
|
72
|
+
# ========================================================================= #
|
|
73
|
+
# === DELETE_CODE_OF_CONDUCT_FILE_IF_IT_EXISTS
|
|
74
|
+
#
|
|
75
|
+
# The following variable is set to false by default. It has been added
|
|
76
|
+
# in September 2022 because another project (rbt) requires this
|
|
77
|
+
# setting - that is to toggle it on or off.
|
|
78
|
+
# ========================================================================= #
|
|
79
|
+
DELETE_CODE_OF_CONDUCT_FILE_IF_IT_EXISTS = false
|
|
80
|
+
|
|
81
|
+
# ========================================================================= #
|
|
82
|
+
# === LAST_DOWNLOADED_FILE
|
|
83
|
+
# ========================================================================= #
|
|
84
|
+
begin
|
|
85
|
+
require 'wget'
|
|
86
|
+
if Object.const_defined?(:Wget) and Wget.respond_to?(:download_to?)
|
|
87
|
+
LAST_DOWNLOADED_FILE = Wget.download_to?
|
|
88
|
+
end
|
|
89
|
+
rescue LoadError
|
|
90
|
+
LAST_DOWNLOADED_FILE = Dir.home.to_s+'/LAST_DOWNLOADED_FILE.md'
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
end; end
|