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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83f198a83b3db203dc0cc3b9f990dbea13526623
4
- data.tar.gz: 0b8119e1d47e05d65c3ffb729b8a52c254f340ab
3
+ metadata.gz: 3eb3ecc3b55441028fac03c58ce23b94b4535489
4
+ data.tar.gz: fe98ff3cc87c0bcc11aec60b4e4e1297dd296a4a
5
5
  SHA512:
6
- metadata.gz: 8a469ee433bb3f4f67dc1597726129f64818c55afe987cad611cde6a15e73f056c120ad4ee26fd346b4ce73061815ced19505cc16f29b0e3fee35b02b705c3c1
7
- data.tar.gz: c733f22088488246b0d54deb450cc3014e8bafd1eabd0122c97309596c840aa148646d398de164eab8488e4603278277f736eb2dc1da70fcfd0ecf358583b9ca
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.1
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
@@ -21,6 +21,7 @@ begin
21
21
  homepage: :blackwinter,
22
22
  local_files: [mgc],
23
23
  extension: {
24
+ cross_compile: false,
24
25
  with_cross_gnurx: lambda { |dir| [dir] },
25
26
  with_cross_magic: lambda { |dir| [src =
26
27
  File.join(dir, 'src'), File.join(src, '.libs')] }
@@ -112,6 +112,7 @@ rb_magic_init(int argc, VALUE *argv, VALUE self) {
112
112
 
113
113
  rb_iv_set(self, "iflags", flags);
114
114
  rb_iv_set(self, "closed", Qfalse);
115
+ rb_iv_set(self, "@simplified", Qfalse);
115
116
 
116
117
  keys = rb_funcall(options, rb_intern("keys"), 0);
117
118
 
@@ -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 magic_buffer(ms, StringValuePtr(arg), RSTRING_LEN(arg))
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
- if ((type = RB_MAGIC_TYPE_##WHAT) == NULL) {\
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
  \
Binary file
@@ -4,7 +4,7 @@ class FileMagic
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 7
7
- TINY = 1
7
+ TINY = 2
8
8
 
9
9
  class << self
10
10
 
@@ -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
 
@@ -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.1
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
- date: 2015-10-27 00:00:00.000000000 Z
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIDMDCCAhigAwIBAgIBADANBgkqh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09l
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.3
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.3
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.1 [2015-10-27]:
135
+ ruby-filemagic-0.7.2 [2017-07-02]:
115
136
 
116
- * List default lib and header directories (pull request #18 by Adam Wróbel).
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.1)
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.4.8
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
@@ -1 +0,0 @@
1
- """