ruby-xz 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/COPYING +26 -0
- data/HISTORY.rdoc +5 -0
- data/README.rdoc +2 -37
- data/VERSION +1 -1
- data/lib/xz.rb +2 -64
- data/lib/xz/lib_lzma.rb +3 -3
- metadata +57 -36
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0c48419b0caefc3d26a50fa3e9e421f3b5d86301
|
4
|
+
data.tar.gz: b69d305b6301a0520bf810b1e201026520a5b583
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9b8e7ed6086ae03303cab824e1df92dc96b95e5d00d42c770ed29be325dfe4b87a458e37c33c7c33de781d44f0667f0abf2c9c43d5eb873f07c037301e3e8b74
|
7
|
+
data.tar.gz: 6b5a55e8a3c16f4310b8fedca488edef9e99d9424064bccac16325e7de2f7e97aed1550b1716c365e6d807aa8259297bc5dd74f67ce4557dd00aae274217f3fb
|
data/COPYING
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Basic liblzma-bindings for Ruby.
|
4
|
+
|
5
|
+
Copyright © 2011-2013 Marvin Gülker
|
6
|
+
|
7
|
+
Copyright © 2011 Christoph Plank
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
10
|
+
a copy of this software and associated documentation files (the
|
11
|
+
‘Software’), to deal in the Software without restriction, including
|
12
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
13
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
14
|
+
permit persons to whom the Software is furnished to do so, subject to
|
15
|
+
the following conditions:
|
16
|
+
|
17
|
+
The above copyright notice and this permission notice shall be
|
18
|
+
included in all copies or substantial portions of the Software.
|
19
|
+
|
20
|
+
THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
24
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
25
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
26
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/HISTORY.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -20,10 +20,7 @@ Install it the way you install all your gems.
|
|
20
20
|
|
21
21
|
# gem install ruby-xz
|
22
22
|
|
23
|
-
|
24
|
-
ruby-xz should also work with Ruby 1.8.7. However, the Ruby 1.8
|
25
|
-
compatibility may be skipped anytime (causing at least a minor version
|
26
|
-
bump), so you shouldn’t rely on it.
|
23
|
+
Ruby 1.9+ is required.
|
27
24
|
|
28
25
|
== Usage
|
29
26
|
|
@@ -66,7 +63,7 @@ what is possible.
|
|
66
63
|
|
67
64
|
Basic liblzma-bindings for Ruby.
|
68
65
|
|
69
|
-
Copyright © 2011
|
66
|
+
Copyright © 2011-2013 Marvin Gülker
|
70
67
|
|
71
68
|
Copyright © 2011 Christoph Plank
|
72
69
|
|
@@ -87,35 +84,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
87
84
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
88
85
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
89
86
|
THE SOFTWARE.
|
90
|
-
|
91
|
-
==== require_relative
|
92
|
-
|
93
|
-
This library includes the sourcecode of Steve Klabnik’s
|
94
|
-
{require_relative gem}[http://steveklabnik.github.com/require_relative/]
|
95
|
-
in order to make it 1.8-compatible. It’s licensed under the BSD license:
|
96
|
-
|
97
|
-
Copyright (c) 2011, Steve Klabnik
|
98
|
-
|
99
|
-
All rights reserved.
|
100
|
-
|
101
|
-
Redistribution and use in source and binary forms, with or without
|
102
|
-
modification, are permitted provided that the following conditions are
|
103
|
-
met:
|
104
|
-
|
105
|
-
* Redistributions of source code must retain the above copyright
|
106
|
-
notice, this list of conditions and the following disclaimer.
|
107
|
-
* Redistributions in binary form must reproduce the above copyright
|
108
|
-
notice, this list of conditions and the following disclaimer in the
|
109
|
-
documentation and/or other materials provided with the distribution.
|
110
|
-
|
111
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
112
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
113
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
114
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
115
|
-
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
116
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
117
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
118
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
119
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
120
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
121
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/xz.rb
CHANGED
@@ -24,68 +24,6 @@
|
|
24
24
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
25
|
# THE SOFTWARE.
|
26
26
|
|
27
|
-
if RUBY_VERSION < "1.9"
|
28
|
-
require "rubygems"
|
29
|
-
|
30
|
-
# The following is the complete sourcode of the require_relative gem
|
31
|
-
# by Steve Klabnik, licensed under the BSD license:
|
32
|
-
#
|
33
|
-
# Copyright (c) 2011, Steve Klabnik
|
34
|
-
# All rights reserved.
|
35
|
-
#
|
36
|
-
# Redistribution and use in source and binary forms, with or without
|
37
|
-
# modification, are permitted provided that the following conditions are
|
38
|
-
# met:
|
39
|
-
#
|
40
|
-
# * Redistributions of source code must retain the above copyright
|
41
|
-
# notice, this list of conditions and the following disclaimer.
|
42
|
-
# * Redistributions in binary form must reproduce the above copyright
|
43
|
-
# notice, this list of conditions and the following disclaimer in the
|
44
|
-
# documentation and/or other materials provided with the distribution.
|
45
|
-
#
|
46
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
47
|
-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
48
|
-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
49
|
-
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
50
|
-
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
51
|
-
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
52
|
-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
53
|
-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
54
|
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
55
|
-
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
56
|
-
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
57
|
-
# require\_relative has no effect on Ruby 1.9 (or other versions that provide Kernel#require_relative
|
58
|
-
# out of the box)
|
59
|
-
unless Object.new.respond_to?(:require_relative, true)
|
60
|
-
# Yep, you're looking at it! This gem is pretty small, and for good reason.
|
61
|
-
# There's not much to do! We use split to find the filename that we're
|
62
|
-
# looking to require, raise a LoadError if it's called in a context (like eval)
|
63
|
-
# that it shouldn't be, and then require it via regular old require.
|
64
|
-
#
|
65
|
-
# Now, in 1.9, "." is totally removed from the $LOAD_PATH. We don't do that
|
66
|
-
# here, because that would break a lot of other code! You're still vulnerable
|
67
|
-
# to the security hole that caused this change to happen in the first place.
|
68
|
-
# You will be able to use this gem to transition the code you write over to
|
69
|
-
# the 1.9 syntax, though.
|
70
|
-
def require_relative(relative_feature) # :nodoc:
|
71
|
-
|
72
|
-
file = caller.first.split(/:\d/,2).first
|
73
|
-
|
74
|
-
raise LoadError, "require_relative is called in #{$1}" if /\A\((.*)\)/ =~ file
|
75
|
-
|
76
|
-
require File.expand_path(relative_feature, File.dirname(file))
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
unless String.instance_methods.include?(:clear)
|
81
|
-
class String # :nodoc:
|
82
|
-
def clear
|
83
|
-
replace("")
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
27
|
require "pathname"
|
90
28
|
require "ffi"
|
91
29
|
require 'stringio'
|
@@ -163,7 +101,7 @@ module XZ
|
|
163
101
|
LZMAError.raise_if_necessary(res)
|
164
102
|
|
165
103
|
res = ""
|
166
|
-
res.encode!("BINARY")
|
104
|
+
res.encode!("BINARY")
|
167
105
|
if block_given?
|
168
106
|
res = lzma_code(io, stream, &block)
|
169
107
|
else
|
@@ -228,7 +166,7 @@ module XZ
|
|
228
166
|
LZMAError.raise_if_necessary(res)
|
229
167
|
|
230
168
|
res = ""
|
231
|
-
res.encode!("BINARY")
|
169
|
+
res.encode!("BINARY")
|
232
170
|
if block_given?
|
233
171
|
res = lzma_code(io, stream, &block)
|
234
172
|
else
|
data/lib/xz/lib_lzma.rb
CHANGED
@@ -71,7 +71,7 @@ module XZ
|
|
71
71
|
:lzma_buf_error,
|
72
72
|
:lzma_prog_error
|
73
73
|
|
74
|
-
ffi_lib ['lzma.so.
|
74
|
+
ffi_lib ['lzma.so.5', 'lzma.so', 'lzma']
|
75
75
|
|
76
76
|
attach_function :lzma_easy_encoder, [:pointer, :uint32, :int], :int
|
77
77
|
attach_function :lzma_code, [:pointer, :int], :int
|
@@ -125,11 +125,11 @@ module XZ
|
|
125
125
|
#it is assumed to be a FFI::Pointer to a lzma_stream structure
|
126
126
|
#and that structure is wrapped.
|
127
127
|
def initialize(*args)
|
128
|
-
if args.empty? #Got a pointer, want to wrap it
|
128
|
+
if !args.empty? #Got a pointer, want to wrap it
|
129
129
|
super
|
130
130
|
else
|
131
131
|
s = super()
|
132
|
-
s[:
|
132
|
+
s[:next_in] = nil
|
133
133
|
s[:avail_in] = 0
|
134
134
|
s[:total_in] = 0
|
135
135
|
s[:next_out] = nil
|
metadata
CHANGED
@@ -1,74 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-xz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Marvin Gülker
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-06-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: ffi
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: io-like
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- -
|
31
|
+
- - '>='
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: '0'
|
33
34
|
type: :runtime
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
36
41
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement:
|
39
|
-
none: false
|
42
|
+
name: emerald
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
40
44
|
requirements:
|
41
|
-
- -
|
45
|
+
- - '>='
|
42
46
|
- !ruby/object:Gem::Version
|
43
47
|
version: '0'
|
44
48
|
type: :development
|
45
49
|
prerelease: false
|
46
|
-
version_requirements:
|
47
|
-
|
48
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: turn
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: |
|
70
|
+
This is a basic binding for liblzma that allows you to
|
49
71
|
create and extract XZ-compressed archives. It can cope with big
|
50
|
-
|
51
|
-
files as well as small ones, but doesn''t offer much
|
52
|
-
|
72
|
+
files as well as small ones, but doesn't offer much
|
53
73
|
of the possibilities liblzma itself has.
|
54
|
-
|
55
|
-
'
|
56
|
-
email: sutniuq@gmx.net
|
74
|
+
email: quintus@quintilianus.eu
|
57
75
|
executables: []
|
58
76
|
extensions: []
|
59
77
|
extra_rdoc_files:
|
60
78
|
- README.rdoc
|
79
|
+
- HISTORY.rdoc
|
80
|
+
- COPYING
|
61
81
|
files:
|
82
|
+
- lib/xz.rb
|
62
83
|
- lib/xz/stream_reader.rb
|
63
|
-
- lib/xz/stream.rb
|
64
84
|
- lib/xz/lib_lzma.rb
|
85
|
+
- lib/xz/stream.rb
|
65
86
|
- lib/xz/stream_writer.rb
|
66
|
-
- lib/xz.rb
|
67
|
-
- README.rdoc
|
68
87
|
- HISTORY.rdoc
|
88
|
+
- README.rdoc
|
89
|
+
- COPYING
|
69
90
|
- VERSION
|
70
|
-
homepage:
|
71
|
-
licenses:
|
91
|
+
homepage: https://github.com/Quintus/ruby-xz
|
92
|
+
licenses:
|
93
|
+
- MIT
|
94
|
+
metadata: {}
|
72
95
|
post_install_message:
|
73
96
|
rdoc_options:
|
74
97
|
- -t
|
@@ -78,21 +101,19 @@ rdoc_options:
|
|
78
101
|
require_paths:
|
79
102
|
- lib
|
80
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
104
|
requirements:
|
83
|
-
- -
|
105
|
+
- - '>='
|
84
106
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.
|
107
|
+
version: 1.9.3
|
86
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
-
none: false
|
88
109
|
requirements:
|
89
|
-
- -
|
110
|
+
- - '>='
|
90
111
|
- !ruby/object:Gem::Version
|
91
112
|
version: '0'
|
92
113
|
requirements: []
|
93
114
|
rubyforge_project:
|
94
|
-
rubygems_version:
|
115
|
+
rubygems_version: 2.0.3
|
95
116
|
signing_key:
|
96
|
-
specification_version:
|
117
|
+
specification_version: 4
|
97
118
|
summary: XZ compression via liblzma for Ruby.
|
98
119
|
test_files: []
|