archive-tar-external 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +97 -94
- data/MANIFEST +7 -7
- data/README +47 -47
- data/Rakefile +26 -26
- data/archive-tar-external.gemspec +39 -40
- data/doc/tar_external.txt +109 -109
- data/lib/archive/tar/external.rb +279 -281
- data/test/test_archive_tar_external.rb +203 -203
- metadata +35 -27
data/CHANGES
CHANGED
@@ -1,94 +1,97 @@
|
|
1
|
-
== 1.3.
|
2
|
-
*
|
3
|
-
|
4
|
-
|
5
|
-
*
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
*
|
10
|
-
|
11
|
-
|
12
|
-
*
|
13
|
-
* Added
|
14
|
-
|
15
|
-
|
16
|
-
*
|
17
|
-
|
18
|
-
|
19
|
-
*
|
20
|
-
|
21
|
-
*
|
22
|
-
*
|
23
|
-
|
24
|
-
*
|
25
|
-
|
26
|
-
|
27
|
-
*
|
28
|
-
|
29
|
-
|
30
|
-
*
|
31
|
-
|
32
|
-
|
33
|
-
*
|
34
|
-
|
35
|
-
|
36
|
-
*
|
37
|
-
|
38
|
-
*
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
*
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
*
|
53
|
-
|
54
|
-
|
55
|
-
*
|
56
|
-
|
57
|
-
|
58
|
-
*
|
59
|
-
|
60
|
-
*
|
61
|
-
|
62
|
-
|
63
|
-
*
|
64
|
-
|
65
|
-
*
|
66
|
-
*
|
67
|
-
* Removed the
|
68
|
-
|
69
|
-
*
|
70
|
-
*
|
71
|
-
|
72
|
-
|
73
|
-
* Added
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
* The
|
78
|
-
|
79
|
-
|
80
|
-
*
|
81
|
-
|
82
|
-
|
83
|
-
* Added
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
*
|
88
|
-
*
|
89
|
-
|
90
|
-
|
91
|
-
* Added
|
92
|
-
|
93
|
-
|
94
|
-
*
|
1
|
+
== 1.3.1 - 20-Sep-2011
|
2
|
+
* Refactored the Rakefile a bit.
|
3
|
+
|
4
|
+
== 1.3.0 - 16-Jan-2010
|
5
|
+
* Altered the source code layout, which requires a change in your require
|
6
|
+
line. It's now require 'archive/tar/external'.
|
7
|
+
* Moved some content from the .txt file to the README.
|
8
|
+
* Updated one test to use a skip as needed.
|
9
|
+
* Moved source code to github.
|
10
|
+
|
11
|
+
== 1.2.3 - 25-Sep-2009
|
12
|
+
* Fixed a packaging bug.
|
13
|
+
* Added cygwin and mingw to Windows checks.
|
14
|
+
* Now requires open3 properly for Ruby 1.9 on Windows.
|
15
|
+
* Minor modifications to the gemspec.
|
16
|
+
* Added the 'gem' rake task.
|
17
|
+
|
18
|
+
== 1.2.2 - 28-Jul-2009
|
19
|
+
* Compatibility fixes for Ruby 1.9.x and JRuby.
|
20
|
+
* Singleton methods that were previously synonyms are now true aliases.
|
21
|
+
* License changed to Artistic 2.0.
|
22
|
+
* Several gemspec updates, including an updated description, the addition
|
23
|
+
of a license and development dependencies and refactored platform handling.
|
24
|
+
* Added test-unit and ptools as development dependencies for the test suite.
|
25
|
+
* Some refactoring of the test suite to take advantage of some of the features
|
26
|
+
in test-unit 2.x.
|
27
|
+
* Renamed the test file to test_archive_tar_external.rb.
|
28
|
+
|
29
|
+
== 1.2.1 - 30-Jul-2007
|
30
|
+
* The TarError class is now Tar::Error.
|
31
|
+
* Added a Rakefile with tasks for installation and testing.
|
32
|
+
* Removed the install.rb file. Installation is now handled by the Rakefile.
|
33
|
+
* Documentation updates.
|
34
|
+
|
35
|
+
== 1.2.0 - 7-Apr-2006
|
36
|
+
* Project renamed 'archive-tar-external'.
|
37
|
+
* The 'Tar' class is now Tar::External.
|
38
|
+
* The RAA project name is now tar-external.
|
39
|
+
* Added the Tar::External.uncompress_archive class method for archives
|
40
|
+
that already exist.
|
41
|
+
* Added the Tar::External.extract_archive class method for tarballs
|
42
|
+
that already exist.
|
43
|
+
* Added the Tar::External#compressed_archive_name= method.
|
44
|
+
|
45
|
+
== 1.1.1 - 1-Mar-2006
|
46
|
+
* Replaced PLATFORM with RUBY_PLATFORM since the former is deprecated
|
47
|
+
for Ruby 1.9/2.0.
|
48
|
+
|
49
|
+
== 1.1.0 - 10-Feb-2006
|
50
|
+
* Internal refactoring changes - now uses block form of Open3.popen3.
|
51
|
+
* Most methods now return self instead of true (better for chaining).
|
52
|
+
* Corresponding test suite changes.
|
53
|
+
|
54
|
+
== 1.0.0 - 1-Sep-2005
|
55
|
+
* Moved project to RubyForge.
|
56
|
+
* Modified the constructor to accept a file pattern. If present, becomes
|
57
|
+
a shortcut for Tar.new + Tar#create_archive.
|
58
|
+
* Constructor merely calls .to_s on the archive name, rather than validating
|
59
|
+
that it's a String argument.
|
60
|
+
* You can now specify the tar program you wish to use, e.g. "tar", "gtar", etc.
|
61
|
+
* Fixed a bug in Tar#uncompress_archive where it wasn't finding the appropriate
|
62
|
+
compressed archive name.
|
63
|
+
* Added aliases for most methods whereby you can omit the word "archive" in
|
64
|
+
the method name now, e.g. Tar#compress is an alias for Tar#compress_archive.
|
65
|
+
* Now more polite about closing open handles from Open3.
|
66
|
+
* The (rdoc) documentation is now inlined.
|
67
|
+
* Removed the tarsimple.rd and tarsimple.html files.
|
68
|
+
* Made most documentation rdoc friendly.
|
69
|
+
* Updated the README and MANIFEST files.
|
70
|
+
* Removed the INSTALL file. The installation instructions are now included
|
71
|
+
in the README file.
|
72
|
+
* Test suite updates.
|
73
|
+
* Added a gemspec.
|
74
|
+
|
75
|
+
== 0.3.0 - 10-Aug-2004
|
76
|
+
* Added the update_archive() method.
|
77
|
+
* The expand_archive() method has been renamed to extract_archive().
|
78
|
+
For backward's compatability, an alias remains so you may use
|
79
|
+
either method name.
|
80
|
+
* The extract_archive() method now accepts a list of file names as
|
81
|
+
an argument. If present, then only those file names are extracted.
|
82
|
+
If not, then the entire archive is extracted.
|
83
|
+
* Added corresponding tests and documentation updates.
|
84
|
+
|
85
|
+
== 0.2.0 - 9-Aug-2004
|
86
|
+
* Added the add_to_archive() method.
|
87
|
+
* Removed the VERSION() class method. Use the constant instead.
|
88
|
+
* Changed "TarException" and "CompressionException" to "TarError" and
|
89
|
+
"CompressError", respectively.
|
90
|
+
* Moved rd documentation into its own file under the 'doc' directory.
|
91
|
+
* Added unit tests and updated the docs.
|
92
|
+
* Removed the html file. You can generate that on your own if you
|
93
|
+
wish using the rd2 tool.
|
94
|
+
* Added warranty information.
|
95
|
+
|
96
|
+
== 0.1.0 - 24-Jan-2003
|
97
|
+
* Initial Release
|
data/MANIFEST
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
* MANIFEST
|
2
|
-
* CHANGES
|
3
|
-
* INSTALL
|
4
|
-
* Rakefile
|
5
|
-
* archive-tar-external.gemspec
|
6
|
-
* doc/tar_external.txt
|
7
|
-
* lib/archive/tar_external.rb
|
1
|
+
* MANIFEST
|
2
|
+
* CHANGES
|
3
|
+
* INSTALL
|
4
|
+
* Rakefile
|
5
|
+
* archive-tar-external.gemspec
|
6
|
+
* doc/tar_external.txt
|
7
|
+
* lib/archive/tar_external.rb
|
8
8
|
* test/test_archive_tar_external.rb
|
data/README
CHANGED
@@ -1,47 +1,47 @@
|
|
1
|
-
== Description
|
2
|
-
A simple tar & compress library that nicely wraps external system calls.
|
3
|
-
|
4
|
-
== Installation
|
5
|
-
gem install archive-tar-external
|
6
|
-
|
7
|
-
== Synopsis
|
8
|
-
require 'archive/tar/external'
|
9
|
-
include Archive
|
10
|
-
|
11
|
-
# The long way
|
12
|
-
t = Tar::External.new('test.tar')
|
13
|
-
t.create_archive('*.rb')
|
14
|
-
t.compress_archive('gzip')
|
15
|
-
|
16
|
-
# The short way
|
17
|
-
t = Tar::External.new('test.tar', '*.rb', 'gzip')
|
18
|
-
|
19
|
-
== Prerequisites
|
20
|
-
The win32-open3 library (MS Windows only).
|
21
|
-
The 'tar' command line program.
|
22
|
-
At least one compression program, e.g. gzip, bzip2, zip, etc.
|
23
|
-
|
24
|
-
== Known Issues
|
25
|
-
The tar program that comes with Solaris will not raise an error if you
|
26
|
-
try to expand a file from an archive that does not contain that file.
|
27
|
-
|
28
|
-
If you come across any other issues, please report them on the project
|
29
|
-
page at http://www.rubyforge.org/projects/shards.
|
30
|
-
|
31
|
-
== Future Plans
|
32
|
-
Anything folks are looking for?
|
33
|
-
|
34
|
-
== License
|
35
|
-
Artistic 2.0
|
36
|
-
|
37
|
-
== Warranty
|
38
|
-
This package is provided "as is" and without any express or
|
39
|
-
implied warranties, including, without limitation, the implied
|
40
|
-
warranties of merchantability and fitness for a particular purpose.
|
41
|
-
|
42
|
-
== Copyright
|
43
|
-
(C) 2003 -
|
44
|
-
All Rights Reserved
|
45
|
-
|
46
|
-
== Author
|
47
|
-
Daniel J. Berger
|
1
|
+
== Description
|
2
|
+
A simple tar & compress library that nicely wraps external system calls.
|
3
|
+
|
4
|
+
== Installation
|
5
|
+
gem install archive-tar-external
|
6
|
+
|
7
|
+
== Synopsis
|
8
|
+
require 'archive/tar/external'
|
9
|
+
include Archive
|
10
|
+
|
11
|
+
# The long way
|
12
|
+
t = Tar::External.new('test.tar')
|
13
|
+
t.create_archive('*.rb')
|
14
|
+
t.compress_archive('gzip')
|
15
|
+
|
16
|
+
# The short way
|
17
|
+
t = Tar::External.new('test.tar', '*.rb', 'gzip')
|
18
|
+
|
19
|
+
== Prerequisites
|
20
|
+
The win32-open3 library (MS Windows only).
|
21
|
+
The 'tar' command line program.
|
22
|
+
At least one compression program, e.g. gzip, bzip2, zip, etc.
|
23
|
+
|
24
|
+
== Known Issues
|
25
|
+
The tar program that comes with Solaris will not raise an error if you
|
26
|
+
try to expand a file from an archive that does not contain that file.
|
27
|
+
|
28
|
+
If you come across any other issues, please report them on the project
|
29
|
+
page at http://www.rubyforge.org/projects/shards.
|
30
|
+
|
31
|
+
== Future Plans
|
32
|
+
Anything folks are looking for?
|
33
|
+
|
34
|
+
== License
|
35
|
+
Artistic 2.0
|
36
|
+
|
37
|
+
== Warranty
|
38
|
+
This package is provided "as is" and without any express or
|
39
|
+
implied warranties, including, without limitation, the implied
|
40
|
+
warranties of merchantability and fitness for a particular purpose.
|
41
|
+
|
42
|
+
== Copyright
|
43
|
+
(C) 2003 - 2011 Daniel J. Berger
|
44
|
+
All Rights Reserved
|
45
|
+
|
46
|
+
== Author
|
47
|
+
Daniel J. Berger
|
data/Rakefile
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
CLEAN.include("**/*.gem", "**/*.rbc")
|
6
|
+
|
7
|
+
namespace :gem do
|
8
|
+
desc 'Build the archive-tar-external gem'
|
9
|
+
task :create do
|
10
|
+
spec = eval(IO.read('archive-tar-external.gemspec'))
|
11
|
+
Gem::Builder.new(spec).build
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'Install the archive-tar-external library as a gem'
|
15
|
+
task :install => [:gem] do
|
16
|
+
file = Dir["*.gem"].first
|
17
|
+
sh "gem install #{file}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
Rake::TestTask.new do |t|
|
22
|
+
t.warning = true
|
23
|
+
t.verbose = true
|
24
|
+
end
|
25
|
+
|
26
|
+
task :default => :test
|
@@ -1,40 +1,39 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rbconfig'
|
3
|
-
|
4
|
-
Gem::Specification.new do |spec|
|
5
|
-
spec.name = 'archive-tar-external'
|
6
|
-
spec.version = '1.3.
|
7
|
-
spec.summary = 'A simple way to create tar archives using external calls'
|
8
|
-
spec.license = 'Artistic 2.0'
|
9
|
-
spec.author = 'Daniel Berger'
|
10
|
-
spec.email = 'djberg96@gmail.com'
|
11
|
-
spec.homepage = 'http://www.rubyforge.org/shards'
|
12
|
-
spec.test_file = 'test/test_archive_tar_external.rb'
|
13
|
-
spec.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
'
|
20
|
-
'
|
21
|
-
'
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
tar files
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
spec.add_development_dependency('
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rbconfig'
|
3
|
+
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = 'archive-tar-external'
|
6
|
+
spec.version = '1.3.1'
|
7
|
+
spec.summary = 'A simple way to create tar archives using external calls'
|
8
|
+
spec.license = 'Artistic 2.0'
|
9
|
+
spec.author = 'Daniel Berger'
|
10
|
+
spec.email = 'djberg96@gmail.com'
|
11
|
+
spec.homepage = 'http://www.rubyforge.org/shards'
|
12
|
+
spec.test_file = 'test/test_archive_tar_external.rb'
|
13
|
+
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
14
|
+
|
15
|
+
spec.rubyforge_project = 'shards'
|
16
|
+
|
17
|
+
spec.extra_rdoc_files = [
|
18
|
+
'README',
|
19
|
+
'CHANGES',
|
20
|
+
'MANIFEST',
|
21
|
+
'doc/tar_external.txt'
|
22
|
+
]
|
23
|
+
|
24
|
+
spec.description = <<-EOF
|
25
|
+
The archive-tar-external is a simple wrapper interface for creating
|
26
|
+
tar files using your system's tar command. You can also easily compress
|
27
|
+
your tar files with your system's compression programs such as zip, gzip,
|
28
|
+
or bzip2.
|
29
|
+
EOF
|
30
|
+
|
31
|
+
spec.add_development_dependency('test-unit')
|
32
|
+
spec.add_development_dependency('ptools')
|
33
|
+
|
34
|
+
if File::ALT_SEPARATOR
|
35
|
+
if RUBY_VERSION.to_f < 1.9 && RUBY_PLATFORM !~ /java/i
|
36
|
+
spec.add_dependency('win32-open3')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/doc/tar_external.txt
CHANGED
@@ -1,109 +1,109 @@
|
|
1
|
-
== Description
|
2
|
-
A simple tar interface using external system calls.
|
3
|
-
|
4
|
-
== Synopsis
|
5
|
-
# Assuming we have three .txt files, t1.txt, t2.txt, t3.txt ...
|
6
|
-
require 'archive/tar/external'
|
7
|
-
include Archive
|
8
|
-
|
9
|
-
t = Tar::External.new("myfile.tar")
|
10
|
-
|
11
|
-
t.create_archive("*.txt")
|
12
|
-
t.compress_archive("bzip2") # 'myfile.tar.bz2' now exists
|
13
|
-
|
14
|
-
t.uncompress_archive("bunzip2")
|
15
|
-
|
16
|
-
t.archive_name # "myfile.tar"
|
17
|
-
t.archive_info # ["t1.txt","t2.txt","t3.txt"]
|
18
|
-
|
19
|
-
t.add_to_archive("t4.txt","t5.txt")
|
20
|
-
t.expand_archive
|
21
|
-
|
22
|
-
== Constants
|
23
|
-
VERSION
|
24
|
-
Current version number of this library. This is a string.
|
25
|
-
|
26
|
-
== Class Methods
|
27
|
-
Archive::Tar::External.new(archive_name, pattern=nil, program=nil)
|
28
|
-
Creates an instance of an Archive::Tar::External object. The +archive_name+ is
|
29
|
-
the name of the tarball. While a '.tar' extension is recommended based on
|
30
|
-
years of convention, it is not enforced.
|
31
|
-
|
32
|
-
If +pattern+ is provided, then the Archive#create_archive method is called
|
33
|
-
internally.
|
34
|
-
|
35
|
-
If +program+ is provided, then the Archive#compress_archive method is
|
36
|
-
called internally.
|
37
|
-
|
38
|
-
Note that +archive_name+ name must be a String, or a TypeError is raised.
|
39
|
-
|
40
|
-
Archive::Tar::External.expand_archive(archive_name, *files)
|
41
|
-
Identical to the instance method of the same name, except that you must
|
42
|
-
specify the +archive_name+, and the tar program is hard coded to 'tar xf'.
|
43
|
-
|
44
|
-
Archive::Tar::External.uncompress_archive(archive_name, program='gunzip')
|
45
|
-
Identical to the instance method of the same name, except that you must
|
46
|
-
specify the +archive_name+ as the first argument.
|
47
|
-
|
48
|
-
== Instance Methods
|
49
|
-
Archive;:Tar#add(file1 [, file2, ...])
|
50
|
-
Archive::Tar::External#add_to_archive(file1 [, file2, ...])
|
51
|
-
Adds a list of files to the current archive. At least one file must be
|
52
|
-
provided or a Tar::Error is raised.
|
53
|
-
|
54
|
-
Archive::Tar::External#archive_info
|
55
|
-
Archive::Tar::External#info
|
56
|
-
Returns an array of file names that are included within the tarball.
|
57
|
-
|
58
|
-
Archive::Tar::External#archive_name
|
59
|
-
Returns the current archive name.
|
60
|
-
|
61
|
-
Archive::Tar::External#archive_name=
|
62
|
-
Sets the current archive name.
|
63
|
-
|
64
|
-
Archive::Tar::External#compress(program="gzip")
|
65
|
-
Archive::Tar::External#compress_archive(program="gzip")
|
66
|
-
Compresses the tarball using the program you pass to this method. The
|
67
|
-
default is "gzip".
|
68
|
-
|
69
|
-
Note that any arguments you want to be passed along with the program can
|
70
|
-
simply be included as part of the program, e.g. "gzip -f".
|
71
|
-
|
72
|
-
Archive::Tar::External#create(file_pattern)
|
73
|
-
Archive::Tar::External#create_archive(file_pattern)
|
74
|
-
Creates a new tarball, including those files which match 'file_pattern'.
|
75
|
-
|
76
|
-
Archive::Tar::External#expand_archive(files=nil)
|
77
|
-
Archive::Tar::External#extract_archive(files=nil)
|
78
|
-
Expands the contents of the tarball. Note that this method does NOT delete
|
79
|
-
the tarball.
|
80
|
-
|
81
|
-
If file names are provided, then only those files are extracted.
|
82
|
-
|
83
|
-
Archive::Tar::External#tar_program
|
84
|
-
Returns the name of the tar program used. The default is "tar".
|
85
|
-
|
86
|
-
Archive::Tar::External#tar_program=(program_name)
|
87
|
-
Sets the name of the tar program to be used.
|
88
|
-
|
89
|
-
Archive::Tar::External#uncompress(program="gunzip")
|
90
|
-
Archive::Tar::External#uncompress_archive(program="gunzip")
|
91
|
-
Uncompresses the tarball using the program you pass to this method. The
|
92
|
-
default is "gunzip".
|
93
|
-
|
94
|
-
As for compress_archive(), you can pass arguments along as part of the
|
95
|
-
argument.
|
96
|
-
|
97
|
-
Archive::Tar::External#update(files)
|
98
|
-
Archive::Tar::External#update_archive(files)
|
99
|
-
Updates the given +files+ in the archive, i.e they are added if they
|
100
|
-
are not already in the archive or have been modified.
|
101
|
-
|
102
|
-
== Exceptions
|
103
|
-
Tar::Error
|
104
|
-
Raised if something goes wrong during the execution of any methods that
|
105
|
-
use the tar command internally.
|
106
|
-
|
107
|
-
Tar::CompressError
|
108
|
-
Raised if something goes wrong during the Tar#compress_archive or
|
109
|
-
Tar#uncompress_archive methods.
|
1
|
+
== Description
|
2
|
+
A simple tar interface using external system calls.
|
3
|
+
|
4
|
+
== Synopsis
|
5
|
+
# Assuming we have three .txt files, t1.txt, t2.txt, t3.txt ...
|
6
|
+
require 'archive/tar/external'
|
7
|
+
include Archive
|
8
|
+
|
9
|
+
t = Tar::External.new("myfile.tar")
|
10
|
+
|
11
|
+
t.create_archive("*.txt")
|
12
|
+
t.compress_archive("bzip2") # 'myfile.tar.bz2' now exists
|
13
|
+
|
14
|
+
t.uncompress_archive("bunzip2")
|
15
|
+
|
16
|
+
t.archive_name # "myfile.tar"
|
17
|
+
t.archive_info # ["t1.txt","t2.txt","t3.txt"]
|
18
|
+
|
19
|
+
t.add_to_archive("t4.txt","t5.txt")
|
20
|
+
t.expand_archive
|
21
|
+
|
22
|
+
== Constants
|
23
|
+
VERSION
|
24
|
+
Current version number of this library. This is a string.
|
25
|
+
|
26
|
+
== Class Methods
|
27
|
+
Archive::Tar::External.new(archive_name, pattern=nil, program=nil)
|
28
|
+
Creates an instance of an Archive::Tar::External object. The +archive_name+ is
|
29
|
+
the name of the tarball. While a '.tar' extension is recommended based on
|
30
|
+
years of convention, it is not enforced.
|
31
|
+
|
32
|
+
If +pattern+ is provided, then the Archive#create_archive method is called
|
33
|
+
internally.
|
34
|
+
|
35
|
+
If +program+ is provided, then the Archive#compress_archive method is
|
36
|
+
called internally.
|
37
|
+
|
38
|
+
Note that +archive_name+ name must be a String, or a TypeError is raised.
|
39
|
+
|
40
|
+
Archive::Tar::External.expand_archive(archive_name, *files)
|
41
|
+
Identical to the instance method of the same name, except that you must
|
42
|
+
specify the +archive_name+, and the tar program is hard coded to 'tar xf'.
|
43
|
+
|
44
|
+
Archive::Tar::External.uncompress_archive(archive_name, program='gunzip')
|
45
|
+
Identical to the instance method of the same name, except that you must
|
46
|
+
specify the +archive_name+ as the first argument.
|
47
|
+
|
48
|
+
== Instance Methods
|
49
|
+
Archive;:Tar#add(file1 [, file2, ...])
|
50
|
+
Archive::Tar::External#add_to_archive(file1 [, file2, ...])
|
51
|
+
Adds a list of files to the current archive. At least one file must be
|
52
|
+
provided or a Tar::Error is raised.
|
53
|
+
|
54
|
+
Archive::Tar::External#archive_info
|
55
|
+
Archive::Tar::External#info
|
56
|
+
Returns an array of file names that are included within the tarball.
|
57
|
+
|
58
|
+
Archive::Tar::External#archive_name
|
59
|
+
Returns the current archive name.
|
60
|
+
|
61
|
+
Archive::Tar::External#archive_name=
|
62
|
+
Sets the current archive name.
|
63
|
+
|
64
|
+
Archive::Tar::External#compress(program="gzip")
|
65
|
+
Archive::Tar::External#compress_archive(program="gzip")
|
66
|
+
Compresses the tarball using the program you pass to this method. The
|
67
|
+
default is "gzip".
|
68
|
+
|
69
|
+
Note that any arguments you want to be passed along with the program can
|
70
|
+
simply be included as part of the program, e.g. "gzip -f".
|
71
|
+
|
72
|
+
Archive::Tar::External#create(file_pattern)
|
73
|
+
Archive::Tar::External#create_archive(file_pattern)
|
74
|
+
Creates a new tarball, including those files which match 'file_pattern'.
|
75
|
+
|
76
|
+
Archive::Tar::External#expand_archive(files=nil)
|
77
|
+
Archive::Tar::External#extract_archive(files=nil)
|
78
|
+
Expands the contents of the tarball. Note that this method does NOT delete
|
79
|
+
the tarball.
|
80
|
+
|
81
|
+
If file names are provided, then only those files are extracted.
|
82
|
+
|
83
|
+
Archive::Tar::External#tar_program
|
84
|
+
Returns the name of the tar program used. The default is "tar".
|
85
|
+
|
86
|
+
Archive::Tar::External#tar_program=(program_name)
|
87
|
+
Sets the name of the tar program to be used.
|
88
|
+
|
89
|
+
Archive::Tar::External#uncompress(program="gunzip")
|
90
|
+
Archive::Tar::External#uncompress_archive(program="gunzip")
|
91
|
+
Uncompresses the tarball using the program you pass to this method. The
|
92
|
+
default is "gunzip".
|
93
|
+
|
94
|
+
As for compress_archive(), you can pass arguments along as part of the
|
95
|
+
argument.
|
96
|
+
|
97
|
+
Archive::Tar::External#update(files)
|
98
|
+
Archive::Tar::External#update_archive(files)
|
99
|
+
Updates the given +files+ in the archive, i.e they are added if they
|
100
|
+
are not already in the archive or have been modified.
|
101
|
+
|
102
|
+
== Exceptions
|
103
|
+
Tar::Error
|
104
|
+
Raised if something goes wrong during the execution of any methods that
|
105
|
+
use the tar command internally.
|
106
|
+
|
107
|
+
Tar::CompressError
|
108
|
+
Raised if something goes wrong during the Tar#compress_archive or
|
109
|
+
Tar#uncompress_archive methods.
|