repackage 1.1.8 → 1.2.2
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 +62 -37
- data/doc/README.gen +14 -8
- data/lib/repackage/class/misc.rb +64 -58
- data/lib/repackage/colours/colours.rb +14 -2
- data/lib/repackage/version/version.rb +2 -2
- data/test/testing_repackage.rb +4 -0
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb33b5ada9ae0db19a7b1408e9d5b1b5f330dc194b0e88ed9d9d422f0745fba4
|
|
4
|
+
data.tar.gz: 33175928c33b9b10a677a4c87bc373eee5e68d3ea4e636a28f5cf36ed623b949
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6b6ed8b1461f89715d1c48e251bcc6f2a0146a4a410836c2dddb95e308f2196001e2812c28a95e50163d7176ac10442011e2de853d63be59083046df11adafb
|
|
7
|
+
data.tar.gz: b0098b975e7a4838509304d1ad7eef5379b2c6f3053cba1049bd83a66d17771cc0dbbf80bf2bd388df1c9dc76ea43ea4a93cfa4a3033290ae3bc5a1714b2dcd3
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
[](https://www.ruby-lang.org/en/)
|
|
3
3
|
[](https://badge.fury.io/rb/repackage)
|
|
4
4
|
|
|
5
|
-
This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">
|
|
5
|
+
This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">11.11.2023</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">04:38:42</span> o'clock.
|
|
6
6
|
|
|
7
7
|
# The repackage gem
|
|
8
8
|
|
|
@@ -23,6 +23,12 @@ The official list of dependencies thus recommended for the
|
|
|
23
23
|
- extracter
|
|
24
24
|
- opn
|
|
25
25
|
|
|
26
|
+
However had, since as of November 2023, the colours gem is now
|
|
27
|
+
optional. If it is installed on your system then it will be
|
|
28
|
+
used; otherwise it will be silently ignored. Colours are nice
|
|
29
|
+
to have, but the repackage gem must also work with colours
|
|
30
|
+
not being available (e. g. the colours gem was NOT installed).
|
|
31
|
+
|
|
26
32
|
## Clean working directory
|
|
27
33
|
|
|
28
34
|
As far as the **repackage** gem is concerned, a working
|
|
@@ -68,12 +74,13 @@ flexibility here.
|
|
|
68
74
|
|
|
69
75
|
## Executable at bin/repackage
|
|
70
76
|
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
<b>
|
|
77
|
+
Since as of May 2022 there is now an <b>executable</b> called
|
|
78
|
+
<b>repackage</b>. It used to be called <b>repackager</b>,
|
|
79
|
+
but I reconsidered; it seems simpler to remember that the gem
|
|
80
|
+
here is called <b>repackage</b>; then people may easily
|
|
81
|
+
and instantly know that there may be an executable called
|
|
82
|
+
<b>repackage</b>, residing at bin/repackage, rather than
|
|
83
|
+
a file residing at <b>bin/repackager</b>.
|
|
77
84
|
|
|
78
85
|
|
|
79
86
|
## Contact information and mandatory 2FA coming up in 2022
|
|
@@ -84,35 +91,53 @@ more useful in general, feel free to drop me an email at any time, via:
|
|
|
84
91
|
shevy@inbox.lt
|
|
85
92
|
|
|
86
93
|
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
|
|
94
|
+
decided to slowly abandon gmail, for various reasons. In order to limit the
|
|
88
95
|
explanation here, allow me to just briefly state that I do not feel as if I
|
|
89
|
-
want to promote any Google service anymore
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
96
|
+
want to promote any Google service anymore when the user becomes the end
|
|
97
|
+
product (such as via data collection by upstream services, including other
|
|
98
|
+
proxy-services). My feeling is that this is a hugely flawed business model
|
|
99
|
+
to begin with, and I no longer wish to support this in any way, even if
|
|
100
|
+
only indirectly so, such as by using services of companies that try to
|
|
101
|
+
promote this flawed model.
|
|
102
|
+
|
|
103
|
+
In regards to responding to emails: please keep in mind that responding
|
|
104
|
+
may take some time, depending on the amount of work I may have at that
|
|
105
|
+
moment. So it is not that emails are ignored; it is more that I have not
|
|
106
|
+
(yet) found the time to read and reply. This means there may be a delay
|
|
107
|
+
of days, weeks and in some instances also months. There is, unfortunately,
|
|
108
|
+
not much I can do when I need to prioritise my time investment, but I try
|
|
109
|
+
to consider <b>all</b> feedback as an opportunity to improve my projects
|
|
110
|
+
nonetheless.
|
|
111
|
+
|
|
112
|
+
In <b>2022</b> rubygems.org decided to make 2FA mandatory for every
|
|
113
|
+
gem owner eventually:
|
|
114
|
+
|
|
115
|
+
see
|
|
116
|
+
https://blog.rubygems.org/2022/06/13/making-packages-more-secure.html
|
|
117
|
+
|
|
118
|
+
Mandatory 2FA will eventually be extended to all rubygems.org developers and
|
|
119
|
+
maintainers. As I can not use 2FA, for reasons I will skip explaining here,
|
|
120
|
+
this means that my projects will eventually be removed, as I no longer
|
|
121
|
+
have any control over my projects hosted on rubygems.org (because I
|
|
122
|
+
can not use 2FA).
|
|
123
|
+
|
|
124
|
+
At that point, I no longer have any control what is done to my projects
|
|
125
|
+
since whoever is controlling the gems ecosystem took away our control
|
|
126
|
+
here. I am not sure at which point ruby became corporate-controlled -
|
|
127
|
+
that was not the case several years ago, so something has
|
|
128
|
+
changed.
|
|
129
|
+
|
|
130
|
+
Ruby also only allows 2FA users to participate on the issue tracker these
|
|
131
|
+
days:
|
|
132
|
+
|
|
133
|
+
https://bugs.ruby-lang.org/issues/18800
|
|
134
|
+
|
|
135
|
+
But this has been reverted some months ago, so it is no longer applicable.
|
|
136
|
+
Suffice to say that I do not think that we should only be allowed to
|
|
137
|
+
interact on the world wide web when some 'authority' authenticated us,
|
|
138
|
+
such as via mandatory 2FA, so I hope this won't come back again.
|
|
139
|
+
|
|
140
|
+
Fighting spam is a noble goal, but when it also means you lock out
|
|
141
|
+
real human people then this is definitely NOT a good situation
|
|
142
|
+
to be had.
|
|
118
143
|
|
data/doc/README.gen
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
ADD_TIME_STAMP
|
|
1
|
+
DEFAULT_HEADER
|
|
3
2
|
|
|
4
3
|
# The repackage gem
|
|
5
4
|
|
|
@@ -20,6 +19,12 @@ The official list of dependencies thus recommended for the
|
|
|
20
19
|
- extracter
|
|
21
20
|
- opn
|
|
22
21
|
|
|
22
|
+
However had, since as of November 2023, the colours gem is now
|
|
23
|
+
optional. If it is installed on your system then it will be
|
|
24
|
+
used; otherwise it will be silently ignored. Colours are nice
|
|
25
|
+
to have, but the repackage gem must also work with colours
|
|
26
|
+
not being available (e. g. the colours gem was NOT installed).
|
|
27
|
+
|
|
23
28
|
## Clean working directory
|
|
24
29
|
|
|
25
30
|
As far as the **repackage** gem is concerned, a working
|
|
@@ -65,11 +70,12 @@ flexibility here.
|
|
|
65
70
|
|
|
66
71
|
## Executable at bin/repackage
|
|
67
72
|
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
<b>
|
|
73
|
+
Since as of May 2022 there is now an <b>executable</b> called
|
|
74
|
+
<b>repackage</b>. It used to be called <b>repackager</b>,
|
|
75
|
+
but I reconsidered; it seems simpler to remember that the gem
|
|
76
|
+
here is called <b>repackage</b>; then people may easily
|
|
77
|
+
and instantly know that there may be an executable called
|
|
78
|
+
<b>repackage</b>, residing at bin/repackage, rather than
|
|
79
|
+
a file residing at <b>bin/repackager</b>.
|
|
74
80
|
|
|
75
81
|
ADD_CONTACT_INFORMATION
|
data/lib/repackage/class/misc.rb
CHANGED
|
@@ -49,13 +49,6 @@ class Repackage # === Repackage::Repackage
|
|
|
49
49
|
i.squeeze '/'
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
# ========================================================================= #
|
|
53
|
-
# === cliner
|
|
54
|
-
# ========================================================================= #
|
|
55
|
-
def cliner
|
|
56
|
-
e rev+('=' * 80)
|
|
57
|
-
end
|
|
58
|
-
|
|
59
52
|
# ========================================================================= #
|
|
60
53
|
# === try_glob
|
|
61
54
|
#
|
|
@@ -295,13 +288,6 @@ class Repackage # === Repackage::Repackage
|
|
|
295
288
|
)
|
|
296
289
|
end
|
|
297
290
|
|
|
298
|
-
# ========================================================================= #
|
|
299
|
-
# === rev
|
|
300
|
-
# ========================================================================= #
|
|
301
|
-
def rev
|
|
302
|
-
::Repackage.rev
|
|
303
|
-
end
|
|
304
|
-
|
|
305
291
|
# ========================================================================= #
|
|
306
292
|
# === extract_to_this_directory?
|
|
307
293
|
# ========================================================================= #
|
|
@@ -376,38 +362,10 @@ class Repackage # === Repackage::Repackage
|
|
|
376
362
|
end
|
|
377
363
|
end; alias remove_extracted_data remove_old_extracted_directory_should_it_exist # === remove_extracted_data
|
|
378
364
|
|
|
379
|
-
# ========================================================================= #
|
|
380
|
-
# === set_extract_to
|
|
381
|
-
#
|
|
382
|
-
# Set the @extract_to variable here.
|
|
383
|
-
# ========================================================================= #
|
|
384
|
-
def set_extract_to(
|
|
385
|
-
i = DEFAULT_EXTRACT_TO_THIS_DIRECTORY # Must be the initial constant as default.
|
|
386
|
-
)
|
|
387
|
-
case i
|
|
388
|
-
# ======================================================================= #
|
|
389
|
-
# === :default
|
|
390
|
-
# ======================================================================= #
|
|
391
|
-
when :default,
|
|
392
|
-
nil
|
|
393
|
-
i = DEFAULT_EXTRACT_TO_THIS_DIRECTORY
|
|
394
|
-
end
|
|
395
|
-
i = i.to_s.dup
|
|
396
|
-
# ======================================================================= #
|
|
397
|
-
# The next clause is an override, in particular for my home system.
|
|
398
|
-
# ======================================================================= #
|
|
399
|
-
if File.directory? '/home/Temp/'
|
|
400
|
-
i = '/home/Temp/repackage/'
|
|
401
|
-
end
|
|
402
|
-
i = '/tmp/' if i.empty? # Hardcoded rescue-step in this case.
|
|
403
|
-
i << '/' unless i.end_with? '/' # A directory has a trailing /.
|
|
404
|
-
@internal_hash[:extract_to_this_directory] = i
|
|
405
|
-
end; alias set_extract_to_this_directory set_extract_to # === set_extract_to_this_directory
|
|
406
|
-
|
|
407
365
|
# ========================================================================= #
|
|
408
366
|
# === extract_to?
|
|
409
367
|
#
|
|
410
|
-
# Defaults to /home/Temp/ on my home system.
|
|
368
|
+
# Defaults to /home/x/Temp/ on my home system.
|
|
411
369
|
# ========================================================================= #
|
|
412
370
|
def extract_to?
|
|
413
371
|
@internal_hash[:extract_to_this_directory]
|
|
@@ -796,16 +754,18 @@ class Repackage # === Repackage::Repackage
|
|
|
796
754
|
# format.
|
|
797
755
|
# =================================================================== #
|
|
798
756
|
if is_it_already_in_the_correct_archive_format?(this_file)
|
|
799
|
-
opn; e rev+'The file at '+sfile(this_file)+' is already in '\
|
|
800
|
-
'the desired target format ('+target_format?+
|
|
801
|
-
|
|
757
|
+
opn; e rev+'The file at '+sfile(this_file)+rev+' is already in '\
|
|
758
|
+
'the desired target format ('+target_format?+
|
|
759
|
+
rev+').'
|
|
760
|
+
opn; e "#{rev}Repackaging into the same target format makes no sense, "\
|
|
802
761
|
"thus aborting now."
|
|
803
762
|
else
|
|
804
|
-
opn; e 'We will try to repackage this archive into the `'+
|
|
805
|
-
simp(target_format_type?)+'`'
|
|
806
|
-
opn; e 'format type.'
|
|
807
|
-
opn; e 'It will be extracted into the directory '+
|
|
808
|
-
|
|
763
|
+
opn; e rev+'We will try to repackage this archive into the `'+
|
|
764
|
+
simp(target_format_type?)+rev+'`'
|
|
765
|
+
opn; e rev+'format type.'
|
|
766
|
+
opn; e rev+'It will be extracted into the directory '+
|
|
767
|
+
sdir(extract_to?)+
|
|
768
|
+
rev+'.'
|
|
809
769
|
# ================================================================= #
|
|
810
770
|
# Here we know that the file exists and that it can be repackaged
|
|
811
771
|
# into another target format. Thus, we can repackage it. We
|
|
@@ -867,17 +827,19 @@ class Repackage # === Repackage::Repackage
|
|
|
867
827
|
# === repackage_this_particular_file
|
|
868
828
|
# ========================================================================= #
|
|
869
829
|
def repackage_this_particular_file(this_file)
|
|
870
|
-
opn; e rev+'The file '+sfile(this_file)+' will be repackaged '\
|
|
871
|
-
'into the '+
|
|
830
|
+
opn; e rev+'The file '+sfile(this_file)+rev+' will be repackaged '\
|
|
831
|
+
'into the '+rev+
|
|
832
|
+
orange(repackage_to_which_format?)+
|
|
833
|
+
rev+' format.'
|
|
872
834
|
copy_this_file_to_the_working_directory(this_file)
|
|
873
835
|
working_directory = working_directory?
|
|
874
836
|
cd(working_directory) # Go to the working directory.
|
|
875
837
|
set_start_dir(working_directory)
|
|
876
|
-
opn; e 'Working from the directory `'+sdir(working_directory)+
|
|
838
|
+
opn; e rev+'Working from the directory `'+sdir(working_directory)+
|
|
839
|
+
rev+'` next.'
|
|
877
840
|
absolute_path = File.absolute_path(this_file)
|
|
878
|
-
opn; e 'The actual file that will be used for the '
|
|
879
|
-
|
|
880
|
-
opn; e 'step now resides at: '
|
|
841
|
+
opn; e rev+'The actual file that will be used for the repackaging'
|
|
842
|
+
opn; e rev+'step now resides at: '
|
|
881
843
|
e
|
|
882
844
|
e " #{sdir(absolute_path)}"
|
|
883
845
|
e
|
|
@@ -913,13 +875,57 @@ class Repackage # === Repackage::Repackage
|
|
|
913
875
|
# ===================================================================== #
|
|
914
876
|
run_the_proper_to_archive_command(
|
|
915
877
|
remove_file_extension_from(
|
|
916
|
-
absolute_path # This here is e. g. "/home/Temp/repackage/htop-3.1.2.tar.gz".
|
|
878
|
+
absolute_path # This here is e. g. "/home/x/Temp/repackage/htop-3.1.2.tar.gz".
|
|
917
879
|
)
|
|
918
880
|
)
|
|
919
881
|
consider_copying_the_new_archive_into_the_current_working_directory
|
|
920
882
|
end
|
|
921
883
|
end
|
|
922
884
|
|
|
885
|
+
# ========================================================================= #
|
|
886
|
+
# === set_extract_to
|
|
887
|
+
#
|
|
888
|
+
# Set the @extract_to variable here.
|
|
889
|
+
# ========================================================================= #
|
|
890
|
+
def set_extract_to(
|
|
891
|
+
i = DEFAULT_EXTRACT_TO_THIS_DIRECTORY # Must be the initial constant as default.
|
|
892
|
+
)
|
|
893
|
+
case i
|
|
894
|
+
# ======================================================================= #
|
|
895
|
+
# === :default
|
|
896
|
+
# ======================================================================= #
|
|
897
|
+
when :default,
|
|
898
|
+
nil
|
|
899
|
+
i = DEFAULT_EXTRACT_TO_THIS_DIRECTORY
|
|
900
|
+
end
|
|
901
|
+
i = i.to_s.dup
|
|
902
|
+
# ======================================================================= #
|
|
903
|
+
# The next clause is an override, in particular for my home system.
|
|
904
|
+
# ======================================================================= #
|
|
905
|
+
if File.directory? '/home/x/Temp/'
|
|
906
|
+
i = '/home/x/Temp/repackage/'
|
|
907
|
+
elsif File.directory? '/home/Temp/'
|
|
908
|
+
i = '/home/Temp/repackage/'
|
|
909
|
+
end
|
|
910
|
+
i = '/tmp/' if i.empty? # Hardcoded rescue-step in this case.
|
|
911
|
+
i << '/' unless i.end_with? '/' # A directory has a trailing /.
|
|
912
|
+
@internal_hash[:extract_to_this_directory] = i
|
|
913
|
+
end; alias set_extract_to_this_directory set_extract_to # === set_extract_to_this_directory
|
|
914
|
+
|
|
915
|
+
# ========================================================================= #
|
|
916
|
+
# === cliner
|
|
917
|
+
# ========================================================================= #
|
|
918
|
+
def cliner
|
|
919
|
+
e rev+('=' * 80)
|
|
920
|
+
end
|
|
921
|
+
|
|
922
|
+
# ========================================================================= #
|
|
923
|
+
# === rev
|
|
924
|
+
# ========================================================================= #
|
|
925
|
+
def rev
|
|
926
|
+
::Repackage.rev
|
|
927
|
+
end
|
|
928
|
+
|
|
923
929
|
# ========================================================================= #
|
|
924
930
|
# === run (run tag)
|
|
925
931
|
# ========================================================================= #
|
|
@@ -25,7 +25,18 @@ module Repackage
|
|
|
25
25
|
if @try_to_use_colours
|
|
26
26
|
begin
|
|
27
27
|
require 'colours'
|
|
28
|
-
|
|
28
|
+
if Object.const_defined?(:Colours) and
|
|
29
|
+
Colours.respond_to?(:simp) and
|
|
30
|
+
Colours.respond_to?(:sfancy) and
|
|
31
|
+
Colours.respond_to?(:sdir) and
|
|
32
|
+
Colours.respond_to?(:simp)
|
|
33
|
+
# All is ok in this case.
|
|
34
|
+
else # else we conclude that the colours-gem is not available.
|
|
35
|
+
@try_to_use_colours = false
|
|
36
|
+
end
|
|
37
|
+
rescue LoadError
|
|
38
|
+
@try_to_use_colours = false
|
|
39
|
+
end
|
|
29
40
|
end
|
|
30
41
|
end
|
|
31
42
|
|
|
@@ -33,7 +44,8 @@ module Repackage
|
|
|
33
44
|
# === Repackage.rev
|
|
34
45
|
# ========================================================================= #
|
|
35
46
|
def self.rev
|
|
36
|
-
if @try_to_use_colours and
|
|
47
|
+
if @try_to_use_colours and
|
|
48
|
+
Object.const_defined?(:Colours)
|
|
37
49
|
return ::Colours.rev
|
|
38
50
|
end
|
|
39
51
|
return ''
|
|
@@ -9,11 +9,11 @@ module Repackage
|
|
|
9
9
|
# =========================================================================== #
|
|
10
10
|
# === VERSION
|
|
11
11
|
# =========================================================================== #
|
|
12
|
-
VERSION = '1.
|
|
12
|
+
VERSION = '1.2.2'
|
|
13
13
|
|
|
14
14
|
# =========================================================================== #
|
|
15
15
|
# === LAST_UPDATE
|
|
16
16
|
# =========================================================================== #
|
|
17
|
-
LAST_UPDATE = '
|
|
17
|
+
LAST_UPDATE = '11.11.2023'
|
|
18
18
|
|
|
19
19
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: repackage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert A. Heiler
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-11-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: extracter
|
|
@@ -48,6 +48,7 @@ files:
|
|
|
48
48
|
- lib/repackage/www/README.md
|
|
49
49
|
- lib/repackage/www/embeddable_interface.rb
|
|
50
50
|
- repackage.gemspec
|
|
51
|
+
- test/testing_repackage.rb
|
|
51
52
|
homepage: https://rubygems.org/gems/repackage
|
|
52
53
|
licenses:
|
|
53
54
|
- MIT
|
|
@@ -60,14 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
60
61
|
requirements:
|
|
61
62
|
- - ">="
|
|
62
63
|
- !ruby/object:Gem::Version
|
|
63
|
-
version: 2.
|
|
64
|
+
version: 2.7.6
|
|
64
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
66
|
requirements:
|
|
66
67
|
- - ">="
|
|
67
68
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: 3.
|
|
69
|
+
version: 3.4.18
|
|
69
70
|
requirements: []
|
|
70
|
-
rubygems_version: 3.
|
|
71
|
+
rubygems_version: 3.4.18
|
|
71
72
|
signing_key:
|
|
72
73
|
specification_version: 4
|
|
73
74
|
summary: This gem is called repackage. It allows the user to repackage a given archive,
|