ruby-filemagic 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -1
- data/README +1 -1
- data/ext/extconf.rb +4 -2
- data/ext/filemagic.c +3 -1
- data/ext/filemagic.h +5 -3
- data/lib/filemagic/version.rb +1 -1
- metadata +4 -4
data/ChangeLog
CHANGED
data/README
CHANGED
data/ext/extconf.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'mkmf'
|
2
2
|
|
3
|
+
$CFLAGS << ' -Wall' if ENV['WALL']
|
3
4
|
dir_config('magic')
|
4
5
|
|
5
|
-
if have_library('magic', 'magic_open')
|
6
|
+
if have_library('magic', 'magic_open') && have_header('magic.h')
|
7
|
+
have_header('file/patchlevel.h')
|
6
8
|
create_makefile('filemagic')
|
7
9
|
else
|
8
|
-
|
10
|
+
abort '*** ERROR: missing required library to compile this module'
|
9
11
|
end
|
data/ext/filemagic.c
CHANGED
@@ -271,8 +271,10 @@ void
|
|
271
271
|
Init_filemagic() {
|
272
272
|
cFileMagic = rb_define_class("FileMagic", rb_cObject);
|
273
273
|
|
274
|
-
char version[
|
274
|
+
char version[8] = "0";
|
275
|
+
#ifdef FILE_VERSION_MAJOR
|
275
276
|
sprintf(version, "%d.%02d", FILE_VERSION_MAJOR, patchlevel);
|
277
|
+
#endif
|
276
278
|
rb_define_const(cFileMagic, "MAGIC_VERSION", rb_str_new2(version));
|
277
279
|
|
278
280
|
rb_define_singleton_method(cFileMagic, "new", rb_magic_new, -1);
|
data/ext/filemagic.h
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
#ifndef
|
2
|
-
#define
|
1
|
+
#ifndef FILEMAGIC_H
|
2
|
+
#define FILEMAGIC_H
|
3
3
|
|
4
4
|
#include "ruby.h"
|
5
5
|
#include <math.h>
|
6
6
|
#include <magic.h>
|
7
|
+
#ifdef HAVE_FILE_PATCHLEVEL_H
|
7
8
|
#include <file/patchlevel.h>
|
9
|
+
#endif
|
8
10
|
|
9
11
|
/* Ruby 1.8.5 compatibility */
|
10
12
|
#ifndef RSTRING_LEN
|
@@ -46,4 +48,4 @@ static VALUE rb_magic_apply_simple(VALUE, const char*, VALUE);
|
|
46
48
|
static void rb_magic_free(magic_t);
|
47
49
|
void Init_filemagic(void);
|
48
50
|
|
49
|
-
#endif /*
|
51
|
+
#endif /* FILEMAGIC_H */
|
data/lib/filemagic/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-filemagic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 2
|
10
|
+
version: 0.4.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Travis Whitton
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-09-
|
19
|
+
date: 2010-09-16 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|