ruby-filemagic 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog CHANGED
@@ -1,6 +1,10 @@
1
1
  = Revision history for ruby-filemagic
2
2
 
3
- == 0.4.1
3
+ == 0.4.2 [2010-09-16]
4
+
5
+ * Not all versions/distributions have file/patchlevel.h
6
+
7
+ == 0.4.1 [2010-09-15]
4
8
 
5
9
  * Added MAGIC_VERSION
6
10
  * Fixed example script
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to filemagic version 0.4.1
5
+ This documentation refers to filemagic version 0.4.2
6
6
 
7
7
 
8
8
  == DESCRIPTION
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') and have_header('magic.h')
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
- print "*** ERROR: missing required library to compile this module\n"
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[16];
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 __FILEMAGIC_H_
2
- #define __FILEMAGIC_H_
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 /* __FILEMAGIC_H_ */
51
+ #endif /* FILEMAGIC_H */
@@ -4,7 +4,7 @@ class FileMagic
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 4
7
- TINY = 1
7
+ TINY = 2
8
8
 
9
9
  class << self
10
10
 
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: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
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-15 00:00:00 +02:00
19
+ date: 2010-09-16 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies: []
22
22