ruby-filemagic 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +5 -0
- data/README +10 -1
- data/Rakefile +1 -0
- data/ext/filemagic/filemagic.c +1 -0
- data/ext/filemagic/filemagic.h +5 -4
- data/lib/filemagic/magic.mgc +0 -0
- data/lib/filemagic/version.rb +1 -1
- data/test/filemagic_test.rb +6 -0
- data/test/pylink +1 -0
- metadata +31 -9
- data/test/pylink +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eb3ecc3b55441028fac03c58ce23b94b4535489
|
4
|
+
data.tar.gz: fe98ff3cc87c0bcc11aec60b4e4e1297dd296a4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b68a7914cf407d134b75e230b7fa61f2a07bcc9c4d1811203265e4a05c675f69e0f65b02b5453174943c9fe824fcc661467399af81477e87c2daa4d17333fce6
|
7
|
+
data.tar.gz: e7e784821698c04c53a3d04fa011fbea772549c6d10fa92487e245711ed7e20def7cb1c9d07c5913a82c92aff9d1e81c2d29140c19f22ad8e15b6f34b7f4293d
|
data/ChangeLog
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
= Revision history for ruby-filemagic
|
4
4
|
|
5
|
+
== 0.7.2 [2017-07-02]
|
6
|
+
|
7
|
+
* Fix segfault on <tt>buffer(nil)</tt> when compiled with GCC (pull request
|
8
|
+
#24 by Yuya Tanaka).
|
9
|
+
|
5
10
|
== 0.7.1 [2015-10-27]
|
6
11
|
|
7
12
|
* List default lib and header directories (pull request #18 by Adam Wróbel).
|
data/README
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
== VERSION
|
4
4
|
|
5
|
-
This documentation refers to filemagic version 0.7.
|
5
|
+
This documentation refers to filemagic version 0.7.2
|
6
6
|
|
7
7
|
|
8
8
|
== DESCRIPTION
|
@@ -38,24 +38,33 @@ FileMagic extension module. See also libmagic(3), file(1) and magic(4).
|
|
38
38
|
require 'filemagic'
|
39
39
|
|
40
40
|
p FileMagic::VERSION
|
41
|
+
# => "0.7.2"
|
41
42
|
p FileMagic::MAGIC_VERSION
|
43
|
+
# => "5.28"
|
42
44
|
|
43
45
|
p FileMagic.new.flags
|
46
|
+
# => []
|
44
47
|
|
45
48
|
FileMagic.open(:mime) { |fm|
|
46
49
|
p fm.flags
|
50
|
+
# => [:mime_type, :mime_encoding]
|
47
51
|
p fm.file(__FILE__)
|
52
|
+
# => "text/plain; charset=us-ascii"
|
48
53
|
p fm.file(__FILE__, true)
|
54
|
+
# => "text/plain"
|
49
55
|
|
50
56
|
fm.flags = [:raw, :continue]
|
51
57
|
p fm.flags
|
58
|
+
# => [:continue, :raw]
|
52
59
|
}
|
53
60
|
|
54
61
|
fm = FileMagic.new
|
55
62
|
p fm.flags
|
63
|
+
# => []
|
56
64
|
|
57
65
|
mime = FileMagic.mime
|
58
66
|
p mime.flags
|
67
|
+
# => [:mime_type, :mime_encoding]
|
59
68
|
|
60
69
|
=== Environment
|
61
70
|
|
data/Rakefile
CHANGED
data/ext/filemagic/filemagic.c
CHANGED
data/ext/filemagic/filemagic.h
CHANGED
@@ -18,9 +18,9 @@
|
|
18
18
|
}\
|
19
19
|
}
|
20
20
|
|
21
|
-
#define RB_MAGIC_TYPE_FILE magic_file(ms, StringValuePtr(arg))
|
22
|
-
#define RB_MAGIC_TYPE_BUFFER
|
23
|
-
#define RB_MAGIC_TYPE_DESCRIPTOR magic_descriptor(ms, NUM2INT(arg))
|
21
|
+
#define RB_MAGIC_TYPE_FILE type = magic_file(ms, StringValuePtr(arg));
|
22
|
+
#define RB_MAGIC_TYPE_BUFFER { char *arg_str = StringValuePtr(arg); type = magic_buffer(ms, arg_str, RSTRING_LEN(arg)); }
|
23
|
+
#define RB_MAGIC_TYPE_DESCRIPTOR type = magic_descriptor(ms, NUM2INT(arg));
|
24
24
|
|
25
25
|
#define RB_MAGIC_TYPE(what, WHAT) \
|
26
26
|
static VALUE \
|
@@ -32,7 +32,8 @@ rb_magic_##what(int argc, VALUE *argv, VALUE self) {\
|
|
32
32
|
rb_scan_args(argc, argv, "11", &arg, &simple);\
|
33
33
|
GetMagicSet(self, ms);\
|
34
34
|
\
|
35
|
-
|
35
|
+
RB_MAGIC_TYPE_##WHAT\
|
36
|
+
if (type == NULL) {\
|
36
37
|
rb_raise(rb_FileMagicError, "failed lookup: %s", magic_error(ms));\
|
37
38
|
}\
|
38
39
|
\
|
data/lib/filemagic/magic.mgc
CHANGED
Binary file
|
data/lib/filemagic/version.rb
CHANGED
data/test/filemagic_test.rb
CHANGED
@@ -62,6 +62,12 @@ magic file from #{FileMagic.path}
|
|
62
62
|
assert_equal('POSIX shell script, ASCII text executable', res)
|
63
63
|
end
|
64
64
|
|
65
|
+
def test_nil_buffer
|
66
|
+
fm = FileMagic.new(FileMagic::MAGIC_NONE)
|
67
|
+
assert_raise(TypeError) { fm.buffer(nil) }
|
68
|
+
fm.close
|
69
|
+
end
|
70
|
+
|
65
71
|
def test_descriptor
|
66
72
|
fm = FileMagic.new(FileMagic::MAGIC_NONE)
|
67
73
|
|
data/test/pylink
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
test/pyfile
|
metadata
CHANGED
@@ -1,15 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-filemagic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Whitton
|
8
8
|
- Jens Wille
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
|
-
cert_chain:
|
12
|
-
|
11
|
+
cert_chain:
|
12
|
+
- |
|
13
|
+
-----BEGIN CERTIFICATE-----
|
14
|
+
MIIDMDCCAhig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7+cESJ
|
29
|
+
H19TDW3R9p594jCl1ykPs3dz/0Bk+r1HTd35Yw+yBbyprSJb4S7OcRRHCryuo09l
|
30
|
+
NBGyZvOBuqUp0xostWSk0dfxyn/YQ7eqvQRGBhK1VGa7Tg/KYqnemDE57+VOXrua
|
31
|
+
59wzaA==
|
32
|
+
-----END CERTIFICATE-----
|
33
|
+
date: 2017-07-02 00:00:00.000000000 Z
|
13
34
|
dependencies:
|
14
35
|
- !ruby/object:Gem::Dependency
|
15
36
|
name: hen
|
@@ -20,7 +41,7 @@ dependencies:
|
|
20
41
|
version: '0.8'
|
21
42
|
- - ">="
|
22
43
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.8.
|
44
|
+
version: 0.8.7
|
24
45
|
type: :development
|
25
46
|
prerelease: false
|
26
47
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,7 +51,7 @@ dependencies:
|
|
30
51
|
version: '0.8'
|
31
52
|
- - ">="
|
32
53
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.8.
|
54
|
+
version: 0.8.7
|
34
55
|
- !ruby/object:Gem::Dependency
|
35
56
|
name: rake
|
36
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,13 +132,14 @@ licenses:
|
|
111
132
|
metadata: {}
|
112
133
|
post_install_message: |2+
|
113
134
|
|
114
|
-
ruby-filemagic-0.7.
|
135
|
+
ruby-filemagic-0.7.2 [2017-07-02]:
|
115
136
|
|
116
|
-
*
|
137
|
+
* Fix segfault on <tt>buffer(nil)</tt> when compiled with GCC (pull request
|
138
|
+
#24 by Yuya Tanaka).
|
117
139
|
|
118
140
|
rdoc_options:
|
119
141
|
- "--title"
|
120
|
-
- ruby-filemagic Application documentation (v0.7.
|
142
|
+
- ruby-filemagic Application documentation (v0.7.2)
|
121
143
|
- "--charset"
|
122
144
|
- UTF-8
|
123
145
|
- "--line-numbers"
|
@@ -138,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
160
|
version: '0'
|
139
161
|
requirements: []
|
140
162
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
163
|
+
rubygems_version: 2.6.8
|
142
164
|
signing_key:
|
143
165
|
specification_version: 4
|
144
166
|
summary: Ruby bindings to the magic(4) library
|
data/test/pylink
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"""
|