libmagic_rb 0.1.1.pre.alpha → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +27 -11
- data/ext/libmagic/func.h +22 -14
- data/ext/libmagic/magic.c +11 -6
- data/ext/libmagic/modes.h +69 -4
- data/ext/libmagic/params.h +36 -2
- data/lib/libmagic_rb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ac744f446c39849d74275d6f3fd08a40222b3b40894a4ec0c419573c44d819e
|
4
|
+
data.tar.gz: 7fb5c5bbec7cc46fe1a1e2833d50e75d0212b528b9c70d34c0b3bebd8c71bc88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 639b9571220fe58e27d7b67a48d942232cccdaf7c3e8b66089f27a9bb274d419a73df81b343aaa016ffb5e20193d2b000733d472ea0a6d463bc3a1e05be4f0ba
|
7
|
+
data.tar.gz: 03aba90d37ecca84e1129634f4fbcde15c5c432092e16e1e2b44be4779a1797580fda46acb024eb058eb374dc86e2afed9819ad22f6b669f269774e65f2660d8
|
data/README.md
CHANGED
@@ -3,21 +3,33 @@ Adds ability to check mime-type of a file using the libmagic ([magic(4)](https:/
|
|
3
3
|
It uses native extensions and it's quite performant.
|
4
4
|
|
5
5
|
## Pre-Installation
|
6
|
-
On Linux, you need to install libmagic.
|
6
|
+
On Linux, you need to install libmagic. The version we recommend is at least 5.36.
|
7
|
+
But if you have an older version of libmagic, it will compile and work flawlessly but with a few caveats:
|
7
8
|
|
8
|
-
|
9
|
+
+ Many constants (modes and params) will be not defined
|
10
|
+
+ LibmagicRb::MAGIC_VERSION constant will be set to 0.
|
11
|
+
+ Few methods will not work.
|
12
|
+
some methods that can return a String or Integer will return nil (like setparam and getparam).
|
13
|
+
|
14
|
+
[ Do note that the minimum tested version is 5.11, older than that may fail to compile the gem ]
|
15
|
+
|
16
|
+
You also need Ruby > 1.9.0 in order to run this gem.
|
17
|
+
|
18
|
+
With that info in mind, let's continue to the installation part for your Linux distributions...
|
19
|
+
|
20
|
+
#### Arch / Manjaro / Archlabs & other Arch based Linux
|
9
21
|
|
10
22
|
```
|
11
23
|
# pacman -S file gcc make
|
12
24
|
```
|
13
25
|
|
14
|
-
#### Debian / Ubuntu / Linux Mint /
|
26
|
+
#### Debian / Ubuntu / Linux Mint / RaspberryPi OS & other Debian based Linux
|
15
27
|
|
16
28
|
```
|
17
29
|
# apt install libmagic-dev ruby-dev gcc make
|
18
30
|
```
|
19
31
|
|
20
|
-
#### Fedora
|
32
|
+
#### Fedora / Amazon Linux / CentOS & Other RedHat based Linux
|
21
33
|
|
22
34
|
```
|
23
35
|
# yum install file-devel ruby-devel gcc make
|
@@ -51,6 +63,9 @@ Or install it yourself as:
|
|
51
63
|
$ gem install libmagic_rb
|
52
64
|
```
|
53
65
|
|
66
|
+
We recommend getting the gem only from Rubygems.org. Do not download this repo as zip, compile to install the gem.
|
67
|
+
A rubygem version is released after various tests. Any branch here including Master branch can be unstable can even segfault your app. You've been warned!
|
68
|
+
|
54
69
|
## Usage
|
55
70
|
The target of this gem is to add mime-type checking easily.
|
56
71
|
|
@@ -162,18 +177,19 @@ cookie.setparam(LibmagicRb::MAGIC_PARAM_REGEX_MAX, 2 ** 14) # => 16384; but can
|
|
162
177
|
|
163
178
|
#### Notes:
|
164
179
|
|
165
|
-
+ To get the parameters, you can refer to the [man page](https://man7.org/linux/man-pages/man3/magic_getflags.3.html).
|
166
|
-
+
|
180
|
+
+ To get the parameters, you can run `LibmagicRb.lsparams()` for description, please refer to the [man page](https://man7.org/linux/man-pages/man3/magic_getflags.3.html).
|
181
|
+
+ `cookie.setparam()` returns the value after getting the param as well. So you don't need to confirm by calling getparam() again.
|
167
182
|
+ The maximum size depends on the parameter. But the value that can be passed should not be more than 2 ** 32.
|
183
|
+
+ On older versions of libmagic, where the function isn't available, both getparam() and setparam() will perform no operations, and return nil!
|
168
184
|
|
169
185
|
## Errors
|
170
186
|
The following errors are implemented and raised on appropriate situation:
|
171
187
|
|
172
|
-
1. LibmagicRb::FileNotFound
|
173
|
-
2. LibmagicRb::FileUnreadable
|
174
|
-
3. LibmagicRb::InvalidDBError
|
175
|
-
4. LibmagicRb::IsDirError
|
176
|
-
5. LibmagicRb::FileClosedError
|
188
|
+
1. `LibmagicRb::FileNotFound`: When the file is not found.
|
189
|
+
2. `LibmagicRb::FileUnreadable`: When the file is unreadable.
|
190
|
+
3. `LibmagicRb::InvalidDBError`: When the database given is invalid.
|
191
|
+
4. `LibmagicRb::IsDirError`: When the database path is a directory.
|
192
|
+
5. `LibmagicRb::FileClosedError`: When the file is already closed (closed?()) but you are trying to access the cookie.
|
177
193
|
|
178
194
|
## Development
|
179
195
|
|
data/ext/libmagic/func.h
CHANGED
@@ -52,29 +52,37 @@ VALUE _checkGlobal_(volatile VALUE self) {
|
|
52
52
|
}
|
53
53
|
|
54
54
|
VALUE _getParamGlobal_(volatile VALUE self, volatile VALUE param) {
|
55
|
-
|
55
|
+
#if MAGIC_VERSION > 525
|
56
|
+
RB_UNWRAP(cookie) ;
|
56
57
|
|
57
|
-
|
58
|
-
|
58
|
+
unsigned int _param = NUM2UINT(param) ;
|
59
|
+
unsigned long value ;
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
61
|
+
int status = magic_getparam(*cookie, _param, &value) ;
|
62
|
+
if (status) return Qnil ;
|
63
|
+
return ULONG2NUM(value) ;
|
64
|
+
#else
|
65
|
+
return Qnil ;
|
66
|
+
#endif
|
63
67
|
}
|
64
68
|
|
65
69
|
VALUE _setParamGlobal_(volatile VALUE self, volatile VALUE param, volatile VALUE paramVal) {
|
66
|
-
|
67
|
-
|
70
|
+
#if MAGIC_VERSION > 525
|
71
|
+
unsigned int _param = NUM2UINT(param) ;
|
72
|
+
unsigned long _paramVal = NUM2ULONG(paramVal) ;
|
68
73
|
|
69
|
-
|
74
|
+
RB_UNWRAP(cookie) ;
|
70
75
|
|
71
|
-
|
72
|
-
|
76
|
+
unsigned long value ;
|
77
|
+
magic_setparam(*cookie, _param, &_paramVal) ;
|
73
78
|
|
74
|
-
|
79
|
+
int status = magic_getparam(*cookie, _param, &value) ;
|
80
|
+
if (status) return Qnil ;
|
75
81
|
|
76
|
-
|
77
|
-
|
82
|
+
return ULONG2NUM((int)value) ;
|
83
|
+
#else
|
84
|
+
return Qnil ;
|
85
|
+
#endif
|
78
86
|
}
|
79
87
|
|
80
88
|
VALUE _bufferGlobal_(volatile VALUE self, volatile VALUE string) {
|
data/ext/libmagic/magic.c
CHANGED
@@ -10,6 +10,10 @@
|
|
10
10
|
#include "params.h"
|
11
11
|
#include "definitions.h"
|
12
12
|
|
13
|
+
#ifndef MAGIC_VERSION
|
14
|
+
#define MAGIC_VERSION 0
|
15
|
+
#endif
|
16
|
+
|
13
17
|
/*
|
14
18
|
* Errors
|
15
19
|
*/
|
@@ -111,14 +115,11 @@ VALUE rb_libmagicRb_initialize(volatile VALUE self, volatile VALUE args) {
|
|
111
115
|
|
112
116
|
VALUE argDBPath = rb_hash_aref(args, ID2SYM(rb_intern("db"))) ;
|
113
117
|
|
114
|
-
char *databasePath ;
|
115
118
|
if (RB_TYPE_P(argDBPath, T_NIL)) {
|
116
|
-
databasePath = NULL ;
|
117
119
|
rb_ivar_set(self, rb_intern("@db"), Qnil) ;
|
118
120
|
} else if (!RB_TYPE_P(argDBPath, T_STRING)) {
|
119
121
|
rb_raise(rb_eArgError, "Database name must be an instance of String.") ;
|
120
122
|
} else {
|
121
|
-
databasePath = StringValuePtr(argDBPath) ;
|
122
123
|
rb_ivar_set(self, rb_intern("@db"), argDBPath) ;
|
123
124
|
}
|
124
125
|
|
@@ -183,9 +184,13 @@ void Init_main() {
|
|
183
184
|
modes(cLibmagicRb) ;
|
184
185
|
params(cLibmagicRb) ;
|
185
186
|
|
186
|
-
|
187
|
-
|
188
|
-
|
187
|
+
#if MAGIC_VERSION > 525
|
188
|
+
char version[6] ;
|
189
|
+
sprintf(version, "%0.2f", magic_version() / 100.0) ;
|
190
|
+
rb_define_const(cLibmagicRb, "MAGIC_VERSION", rb_str_new_cstr(version)) ;
|
191
|
+
#else
|
192
|
+
rb_define_const(cLibmagicRb, "MAGIC_VERSION", rb_str_new_cstr("0")) ;
|
193
|
+
#endif
|
189
194
|
|
190
195
|
/*
|
191
196
|
* Singleton Methods
|
data/ext/libmagic/modes.h
CHANGED
@@ -15,24 +15,57 @@ void modes(volatile VALUE rb_klass) {
|
|
15
15
|
rb_define_const(rb_klass, "MAGIC_RAW", INT2FIX(MAGIC_RAW)) ;
|
16
16
|
rb_define_const(rb_klass, "MAGIC_ERROR", INT2FIX(MAGIC_ERROR)) ;
|
17
17
|
rb_define_const(rb_klass, "MAGIC_APPLE", INT2FIX(MAGIC_APPLE)) ;
|
18
|
+
|
19
|
+
#ifdef MAGIC_EXTENSION
|
18
20
|
rb_define_const(rb_klass, "MAGIC_EXTENSION", INT2FIX(MAGIC_EXTENSION)) ;
|
21
|
+
#endif
|
22
|
+
|
23
|
+
#ifdef MAGIC_COMPRESS_TRANSP
|
19
24
|
rb_define_const(rb_klass, "MAGIC_COMPRESS_TRANSP", INT2FIX(MAGIC_COMPRESS_TRANSP)) ;
|
25
|
+
#endif
|
26
|
+
|
27
|
+
#ifdef MAGIC_NO_CHECK_APPTYPE
|
20
28
|
rb_define_const(rb_klass, "MAGIC_NO_CHECK_APPTYPE", INT2FIX(MAGIC_NO_CHECK_APPTYPE)) ;
|
29
|
+
#endif
|
30
|
+
|
31
|
+
#ifdef MAGIC_NO_CHECK_CDF
|
21
32
|
rb_define_const(rb_klass, "MAGIC_NO_CHECK_CDF", INT2FIX(MAGIC_NO_CHECK_CDF)) ;
|
33
|
+
#endif
|
34
|
+
|
35
|
+
#ifdef MAGIC_NO_CHECK_COMPRESS
|
22
36
|
rb_define_const(rb_klass, "MAGIC_NO_CHECK_COMPRESS", INT2FIX(MAGIC_NO_CHECK_COMPRESS)) ;
|
37
|
+
#endif
|
38
|
+
|
39
|
+
#ifdef MAGIC_NO_CHECK_ELF
|
23
40
|
rb_define_const(rb_klass, "MAGIC_NO_CHECK_ELF", INT2FIX(MAGIC_NO_CHECK_ELF)) ;
|
41
|
+
#endif
|
42
|
+
|
43
|
+
#ifdef MAGIC_NO_CHECK_ENCODING
|
24
44
|
rb_define_const(rb_klass, "MAGIC_NO_CHECK_ENCODING", INT2FIX(MAGIC_NO_CHECK_ENCODING)) ;
|
45
|
+
#endif
|
46
|
+
|
47
|
+
#ifdef MAGIC_NO_CHECK_SOFT
|
25
48
|
rb_define_const(rb_klass, "MAGIC_NO_CHECK_SOFT", INT2FIX(MAGIC_NO_CHECK_SOFT)) ;
|
49
|
+
#endif
|
50
|
+
|
51
|
+
#ifdef MAGIC_NO_CHECK_TAR
|
26
52
|
rb_define_const(rb_klass, "MAGIC_NO_CHECK_TAR", INT2FIX(MAGIC_NO_CHECK_TAR)) ;
|
53
|
+
#endif
|
54
|
+
|
55
|
+
#ifdef MAGIC_NO_CHECK_TEXT
|
27
56
|
rb_define_const(rb_klass, "MAGIC_NO_CHECK_TEXT", INT2FIX(MAGIC_NO_CHECK_TEXT)) ;
|
57
|
+
#endif
|
58
|
+
|
59
|
+
#ifdef MAGIC_NO_CHECK_TOKENS
|
28
60
|
rb_define_const(rb_klass, "MAGIC_NO_CHECK_TOKENS", INT2FIX(MAGIC_NO_CHECK_TOKENS)) ;
|
61
|
+
#endif
|
29
62
|
|
30
63
|
#ifdef MAGIC_NO_CHECK_JSON
|
31
|
-
|
64
|
+
rb_define_const(rb_klass, "MAGIC_NO_CHECK_JSON", INT2FIX(MAGIC_NO_CHECK_JSON)) ;
|
32
65
|
#endif
|
33
66
|
|
34
67
|
#ifdef MAGIC_NO_CHECK_CSV
|
35
|
-
|
68
|
+
rb_define_const(rb_klass, "MAGIC_NO_CHECK_CSV", INT2FIX(MAGIC_NO_CHECK_CSV)) ;
|
36
69
|
#endif
|
37
70
|
}
|
38
71
|
|
@@ -53,24 +86,56 @@ VALUE lsmodes(volatile VALUE obj) {
|
|
53
86
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_RAW")), INT2FIX(MAGIC_RAW)) ;
|
54
87
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_ERROR")), INT2FIX(MAGIC_ERROR)) ;
|
55
88
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_APPLE")), INT2FIX(MAGIC_APPLE)) ;
|
89
|
+
#ifdef MAGIC_EXTENSION
|
56
90
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_EXTENSION")), INT2FIX(MAGIC_EXTENSION)) ;
|
91
|
+
#endif
|
92
|
+
|
93
|
+
#ifdef MAGIC_COMPRESS_TRANSP
|
57
94
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_COMPRESS_TRANSP")), INT2FIX(MAGIC_COMPRESS_TRANSP)) ;
|
95
|
+
#endif
|
96
|
+
|
97
|
+
#ifdef MAGIC_NO_CHECK_APPTYPE
|
58
98
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_APPTYPE")), INT2FIX(MAGIC_NO_CHECK_APPTYPE)) ;
|
99
|
+
#endif
|
100
|
+
|
101
|
+
#ifdef MAGIC_NO_CHECK_CDF
|
59
102
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_CDF")), INT2FIX(MAGIC_NO_CHECK_CDF)) ;
|
103
|
+
#endif
|
104
|
+
|
105
|
+
#ifdef MAGIC_NO_CHECK_COMPRESS
|
60
106
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_COMPRESS")), INT2FIX(MAGIC_NO_CHECK_COMPRESS)) ;
|
107
|
+
#endif
|
108
|
+
|
109
|
+
#ifdef MAGIC_NO_CHECK_ELF
|
61
110
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_ELF")), INT2FIX(MAGIC_NO_CHECK_ELF)) ;
|
111
|
+
#endif
|
112
|
+
|
113
|
+
#ifdef MAGIC_NO_CHECK_ENCODING
|
62
114
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_ENCODING")), INT2FIX(MAGIC_NO_CHECK_ENCODING)) ;
|
115
|
+
#endif
|
116
|
+
|
117
|
+
#ifdef MAGIC_NO_CHECK_SOFT
|
63
118
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_SOFT")), INT2FIX(MAGIC_NO_CHECK_SOFT)) ;
|
119
|
+
#endif
|
120
|
+
|
121
|
+
#ifdef MAGIC_NO_CHECK_TAR
|
64
122
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_TAR")), INT2FIX(MAGIC_NO_CHECK_TAR)) ;
|
123
|
+
#endif
|
124
|
+
|
125
|
+
#ifdef MAGIC_NO_CHECK_TEXT
|
65
126
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_TEXT")), INT2FIX(MAGIC_NO_CHECK_TEXT)) ;
|
127
|
+
#endif
|
128
|
+
|
129
|
+
#ifdef MAGIC_NO_CHECK_TOKENS
|
66
130
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_TOKENS")), INT2FIX(MAGIC_NO_CHECK_TOKENS)) ;
|
131
|
+
#endif
|
67
132
|
|
68
133
|
#ifdef MAGIC_NO_CHECK_CSV
|
69
|
-
|
134
|
+
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_CSV")), INT2FIX(MAGIC_NO_CHECK_CSV)) ;
|
70
135
|
#endif
|
71
136
|
|
72
137
|
#ifdef MAGIC_NO_CHECK_CSV
|
73
|
-
|
138
|
+
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_NO_CHECK_JSON")), INT2FIX(MAGIC_NO_CHECK_JSON)) ;
|
74
139
|
#endif
|
75
140
|
|
76
141
|
return hash ;
|
data/ext/libmagic/params.h
CHANGED
@@ -1,28 +1,62 @@
|
|
1
1
|
void params(volatile VALUE rb_klass) {
|
2
|
+
#ifdef MAGIC_PARAM_INDIR_MAX
|
2
3
|
rb_define_const(rb_klass, "MAGIC_PARAM_INDIR_MAX", UINT2NUM(MAGIC_PARAM_INDIR_MAX)) ;
|
4
|
+
#endif
|
5
|
+
|
6
|
+
#ifdef MAGIC_PARAM_NAME_MAX
|
3
7
|
rb_define_const(rb_klass, "MAGIC_PARAM_NAME_MAX", UINT2NUM(MAGIC_PARAM_NAME_MAX)) ;
|
8
|
+
#endif
|
9
|
+
|
10
|
+
#ifdef MAGIC_PARAM_ELF_NOTES_MAX
|
4
11
|
rb_define_const(rb_klass, "MAGIC_PARAM_ELF_NOTES_MAX", UINT2NUM(MAGIC_PARAM_ELF_NOTES_MAX)) ;
|
12
|
+
#endif
|
13
|
+
|
14
|
+
#ifdef MAGIC_PARAM_ELF_PHNUM_MAX
|
5
15
|
rb_define_const(rb_klass, "MAGIC_PARAM_ELF_PHNUM_MAX", UINT2NUM(MAGIC_PARAM_ELF_PHNUM_MAX)) ;
|
16
|
+
#endif
|
17
|
+
|
18
|
+
#ifdef MAGIC_PARAM_ELF_SHNUM_MAX
|
6
19
|
rb_define_const(rb_klass, "MAGIC_PARAM_ELF_SHNUM_MAX", UINT2NUM(MAGIC_PARAM_ELF_SHNUM_MAX)) ;
|
20
|
+
#endif
|
21
|
+
|
22
|
+
#ifdef MAGIC_PARAM_REGEX_MAX
|
7
23
|
rb_define_const(rb_klass, "MAGIC_PARAM_REGEX_MAX", UINT2NUM(MAGIC_PARAM_REGEX_MAX)) ;
|
24
|
+
#endif
|
8
25
|
|
9
26
|
#ifdef MAGIC_PARAM_BYTES_MAX
|
10
|
-
|
27
|
+
rb_define_const(rb_klass, "MAGIC_PARAM_BYTES_MAX", UINT2NUM(MAGIC_PARAM_BYTES_MAX)) ;
|
11
28
|
#endif
|
12
29
|
}
|
13
30
|
|
14
31
|
VALUE lsparams(volatile VALUE obj) {
|
15
32
|
VALUE hash = rb_hash_new() ;
|
16
33
|
|
34
|
+
#ifdef MAGIC_PARAM_INDIR_MAX
|
17
35
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_PARAM_INDIR_MAX")), UINT2NUM(MAGIC_PARAM_INDIR_MAX)) ;
|
36
|
+
#endif
|
37
|
+
|
38
|
+
#ifdef MAGIC_PARAM_NAME_MAX
|
18
39
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_PARAM_NAME_MAX")), UINT2NUM(MAGIC_PARAM_NAME_MAX)) ;
|
40
|
+
#endif
|
41
|
+
|
42
|
+
#ifdef MAGIC_PARAM_ELF_NOTES_MAX
|
19
43
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_PARAM_ELF_NOTES_MAX")), UINT2NUM(MAGIC_PARAM_ELF_NOTES_MAX)) ;
|
44
|
+
#endif
|
45
|
+
|
46
|
+
#ifdef MAGIC_PARAM_ELF_PHNUM_MAX
|
20
47
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_PARAM_ELF_PHNUM_MAX")), UINT2NUM(MAGIC_PARAM_ELF_PHNUM_MAX)) ;
|
48
|
+
#endif
|
49
|
+
|
50
|
+
#ifdef MAGIC_PARAM_ELF_SHNUM_MAX
|
21
51
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_PARAM_ELF_SHNUM_MAX")), UINT2NUM(MAGIC_PARAM_ELF_SHNUM_MAX)) ;
|
52
|
+
#endif
|
53
|
+
|
54
|
+
#ifdef MAGIC_PARAM_REGEX_MAX
|
22
55
|
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_PARAM_REGEX_MAX")), UINT2NUM(MAGIC_PARAM_REGEX_MAX)) ;
|
56
|
+
#endif
|
23
57
|
|
24
58
|
#ifdef MAGIC_PARAM_BYTES_MAX
|
25
|
-
|
59
|
+
rb_hash_aset(hash, ID2SYM(rb_intern("MAGIC_PARAM_BYTES_MAX")), UINT2NUM(MAGIC_PARAM_BYTES_MAX)) ;
|
26
60
|
#endif
|
27
61
|
|
28
62
|
return hash ;
|
data/lib/libmagic_rb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libmagic_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cybergizer
|
@@ -47,9 +47,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
47
47
|
version: 1.9.0
|
48
48
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
|
-
- - "
|
50
|
+
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
52
|
+
version: '0'
|
53
53
|
requirements: []
|
54
54
|
rubygems_version: 3.2.21
|
55
55
|
signing_key:
|