archive-tar-external 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/{CHANGES → CHANGES.md} +18 -15
- data/{MANIFEST → MANIFEST.md} +4 -4
- data/README.md +49 -0
- data/archive-tar-external.gemspec +1 -8
- data/doc/archive_tar_external.md +134 -0
- data/lib/archive/tar/external.rb +1 -1
- data/test/test_archive_tar_external.rb +1 -1
- metadata +18 -22
- metadata.gz.sig +0 -0
- data/README +0 -48
- data/doc/tar_external.txt +0 -110
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8262389cae7e15791e59508564874601c91d9693d1151aaac72a3a52403ce666
|
4
|
+
data.tar.gz: 26c49206d0cc4bbc653353c900425331b9b59ba0a448c6acd4283b43001db9f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ecea7018db1ab2621966fa41d514c94d92d1b0b98fb1b60b9be337b3f4c650e1c310f4c4874167cc1a0d243c3cd5be858c99699a35e9d0f15df4246e8902e8c
|
7
|
+
data.tar.gz: b2ca702a9caeb6a6f76c5a32bb85615ce04b3587eb75675593612f439eeb43f74a4d29746ff8fc74c76423cd341e8867ed4c8d882bf45aef0ac457a108dbe58c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/{CHANGES → CHANGES.md}
RENAMED
@@ -1,40 +1,43 @@
|
|
1
|
-
|
1
|
+
## 1.4.1 - 19-Feb-2021
|
2
|
+
* Switched from rdoc to markdown.
|
3
|
+
|
4
|
+
## 1.4.0 - 23-Jan-2019
|
2
5
|
* Changed license to Apache-2.0.
|
3
6
|
* The VERSION constant is now frozen.
|
4
7
|
* Added some metadata to the gemspec.
|
5
8
|
* Cert updated, should be good for about 10 years.
|
6
9
|
|
7
|
-
|
10
|
+
## 1.3.3 - 16-Jan-2016
|
8
11
|
* This gem is now signed.
|
9
12
|
* Fixed some deprecation warnings in the test suite.
|
10
13
|
* Added an archive-tar-external.rb file for convenience.
|
11
14
|
* Updates to the Rakefile.
|
12
15
|
|
13
|
-
|
16
|
+
## 1.3.2 - 14-Mar-2014
|
14
17
|
* The create_archive method now accepts an optional second argument that
|
15
18
|
specifies options to the tar command. The default is 'cf' (create file).
|
16
19
|
* The gem:create task was updated for Rubygems 2.x.
|
17
20
|
* Added rake as a development dependency.
|
18
21
|
* Ruby 1.8.x support has been dropped. This only matters for MS Windows.
|
19
22
|
|
20
|
-
|
23
|
+
## 1.3.1 - 20-Sep-2011
|
21
24
|
* Refactored the Rakefile a bit.
|
22
25
|
|
23
|
-
|
26
|
+
## 1.3.0 - 16-Jan-2010
|
24
27
|
* Altered the source code layout, which requires a change in your require
|
25
28
|
line. It's now require 'archive/tar/external'.
|
26
29
|
* Moved some content from the .txt file to the README.
|
27
30
|
* Updated one test to use a skip as needed.
|
28
31
|
* Moved source code to github.
|
29
32
|
|
30
|
-
|
33
|
+
## 1.2.3 - 25-Sep-2009
|
31
34
|
* Fixed a packaging bug.
|
32
35
|
* Added cygwin and mingw to Windows checks.
|
33
36
|
* Now requires open3 properly for Ruby 1.9 on Windows.
|
34
37
|
* Minor modifications to the gemspec.
|
35
38
|
* Added the 'gem' rake task.
|
36
39
|
|
37
|
-
|
40
|
+
## 1.2.2 - 28-Jul-2009
|
38
41
|
* Compatibility fixes for Ruby 1.9.x and JRuby.
|
39
42
|
* Singleton methods that were previously synonyms are now true aliases.
|
40
43
|
* License changed to Artistic 2.0.
|
@@ -45,13 +48,13 @@
|
|
45
48
|
in test-unit 2.x.
|
46
49
|
* Renamed the test file to test_archive_tar_external.rb.
|
47
50
|
|
48
|
-
|
51
|
+
## 1.2.1 - 30-Jul-2007
|
49
52
|
* The TarError class is now Tar::Error.
|
50
53
|
* Added a Rakefile with tasks for installation and testing.
|
51
54
|
* Removed the install.rb file. Installation is now handled by the Rakefile.
|
52
55
|
* Documentation updates.
|
53
56
|
|
54
|
-
|
57
|
+
## 1.2.0 - 7-Apr-2006
|
55
58
|
* Project renamed 'archive-tar-external'.
|
56
59
|
* The 'Tar' class is now Tar::External.
|
57
60
|
* The RAA project name is now tar-external.
|
@@ -61,16 +64,16 @@
|
|
61
64
|
that already exist.
|
62
65
|
* Added the Tar::External#compressed_archive_name= method.
|
63
66
|
|
64
|
-
|
67
|
+
## 1.1.1 - 1-Mar-2006
|
65
68
|
* Replaced PLATFORM with RUBY_PLATFORM since the former is deprecated
|
66
69
|
for Ruby 1.9/2.0.
|
67
70
|
|
68
|
-
|
71
|
+
## 1.1.0 - 10-Feb-2006
|
69
72
|
* Internal refactoring changes - now uses block form of Open3.popen3.
|
70
73
|
* Most methods now return self instead of true (better for chaining).
|
71
74
|
* Corresponding test suite changes.
|
72
75
|
|
73
|
-
|
76
|
+
## 1.0.0 - 1-Sep-2005
|
74
77
|
* Moved project to RubyForge.
|
75
78
|
* Modified the constructor to accept a file pattern. If present, becomes
|
76
79
|
a shortcut for Tar.new + Tar#create_archive.
|
@@ -91,7 +94,7 @@
|
|
91
94
|
* Test suite updates.
|
92
95
|
* Added a gemspec.
|
93
96
|
|
94
|
-
|
97
|
+
## 0.3.0 - 10-Aug-2004
|
95
98
|
* Added the update_archive() method.
|
96
99
|
* The expand_archive() method has been renamed to extract_archive().
|
97
100
|
For backward's compatability, an alias remains so you may use
|
@@ -101,7 +104,7 @@
|
|
101
104
|
If not, then the entire archive is extracted.
|
102
105
|
* Added corresponding tests and documentation updates.
|
103
106
|
|
104
|
-
|
107
|
+
## 0.2.0 - 9-Aug-2004
|
105
108
|
* Added the add_to_archive() method.
|
106
109
|
* Removed the VERSION() class method. Use the constant instead.
|
107
110
|
* Changed "TarException" and "CompressionException" to "TarError" and
|
@@ -112,5 +115,5 @@
|
|
112
115
|
wish using the rd2 tool.
|
113
116
|
* Added warranty information.
|
114
117
|
|
115
|
-
|
118
|
+
## 0.1.0 - 24-Jan-2003
|
116
119
|
* Initial Release
|
data/{MANIFEST → MANIFEST.md}
RENAMED
@@ -1,10 +1,10 @@
|
|
1
|
-
*
|
2
|
-
*
|
3
|
-
*
|
1
|
+
* CHANGES.md
|
2
|
+
* MANIFEST.md
|
3
|
+
* README.md
|
4
4
|
* Rakefile
|
5
5
|
* archive-tar-external.gemspec
|
6
6
|
* certs/djberg96_pub.pem
|
7
|
-
* doc/tar_external.
|
7
|
+
* doc/tar_external.md
|
8
8
|
* lib/archive-tar-external.rb
|
9
9
|
* lib/archive/tar_external.rb
|
10
10
|
* test/test_archive_tar_external.rb
|
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
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
|
+
```ruby
|
9
|
+
require 'archive/tar/external' # or 'archive-tar-external'
|
10
|
+
|
11
|
+
# Create an archive of all files with an ".rb" extension, the long way.
|
12
|
+
t = Archive::Tar::External.new('test.tar')
|
13
|
+
t.create_archive('*.rb')
|
14
|
+
t.compress_archive('gzip')
|
15
|
+
|
16
|
+
# Same, but the short way.
|
17
|
+
t = Archive::Tar::External.new('test.tar', '*.rb', 'gzip')
|
18
|
+
```
|
19
|
+
|
20
|
+
## Prerequisites
|
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 https://github.com/djberg96/archive-tar-external.
|
30
|
+
|
31
|
+
## History
|
32
|
+
This project was originally named "archive-tarsimple", but was renamed
|
33
|
+
on April 7, 2006. Versions of this gem prior to that date are no longer
|
34
|
+
available.
|
35
|
+
|
36
|
+
## License
|
37
|
+
Apache-2.0
|
38
|
+
|
39
|
+
## Warranty
|
40
|
+
This package is provided "as is" and without any express or
|
41
|
+
implied warranties, including, without limitation, the implied
|
42
|
+
warranties of merchantability and fitness for a particular purpose.
|
43
|
+
|
44
|
+
## Copyright
|
45
|
+
(C) 2003 - 2021 Daniel J. Berger
|
46
|
+
All Rights Reserved
|
47
|
+
|
48
|
+
## Author
|
49
|
+
Daniel J. Berger
|
@@ -3,7 +3,7 @@ require 'rbconfig'
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'archive-tar-external'
|
6
|
-
spec.version = '1.4.
|
6
|
+
spec.version = '1.4.1'
|
7
7
|
spec.summary = 'A simple way to create tar archives using external calls'
|
8
8
|
spec.license = 'Apache-2.0'
|
9
9
|
spec.author = 'Daniel Berger'
|
@@ -13,13 +13,6 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
14
14
|
spec.cert_chain = Dir['certs/*']
|
15
15
|
|
16
|
-
spec.extra_rdoc_files = [
|
17
|
-
'README',
|
18
|
-
'CHANGES',
|
19
|
-
'MANIFEST',
|
20
|
-
'doc/tar_external.txt'
|
21
|
-
]
|
22
|
-
|
23
16
|
spec.metadata = {
|
24
17
|
'homepage_uri' => 'https://github.com/djberg96/archive-tar-external',
|
25
18
|
'bug_tracker_uri' => 'https://github.com/djberg96/archive-tar-external/issues',
|
@@ -0,0 +1,134 @@
|
|
1
|
+
## Description
|
2
|
+
A simple tar interface using external system calls.
|
3
|
+
|
4
|
+
## Synopsis
|
5
|
+
```ruby
|
6
|
+
# Assuming we have three .txt files, t1.txt, t2.txt, t3.txt ...
|
7
|
+
require 'archive/tar/external'
|
8
|
+
include Archive
|
9
|
+
|
10
|
+
t = Tar::External.new("myfile.tar")
|
11
|
+
|
12
|
+
t.create_archive("*.txt")
|
13
|
+
t.compress_archive("bzip2") # 'myfile.tar.bz2' now exists
|
14
|
+
|
15
|
+
t.uncompress_archive("bunzip2")
|
16
|
+
|
17
|
+
t.archive_name # "myfile.tar"
|
18
|
+
t.archive_info # ["t1.txt","t2.txt","t3.txt"]
|
19
|
+
|
20
|
+
t.add_to_archive("t4.txt","t5.txt")
|
21
|
+
t.expand_archive
|
22
|
+
```
|
23
|
+
|
24
|
+
## Constants
|
25
|
+
`VERSION`- The current version number of this library. This is a string.
|
26
|
+
|
27
|
+
## Singleton Methods
|
28
|
+
`.new(archive_name, pattern=nil, program=nil)`
|
29
|
+
|
30
|
+
Creates an instance of an Archive::Tar::External object. The `archive_name` is
|
31
|
+
the name of the tarball. While a '.tar' extension is recommended based on
|
32
|
+
years of convention, it is not enforced.
|
33
|
+
|
34
|
+
If `pattern` is provided, then the `create_archive` method is called internally.
|
35
|
+
|
36
|
+
If `program` is provided, then the `compress_archive` method is called internally.
|
37
|
+
|
38
|
+
Note that `archive_name` name must be a string, or a `TypeError` is raised.
|
39
|
+
|
40
|
+
`.expand_archive(archive_name, file1 [, file2, ...])`
|
41
|
+
|
42
|
+
Identical to the instance method of the same name, except that you must
|
43
|
+
specify the `archive_name`, and the tar program is hard coded to `tar xf`.
|
44
|
+
|
45
|
+
`.uncompress_archive(archive_name, program='gunzip')`
|
46
|
+
|
47
|
+
Identical to the instance method of the same name, except that you must
|
48
|
+
specify the +archive_name+ as the first argument.
|
49
|
+
|
50
|
+
## Instance Methods
|
51
|
+
```
|
52
|
+
#add(file1 [, file2, ...])
|
53
|
+
#add_to_archive(file1 [, file2, ...])
|
54
|
+
```
|
55
|
+
|
56
|
+
Adds a list of files to the current archive. At least one file must be
|
57
|
+
provided or an `Archive::Tar::Error` is raised.
|
58
|
+
|
59
|
+
```
|
60
|
+
#archive_info
|
61
|
+
#info
|
62
|
+
```
|
63
|
+
|
64
|
+
Returns an array of file names that are included within the tarball.
|
65
|
+
|
66
|
+
`#archive_name`
|
67
|
+
|
68
|
+
Returns the current archive name.
|
69
|
+
|
70
|
+
`#archive_name=`
|
71
|
+
|
72
|
+
Sets the current archive name.
|
73
|
+
|
74
|
+
```
|
75
|
+
#compress(program="gzip")
|
76
|
+
#compress_archive(program="gzip")
|
77
|
+
```
|
78
|
+
|
79
|
+
Compresses the tarball using the program you pass to this method. The default is "gzip".
|
80
|
+
|
81
|
+
Note that any arguments you want to be passed along with the program can simply
|
82
|
+
be included as part of the program, e.g. "gzip -f".
|
83
|
+
|
84
|
+
```
|
85
|
+
#create(file_pattern)
|
86
|
+
#create_archive(file_pattern, options = 'cf')
|
87
|
+
```
|
88
|
+
|
89
|
+
Creates a new tarball, including those files which match `file_pattern`
|
90
|
+
using `options`, which are set to 'cf' (create file) by default.
|
91
|
+
|
92
|
+
```
|
93
|
+
#expand_archive(files=nil)
|
94
|
+
#extract_archive(files=nil)
|
95
|
+
```
|
96
|
+
|
97
|
+
Expands the contents of the tarball. Note that this method does NOT delete the tarball.
|
98
|
+
|
99
|
+
If file names are provided, then only those files are extracted.
|
100
|
+
|
101
|
+
`#tar_program`
|
102
|
+
|
103
|
+
Returns the name of the tar program used. The default is "tar".
|
104
|
+
|
105
|
+
`#tar_program=(program_name)`
|
106
|
+
|
107
|
+
Sets the name of the tar program to be used.
|
108
|
+
|
109
|
+
```
|
110
|
+
#uncompress(program="gunzip")
|
111
|
+
#uncompress_archive(program="gunzip")
|
112
|
+
```
|
113
|
+
|
114
|
+
Uncompresses the tarball using the program you pass to this method. The default is "gunzip".
|
115
|
+
|
116
|
+
Like the `compress_archive` method, you can pass arguments along as part of the method call.
|
117
|
+
|
118
|
+
```
|
119
|
+
#update(files)
|
120
|
+
#update_archive(files)
|
121
|
+
```
|
122
|
+
|
123
|
+
Updates the given `files` in the archive, i.e they are added if they
|
124
|
+
are not already in the archive or have been modified.
|
125
|
+
|
126
|
+
## Exceptions
|
127
|
+
`Archive::Tar::Error`
|
128
|
+
|
129
|
+
Raised if something goes wrong during the execution of any methods that
|
130
|
+
use the tar command internally.
|
131
|
+
|
132
|
+
`Archive::Tar::CompressError`
|
133
|
+
|
134
|
+
Raised if something goes wrong during the `compress_archive` or `uncompress_archive` methods.
|
data/lib/archive/tar/external.rb
CHANGED
@@ -17,7 +17,7 @@ module Archive
|
|
17
17
|
# This class encapsulates tar & zip operations.
|
18
18
|
class Tar::External
|
19
19
|
# The version of the archive-tar-external library.
|
20
|
-
VERSION = '1.4.
|
20
|
+
VERSION = '1.4.1'.freeze
|
21
21
|
|
22
22
|
# The name of the archive file to be used, e.g. "test.tar"
|
23
23
|
attr_accessor :archive_name
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: archive-tar-external
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Berger
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
36
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date:
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: test-unit
|
@@ -87,28 +87,24 @@ description: |2
|
|
87
87
|
email: djberg96@gmail.com
|
88
88
|
executables: []
|
89
89
|
extensions: []
|
90
|
-
extra_rdoc_files:
|
91
|
-
- README
|
92
|
-
- CHANGES
|
93
|
-
- MANIFEST
|
94
|
-
- doc/tar_external.txt
|
90
|
+
extra_rdoc_files: []
|
95
91
|
files:
|
96
|
-
- CHANGES
|
97
|
-
- test
|
98
|
-
- test/test_archive_tar_external.rb
|
99
|
-
- archive-tar-external.gemspec
|
100
|
-
- doc
|
101
|
-
- doc/tar_external.txt
|
102
|
-
- README
|
103
92
|
- Rakefile
|
104
|
-
-
|
93
|
+
- certs
|
94
|
+
- certs/djberg96_pub.pem
|
105
95
|
- lib
|
96
|
+
- lib/archive-tar-external.rb
|
106
97
|
- lib/archive
|
107
98
|
- lib/archive/tar
|
108
99
|
- lib/archive/tar/external.rb
|
109
|
-
-
|
110
|
-
-
|
111
|
-
-
|
100
|
+
- test
|
101
|
+
- test/test_archive_tar_external.rb
|
102
|
+
- CHANGES.md
|
103
|
+
- MANIFEST.md
|
104
|
+
- README.md
|
105
|
+
- archive-tar-external.gemspec
|
106
|
+
- doc
|
107
|
+
- doc/archive_tar_external.md
|
112
108
|
homepage: http://github.com/djberg96/archive-tar-external
|
113
109
|
licenses:
|
114
110
|
- Apache-2.0
|
@@ -119,7 +115,7 @@ metadata:
|
|
119
115
|
documentation_uri: https://github.com/djberg96/archive-tar-external/wiki
|
120
116
|
source_code_uri: https://github.com/djberg96/archive-tar-external
|
121
117
|
wiki_uri: https://github.com/djberg96/archive-tar-external/wiki
|
122
|
-
post_install_message:
|
118
|
+
post_install_message:
|
123
119
|
rdoc_options: []
|
124
120
|
require_paths:
|
125
121
|
- lib
|
@@ -134,8 +130,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
130
|
- !ruby/object:Gem::Version
|
135
131
|
version: '0'
|
136
132
|
requirements: []
|
137
|
-
rubygems_version: 3.0.
|
138
|
-
signing_key:
|
133
|
+
rubygems_version: 3.0.3
|
134
|
+
signing_key:
|
139
135
|
specification_version: 4
|
140
136
|
summary: A simple way to create tar archives using external calls
|
141
137
|
test_files:
|
metadata.gz.sig
CHANGED
Binary file
|
data/README
DELETED
@@ -1,48 +0,0 @@
|
|
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 'tar' command line program.
|
21
|
-
At least one compression program, e.g. gzip, bzip2, zip, etc.
|
22
|
-
|
23
|
-
== Known Issues
|
24
|
-
The tar program that comes with Solaris will not raise an error if you
|
25
|
-
try to expand a file from an archive that does not contain that file.
|
26
|
-
|
27
|
-
If you come across any other issues, please report them on the project
|
28
|
-
page at https://github.com/djberg96/archive-tar-external.
|
29
|
-
|
30
|
-
== History
|
31
|
-
This project was originally named "archive-tarsimple", but was renamed
|
32
|
-
on April 7, 2006. Versions of this gem prior to that date are no longer
|
33
|
-
available.
|
34
|
-
|
35
|
-
== License
|
36
|
-
Apache-2.0
|
37
|
-
|
38
|
-
== Warranty
|
39
|
-
This package is provided "as is" and without any express or
|
40
|
-
implied warranties, including, without limitation, the implied
|
41
|
-
warranties of merchantability and fitness for a particular purpose.
|
42
|
-
|
43
|
-
== Copyright
|
44
|
-
(C) 2003 - 2019 Daniel J. Berger
|
45
|
-
All Rights Reserved
|
46
|
-
|
47
|
-
== Author
|
48
|
-
Daniel J. Berger
|
data/doc/tar_external.txt
DELETED
@@ -1,110 +0,0 @@
|
|
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, options = 'cf')
|
74
|
-
Creates a new tarball, including those files which match 'file_pattern'
|
75
|
-
using 'options', which are set to 'cf' (create file) by default.
|
76
|
-
|
77
|
-
Archive::Tar::External#expand_archive(files=nil)
|
78
|
-
Archive::Tar::External#extract_archive(files=nil)
|
79
|
-
Expands the contents of the tarball. Note that this method does NOT delete
|
80
|
-
the tarball.
|
81
|
-
|
82
|
-
If file names are provided, then only those files are extracted.
|
83
|
-
|
84
|
-
Archive::Tar::External#tar_program
|
85
|
-
Returns the name of the tar program used. The default is "tar".
|
86
|
-
|
87
|
-
Archive::Tar::External#tar_program=(program_name)
|
88
|
-
Sets the name of the tar program to be used.
|
89
|
-
|
90
|
-
Archive::Tar::External#uncompress(program="gunzip")
|
91
|
-
Archive::Tar::External#uncompress_archive(program="gunzip")
|
92
|
-
Uncompresses the tarball using the program you pass to this method. The
|
93
|
-
default is "gunzip".
|
94
|
-
|
95
|
-
As for compress_archive(), you can pass arguments along as part of the
|
96
|
-
argument.
|
97
|
-
|
98
|
-
Archive::Tar::External#update(files)
|
99
|
-
Archive::Tar::External#update_archive(files)
|
100
|
-
Updates the given +files+ in the archive, i.e they are added if they
|
101
|
-
are not already in the archive or have been modified.
|
102
|
-
|
103
|
-
== Exceptions
|
104
|
-
Tar::Error
|
105
|
-
Raised if something goes wrong during the execution of any methods that
|
106
|
-
use the tar command internally.
|
107
|
-
|
108
|
-
Tar::CompressError
|
109
|
-
Raised if something goes wrong during the Tar#compress_archive or
|
110
|
-
Tar#uncompress_archive methods.
|