extracter 1.2.21

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a4dd1b2c2a31905a0e465da5168dc38aac97090433c01b1778c441264907b7f2
4
+ data.tar.gz: 9a0b0a5aafaba2ba966f6582f31f89591673572130d1fe47477352e477dbfbff
5
+ SHA512:
6
+ metadata.gz: ca21cc9c72020968bc4c5fdddea44213a2ce7328cba03c91b3286dac67351cd8c6d9d13747b9a5aede3c4a724ff6d32b3b36554c05ba4dcbccf48ff7fa8b521b
7
+ data.tar.gz: a5a76451755727807c2e13887f7e106959e2bde7237fc98df62ec0f873aa72f06e642adfef470197c87e5b8c733716d391941c40be9a4df84d6931a9ef41f727
data/README.md ADDED
@@ -0,0 +1,207 @@
1
+ [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://www.gobolinux.org/)
2
+ [![forthebadge](https://forthebadge.com/images/badges/made-with-ruby.svg)](https://www.ruby-lang.org/en/)
3
+ [![Gem Version](https://badge.fury.io/rb/extracter.svg)](https://badge.fury.io/rb/extracter)
4
+
5
+ # Extracter
6
+
7
+ ## The primary goal of the extracter gem
8
+
9
+ This gem can help the user if said user wants to **extract a given
10
+ archive**.
11
+
12
+ ## Scope of Extracter
13
+
14
+ The scope (and goals) for **class Extracter** are really simple: throw
15
+ any archive format at it, and the class will try to **extract** it.
16
+
17
+ It can be used on the commandline as well, via **bin/extracter**.
18
+
19
+ Note that in order to extract a given archive, some programs must
20
+ be available still. On linux this tends to be **tar**, **bzip2**,
21
+ **xz** and **gzip**. On windows it is recommended to use **7-zip**.
22
+
23
+ ## How to find out whether a given file is a valid archive
24
+
25
+ You can find out whether a given input **xyz** is a valid archive by
26
+ issuing the following toplevel-method:
27
+
28
+ Extracter.is_this_a_valid_archive?(path)
29
+
30
+ This will return either true or false. In <b>August 2022</b> the
31
+ code was adapted slightly to return true no matter if the
32
+ file extension is upcased or lowercased. In other words: a
33
+ file called <b>foobar.zip</b> will work fine, as will the same
34
+ file but this time called <b>foobar.ZIP</b>. I had the latter issue
35
+ when I downloaded a BIOS Firmware update in August 2022 - the
36
+ file was .ZIP and Extracter did not work. So that was a tiny
37
+ bug in the extracter gem - it really should work on .ZIP
38
+ files just fine as well, since these are simply .zip files
39
+ anyway.
40
+
41
+ Keep in mind that not all archive formats have been added so far,
42
+ so this will return false even if it should instead return true.
43
+
44
+ More support for archive formats will be added whenever possible,
45
+ as time permits.
46
+
47
+ ## How to extract an archive through class Extracter, in pure ruby
48
+
49
+ You can use the following method to extract an archive, in ruby,
50
+ into a specific target location on the given computer system:
51
+
52
+ Extracter.extract_what_to('foo-1.0.tar.xz', '/tmp')
53
+
54
+ The first argument is the local path to an archive. The second
55
+ argument simply specifies the **target**, usually the target
56
+ directory. Can't get any simpler than that!
57
+
58
+ ## Colour support
59
+
60
+ If the **Colours** gem (**gem install colours**) is available then colour
61
+ support is possible for **class Extracter::Extracter**.
62
+
63
+ For class Extracter::Extracter, whether colours are supported is
64
+ determined via the method called **.colours?**. If true then colours
65
+ will be used - at the least it will be tried.
66
+
67
+ If you do not want to have colours, for whatever the reason or use case,
68
+ then you can disable this, e. g. through the method call
69
+ **.disable_colours** specifically, to give one example for doing so.
70
+
71
+ ## class Extracter::ExtractIt
72
+
73
+ **class Extracter::ExtractIt** was a standalone .gem (named **extract_it**),
74
+ but since as of **September 2020** it is now part of "module Extracter".
75
+
76
+ Basically this class is is a wrapper over the class Extracter, which will
77
+ extract archives in general. The extraction step will go into the current
78
+ working directory.
79
+
80
+ ## What archives and files can be extracted?
81
+
82
+ **class Extracter** can extract .tar.xz, .tar.bz, .tar.gz, tar.Z,
83
+ .zip and numerous other file formats. This requires that tools
84
+ such as **tar** or **gzip** or **xz** are installed and available
85
+ on the target computer-machine, as we will simply use ruby to
86
+ shell out to these other programs. Ruby is the ultimate 'glue'
87
+ language after all.
88
+
89
+ This class can also **extract audio-files** if ffmpeg is installed and
90
+ the multimedia_paradise project is available (**gem install
91
+ multimedia_paradise**), as well as squashfs files (typically
92
+ .img files). In the latter case, such an .img file will be mounted
93
+ in the current directory. You could then simply copy the content,
94
+ to have a 'full' archive situation (mounting means read-only by
95
+ deafult in this regard, hence why the copy-operation has to be
96
+ done).
97
+
98
+ Support for extracting **.jar files** - used by Java - has been
99
+ added in **May 2020**.
100
+
101
+ Support for 'extracting' .pdf files has been added in **January 2021**.
102
+ This depends on **poppler**, and it is not really an extraction; we
103
+ simply convert the file to a .txt (text) file. For this functionality
104
+ the **pdf_paradise** project has to be available.
105
+
106
+ Support for extracting archives on windows via 7zip has been added
107
+ in **August 2021**. This was done because I had problems with 'tar'
108
+ on windows; using 7zip bypassed these problems, and I needed to
109
+ be able to extract archives on windows easily.
110
+
111
+ ## Usage example:
112
+
113
+ _ = Extracter.extract_what_to('foobar-1.0.tar.bz2', '/tmp/')
114
+
115
+ You can also use the .new variant, which goes like so::
116
+
117
+ _ = Extracter.new('foo.gz', '/tmp', false) # Yes, you can extract .gz files.
118
+ _.run
119
+
120
+ The argument false means "do not yet run". You have to invoke
121
+ the .run method in that case.
122
+
123
+ The second argument to the above method is the target location,
124
+ the directory where we will extract our archive to.
125
+
126
+ ## strip components
127
+
128
+ Say that we have a path such as **/home/x/htop/htop-3.0.5.tar.xz**. You
129
+ want to extract it, say, into **/tmp/**.
130
+
131
+ Normally this would create the following directory:
132
+
133
+ /tmp/htop-3.0.5/
134
+
135
+ In most cases this is what the user wants; at the least I expect this
136
+ if an archive is correctly tarred up, such as a **.tar.xz** file.
137
+
138
+ But there are use cases where this is not the case so. For instance,
139
+ say that you already did creat such a directory, cd-ed into it and
140
+ now just want to extract right **into** this directory. Then you
141
+ don't want to end up with:
142
+
143
+ /tmp/htop-3.0.5/htop-3.0.5/
144
+
145
+ **tar** allows us to avoid this, by using the commandline flag
146
+ called **--strip-components=1**.
147
+
148
+ In **October 2021** I needed this for the rbt-project. Since the
149
+ old class Extracter did not support it, and the code was very messy,
150
+ I ended up re-writing the project. It should now be better -
151
+ at the least cleaner than it once was. And support for the above
152
+ is possible as well now; even with a specific method call
153
+ (which is **.strip_components()**).
154
+
155
+ ## Extracter.remove_archive_type
156
+
157
+ If you have a use case where you would like to remove the file
158
+ suffix from an archive, such as turning
159
+ "https://rubygems.org/rubygems/rubygems-3.3.14.tgz" into
160
+ "rubygems-3.3.14" exactly, then you can use
161
+ Extracter.remove_archive_type() for this.
162
+
163
+ Example follows:
164
+
165
+ Extracter.remove_archive_type(File.basename("https://rubygems.org/rubygems/rubygems-3.3.14.tgz")) # => "rubygems-3.3.14"
166
+
167
+
168
+ ## Contact information and mandatory 2FA coming up in 2022
169
+
170
+ If your creative mind has ideas and specific suggestions to make this gem
171
+ more useful in general, feel free to drop me an email at any time, via:
172
+
173
+ shevy@inbox.lt
174
+
175
+ Before that email I used an email account at Google gmail, but in **2021** I
176
+ decided to slowly abandon gmail for various reasons. In order to limit this
177
+ explanation here, allow me to just briefly state that I do not feel as if I
178
+ want to promote any Google service anymore, for various reasons.
179
+
180
+ Do keep in mind that responding to emails may take some time, depending on
181
+ the amount of work I may have at that moment.
182
+
183
+ In 2022 rubygems.org decided to make 2FA mandatory for every gem owner:
184
+ see https://blog.rubygems.org/2022/06/13/making-packages-more-secure.html
185
+
186
+ As I can not use 2FA, for reasons I will skip explaining here (see
187
+ various github issue discussions in the past), this effectively means that
188
+ Betty Li and others who run the show at rubygems.org will perma-ban me
189
+ from using rubygems as a developer.
190
+
191
+ As I disagree with that decision completely, this will mean that all my
192
+ gems will be removed from rubygems.org prior to that sunset date, e. g.
193
+ before they permanently lock me out from the code that I used
194
+ to maintain. It is pointless to want to discuss this with them anymore -
195
+ they have made up their minds and decided that you can only use
196
+ the code if 2FA is in place, even though the code itself works just
197
+ fine. If you don't use 2FA you are effectively locked out from your
198
+ own code; I consider this a malicious attack. See also how they limited
199
+ discussions to people with mandatory 2FA on the ruby-bugtracker, thus
200
+ banning everyone permanently without 2FA:
201
+
202
+ https://bugs.ruby-lang.org/issues/18800
203
+
204
+ Guess it may indeed be time to finally abandon ruby - not because
205
+ ruby is a bad language, but there are people now in charge who
206
+ really should not be part of ruby in the first place.
207
+
data/bin/extract ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'extracter'
6
+
7
+ Extracter.what_to(ARGV, Dir.pwd)
data/bin/extract_it ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'extracter/requires/require_the_extracter_project.rb'
6
+
7
+ _ = Extracter.extract_it(ARGV, false)
8
+ if ARGV[1]
9
+ _.show_commands_used
10
+ else
11
+ _.be_silent
12
+ end
13
+ _.run # extractit
data/doc/README.gen ADDED
@@ -0,0 +1,165 @@
1
+ ADD_RUBY_BADGE
2
+
3
+ # Extracter
4
+
5
+ ## The primary goal of the extracter gem
6
+
7
+ This gem can help the user if said user wants to **extract a given
8
+ archive**.
9
+
10
+ ## Scope of Extracter
11
+
12
+ The scope (and goals) for **class Extracter** are really simple: throw
13
+ any archive format at it, and the class will try to **extract** it.
14
+
15
+ It can be used on the commandline as well, via **bin/extracter**.
16
+
17
+ Note that in order to extract a given archive, some programs must
18
+ be available still. On linux this tends to be **tar**, **bzip2**,
19
+ **xz** and **gzip**. On windows it is recommended to use **7-zip**.
20
+
21
+ ## How to find out whether a given file is a valid archive
22
+
23
+ You can find out whether a given input **xyz** is a valid archive by
24
+ issuing the following toplevel-method:
25
+
26
+ Extracter.is_this_a_valid_archive?(path)
27
+
28
+ This will return either true or false. In <b>August 2022</b> the
29
+ code was adapted slightly to return true no matter if the
30
+ file extension is upcased or lowercased. In other words: a
31
+ file called <b>foobar.zip</b> will work fine, as will the same
32
+ file but this time called <b>foobar.ZIP</b>. I had the latter issue
33
+ when I downloaded a BIOS Firmware update in August 2022 - the
34
+ file was .ZIP and Extracter did not work. So that was a tiny
35
+ bug in the extracter gem - it really should work on .ZIP
36
+ files just fine as well, since these are simply .zip files
37
+ anyway.
38
+
39
+ Keep in mind that not all archive formats have been added so far,
40
+ so this will return false even if it should instead return true.
41
+
42
+ More support for archive formats will be added whenever possible,
43
+ as time permits.
44
+
45
+ ## How to extract an archive through class Extracter, in pure ruby
46
+
47
+ You can use the following method to extract an archive, in ruby,
48
+ into a specific target location on the given computer system:
49
+
50
+ Extracter.extract_what_to('foo-1.0.tar.xz', '/tmp')
51
+
52
+ The first argument is the local path to an archive. The second
53
+ argument simply specifies the **target**, usually the target
54
+ directory. Can't get any simpler than that!
55
+
56
+ ## Colour support
57
+
58
+ If the **Colours** gem (**gem install colours**) is available then colour
59
+ support is possible for **class Extracter::Extracter**.
60
+
61
+ For class Extracter::Extracter, whether colours are supported is
62
+ determined via the method called **.colours?**. If true then colours
63
+ will be used - at the least it will be tried.
64
+
65
+ If you do not want to have colours, for whatever the reason or use case,
66
+ then you can disable this, e. g. through the method call
67
+ **.disable_colours** specifically, to give one example for doing so.
68
+
69
+ ## class Extracter::ExtractIt
70
+
71
+ **class Extracter::ExtractIt** was a standalone .gem (named **extract_it**),
72
+ but since as of **September 2020** it is now part of "module Extracter".
73
+
74
+ Basically this class is is a wrapper over the class Extracter, which will
75
+ extract archives in general. The extraction step will go into the current
76
+ working directory.
77
+
78
+ ## What archives and files can be extracted?
79
+
80
+ **class Extracter** can extract .tar.xz, .tar.bz, .tar.gz, tar.Z,
81
+ .zip and numerous other file formats. This requires that tools
82
+ such as **tar** or **gzip** or **xz** are installed and available
83
+ on the target computer-machine, as we will simply use ruby to
84
+ shell out to these other programs. Ruby is the ultimate 'glue'
85
+ language after all.
86
+
87
+ This class can also **extract audio-files** if ffmpeg is installed and
88
+ the multimedia_paradise project is available (**gem install
89
+ multimedia_paradise**), as well as squashfs files (typically
90
+ .img files). In the latter case, such an .img file will be mounted
91
+ in the current directory. You could then simply copy the content,
92
+ to have a 'full' archive situation (mounting means read-only by
93
+ deafult in this regard, hence why the copy-operation has to be
94
+ done).
95
+
96
+ Support for extracting **.jar files** - used by Java - has been
97
+ added in **May 2020**.
98
+
99
+ Support for 'extracting' .pdf files has been added in **January 2021**.
100
+ This depends on **poppler**, and it is not really an extraction; we
101
+ simply convert the file to a .txt (text) file. For this functionality
102
+ the **pdf_paradise** project has to be available.
103
+
104
+ Support for extracting archives on windows via 7zip has been added
105
+ in **August 2021**. This was done because I had problems with 'tar'
106
+ on windows; using 7zip bypassed these problems, and I needed to
107
+ be able to extract archives on windows easily.
108
+
109
+ ## Usage example:
110
+
111
+ _ = Extracter.extract_what_to('foobar-1.0.tar.bz2', '/tmp/')
112
+
113
+ You can also use the .new variant, which goes like so::
114
+
115
+ _ = Extracter.new('foo.gz', '/tmp', false) # Yes, you can extract .gz files.
116
+ _.run
117
+
118
+ The argument false means "do not yet run". You have to invoke
119
+ the .run method in that case.
120
+
121
+ The second argument to the above method is the target location,
122
+ the directory where we will extract our archive to.
123
+
124
+ ## strip components
125
+
126
+ Say that we have a path such as **/home/x/htop/htop-3.0.5.tar.xz**. You
127
+ want to extract it, say, into **/tmp/**.
128
+
129
+ Normally this would create the following directory:
130
+
131
+ /tmp/htop-3.0.5/
132
+
133
+ In most cases this is what the user wants; at the least I expect this
134
+ if an archive is correctly tarred up, such as a **.tar.xz** file.
135
+
136
+ But there are use cases where this is not the case so. For instance,
137
+ say that you already did creat such a directory, cd-ed into it and
138
+ now just want to extract right **into** this directory. Then you
139
+ don't want to end up with:
140
+
141
+ /tmp/htop-3.0.5/htop-3.0.5/
142
+
143
+ **tar** allows us to avoid this, by using the commandline flag
144
+ called **--strip-components=1**.
145
+
146
+ In **October 2021** I needed this for the rbt-project. Since the
147
+ old class Extracter did not support it, and the code was very messy,
148
+ I ended up re-writing the project. It should now be better -
149
+ at the least cleaner than it once was. And support for the above
150
+ is possible as well now; even with a specific method call
151
+ (which is **.strip_components()**).
152
+
153
+ ## Extracter.remove_archive_type
154
+
155
+ If you have a use case where you would like to remove the file
156
+ suffix from an archive, such as turning
157
+ "https://rubygems.org/rubygems/rubygems-3.3.14.tgz" into
158
+ "rubygems-3.3.14" exactly, then you can use
159
+ Extracter.remove_archive_type() for this.
160
+
161
+ Example follows:
162
+
163
+ Extracter.remove_archive_type(File.basename("https://rubygems.org/rubygems/rubygems-3.3.14.tgz")) # => "rubygems-3.3.14"
164
+
165
+ ADD_CONTACT_INFORMATION
data/extracter.gemspec ADDED
@@ -0,0 +1,106 @@
1
+ # =========================================================================== #
2
+ # Gemspec for Project Extracter.
3
+ # =========================================================================== #
4
+ require 'extracter/version/version.rb'
5
+ require 'roebe'
6
+
7
+ Gem::Specification.new { |s|
8
+
9
+ s.name = 'extracter'
10
+ s.version = Extracter::VERSION
11
+ s.date = Time.now.strftime('%Y-%m-%d')
12
+
13
+ DESCRIPTION = <<-EOF
14
+
15
+ This fairly small project can be used to extract different
16
+ archive formats such as .tar.bz2 or .tbz - archives such
17
+ as .gem and .lzma will also work.
18
+
19
+ You can also extract audio, by making use of class ExtractAudio
20
+ (part of the multimedia_paradise gem. The latter is - and should
21
+ be - optional, though. If you have no such use case then you
22
+ won't need to install the multimedia_paradise gem.
23
+
24
+ Usage example:
25
+
26
+ require 'extracter'
27
+
28
+ Extracter.new('/foo/bla-1.0.tar.bz2')
29
+
30
+ The second argument that can be passed to the method new()
31
+ specifies where this should be extract to.
32
+
33
+ For example:
34
+
35
+ Extracter.new('/foo/bla-1.0.tar.bz2', '/opt')
36
+
37
+ This would extract to the /opt directory.
38
+
39
+ You can query whether input is an archive or not via:
40
+
41
+ Extracter.is_archive? 'foo.tar.xz'
42
+
43
+ As of April 2014 we also provide a bin/extract file, so that
44
+ you can simply extract something from the commandline.
45
+
46
+ Since as of November 2018, class Extracter can also "extract"
47
+ .iso files. (The .iso will be mounted to a directory that
48
+ will be created, actually.)
49
+
50
+ EOF
51
+
52
+ s.summary = DESCRIPTION
53
+ s.description = DESCRIPTION
54
+
55
+ s.authors = ['Robert A. Heiler']
56
+ s.email = Roebe.email?
57
+ s.files = Dir['**/*']
58
+ s.licenses = 'MIT'
59
+ s.homepage = 'https://rubygems.org/gems/extracter'
60
+
61
+ # ========================================================================= #
62
+ # Show this when a user installs the project.
63
+ # ========================================================================= #
64
+ s.post_install_message = <<-EOF
65
+
66
+ class Extracter can be used to extract archives, such as .tar.gz or
67
+ .zip.
68
+
69
+ If you need some help, you can invoke bin/extract via:
70
+
71
+ extract --help
72
+
73
+ In general, the syntax for extract is kept simple. Just pass in the
74
+ archive that has to be extracted as the first argument to
75
+ extract ( bin/extract) , and class Extracter will try to extract
76
+ it, if it is a registered archive format.
77
+
78
+ In ruby code, you may be able to use class Extracter in this manner:
79
+
80
+ require 'extracter'
81
+ Extracter[file_path_here]
82
+
83
+ or
84
+
85
+ require 'extracter'
86
+ Extracter.new(file_path_here)
87
+
88
+ Specific example:
89
+
90
+ require 'extracter'
91
+ Extracter.new('htop-2.2.0.tar.xz')
92
+
93
+ See the --help option.
94
+
95
+ EOF
96
+
97
+ s.required_ruby_version = '>= '+Roebe.third_most_stable_version_of_ruby
98
+ s.required_rubygems_version = '>= '+Gem::VERSION
99
+ s.rubygems_version = '>= '+Gem::VERSION
100
+
101
+ # ========================================================================= #
102
+ # Specify the dependencies for this gem:
103
+ # ========================================================================= #
104
+ s.add_dependency 'opn'
105
+
106
+ }
@@ -0,0 +1,140 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Extracter::Base
6
+ #
7
+ # Usage example:
8
+ #
9
+ # Extracter::Base.new(ARGV)
10
+ #
11
+ # =========================================================================== #
12
+ # require 'extracter/base/base.rb'; < ::Extracter::Base
13
+ # =========================================================================== #
14
+ module Extracter
15
+
16
+ class Base # === Extracter::Base
17
+
18
+ begin
19
+ require 'colours'
20
+ rescue LoadError; end
21
+
22
+ # ========================================================================= #
23
+ # === reset
24
+ # ========================================================================= #
25
+ def reset
26
+ # ======================================================================= #
27
+ # === @internal_hash
28
+ # ======================================================================= #
29
+ @internal_hash = {}
30
+ # ======================================================================= #
31
+ # === :use_colours
32
+ # ======================================================================= #
33
+ @internal_hash[:use_colours] = true
34
+ end
35
+
36
+ # ========================================================================= #
37
+ # === cyan
38
+ # ========================================================================= #
39
+ def cyan?
40
+ return Colours::CYAN if Object.const_defined?(:Colours) and use_colours?
41
+ return ''
42
+ end
43
+
44
+ # ========================================================================= #
45
+ # === tomato
46
+ # ========================================================================= #
47
+ def tomato(i = '')
48
+ return Colours.tomato(i) if use_colours?
49
+ return i
50
+ end
51
+
52
+ # ========================================================================= #
53
+ # === simp
54
+ # ========================================================================= #
55
+ def simp(i = '')
56
+ return Colours.simp(i) if use_colours?
57
+ return i
58
+ end
59
+
60
+ # ========================================================================= #
61
+ # === ewarn
62
+ # ========================================================================= #
63
+ def ewarn(i = '')
64
+ if use_colours? and Object.const_defined?(:Colours)
65
+ e Colours.swarn(i)
66
+ else
67
+ e i
68
+ end
69
+ end
70
+
71
+ # ========================================================================= #
72
+ # === sfile
73
+ # ========================================================================= #
74
+ def sfile(i = '')
75
+ return Colours.sfancy(i) if use_colours?
76
+ return i
77
+ end
78
+
79
+ # ========================================================================= #
80
+ # === sfancy
81
+ # ========================================================================= #
82
+ def sfancy(i = '')
83
+ return Colours.sfancy(i) if use_colours?
84
+ return i
85
+ end
86
+
87
+ # ========================================================================= #
88
+ # === sdir
89
+ # ========================================================================= #
90
+ def sdir(i = '')
91
+ return Colours.sdir(i) if use_colours?
92
+ return i
93
+ end
94
+
95
+ # ========================================================================= #
96
+ # === use_colours?
97
+ #
98
+ # Determine whether we will use colours in class Extracter.
99
+ # ========================================================================= #
100
+ def use_colours?
101
+ @internal_hash[:use_colours]
102
+ end; alias colours? use_colours? # === colours?
103
+
104
+ # ========================================================================= #
105
+ # === e (e tag)
106
+ # ========================================================================= #
107
+ def e(i = '')
108
+ puts i
109
+ end
110
+
111
+ # ========================================================================= #
112
+ # === cpr
113
+ # ========================================================================= #
114
+ def cpr(a, b)
115
+ require 'fileutils' unless Object.const_defined?(:FileUtils)
116
+ FileUtils.cp_r(a, b)
117
+ end
118
+
119
+ # ========================================================================= #
120
+ # === move
121
+ # ========================================================================= #
122
+ def move(a, b)
123
+ require 'fileutils' unless Object.const_defined?(:FileUtils)
124
+ FileUtils.mv(a, b)
125
+ end; alias mv move # === mv
126
+
127
+ # ========================================================================= #
128
+ # === remove_this_directory
129
+ # ========================================================================= #
130
+ def remove_this_directory(i)
131
+ if File.directory? i
132
+ FileUtils.rm_r(i) unless i == '/'
133
+ end
134
+ end
135
+
136
+ end; end
137
+
138
+ if __FILE__ == $PROGRAM_NAME
139
+ Extracter::Extracter.new(ARGV)
140
+ end # base.rb