ruby-filemagic 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/{CHANGELOG → ChangeLog} +32 -32
- data/README +1 -1
- data/TODO +0 -1
- data/ext/filemagic.c +4 -0
- data/ext/filemagic.h +2 -1
- data/info/example.rb +14 -11
- data/lib/filemagic.rb +1 -0
- data/lib/filemagic/version.rb +1 -1
- metadata +6 -5
data/{CHANGELOG → ChangeLog}
RENAMED
@@ -1,16 +1,34 @@
|
|
1
|
-
|
2
|
-
7/28/2003 version 0.1.0
|
1
|
+
= Revision history for ruby-filemagic
|
3
2
|
|
4
|
-
|
3
|
+
== 0.4.1
|
5
4
|
|
6
|
-
|
7
|
-
|
5
|
+
* Added MAGIC_VERSION
|
6
|
+
* Fixed example script
|
8
7
|
|
9
|
-
|
10
|
-
|
8
|
+
== 0.4.0 [2010-09-14]
|
9
|
+
|
10
|
+
* Brushed up C layer
|
11
|
+
* Moved most of the Ruby stuff to C
|
12
|
+
* No longer expose internal state (@closed, @flags)
|
13
|
+
* No longer expose internal C methods (fm_*)
|
14
|
+
* Updated for magic(4) version 5.04
|
15
|
+
|
16
|
+
== 0.3.0 [2010-09-10]
|
11
17
|
|
12
|
-
|
13
|
-
|
18
|
+
* Ruby 1.9.2 compatibility (Martin Carpenter)
|
19
|
+
* Exposed flags as symbols (Martin Carpenter)
|
20
|
+
|
21
|
+
== 0.2.2 [2010-03-02]
|
22
|
+
|
23
|
+
* Allow '.' when abbreviating mime types (Eric Schwartz)
|
24
|
+
* Cleanup and project file fixes
|
25
|
+
|
26
|
+
== 0.2.1 [2008-09-18]
|
27
|
+
|
28
|
+
* Added mahoro source file and tests for reference and inspiration
|
29
|
+
* We have a Rubyforge project now! :-)
|
30
|
+
|
31
|
+
== 0.2.0 [2008-09-12]
|
14
32
|
|
15
33
|
* Modified C API
|
16
34
|
* Uniform C function prefix rb_magic_ (instead of magick_)
|
@@ -21,29 +39,11 @@
|
|
21
39
|
* Added/updated project files
|
22
40
|
* Now available as a Rubygem!
|
23
41
|
|
24
|
-
|
25
|
-
9/18/2008 version 0.2.1
|
26
|
-
|
27
|
-
* Added mahoro source file and tests for reference and inspiration
|
28
|
-
* We have a Rubyforge project now! :-)
|
29
|
-
|
30
|
-
--------------------------------------------------------------------------------
|
31
|
-
3/2/2010 version 0.2.2
|
42
|
+
== 0.1.1 [2003-07-30]
|
32
43
|
|
33
|
-
*
|
34
|
-
*
|
35
|
-
|
36
|
-
--------------------------------------------------------------------------------
|
37
|
-
9/10/2010 version 0.3.0
|
38
|
-
|
39
|
-
* Ruby 1.9.2 compatibility (Martin Carpenter)
|
40
|
-
* Exposed flags as symbols (Martin Carpenter)
|
44
|
+
* Added manual close method
|
45
|
+
* Added unit test suite
|
41
46
|
|
42
|
-
|
43
|
-
9/14/2010 version 0.4.0
|
47
|
+
== 0.1.0 [2003-07-28]
|
44
48
|
|
45
|
-
*
|
46
|
-
* Moved most of the Ruby stuff to C
|
47
|
-
* No longer expose internal state (@closed, @flags)
|
48
|
-
* No longer expose internal C methods (fm_*)
|
49
|
-
* Updated for magic(4) version 5.04
|
49
|
+
* Initial release.
|
data/README
CHANGED
data/TODO
CHANGED
data/ext/filemagic.c
CHANGED
@@ -271,6 +271,10 @@ void
|
|
271
271
|
Init_filemagic() {
|
272
272
|
cFileMagic = rb_define_class("FileMagic", rb_cObject);
|
273
273
|
|
274
|
+
char version[16];
|
275
|
+
sprintf(version, "%d.%02d", FILE_VERSION_MAJOR, patchlevel);
|
276
|
+
rb_define_const(cFileMagic, "MAGIC_VERSION", rb_str_new2(version));
|
277
|
+
|
274
278
|
rb_define_singleton_method(cFileMagic, "new", rb_magic_new, -1);
|
275
279
|
|
276
280
|
rb_define_method(cFileMagic, "initialize", rb_magic_init, -1);
|
data/ext/filemagic.h
CHANGED
data/info/example.rb
CHANGED
@@ -3,26 +3,29 @@
|
|
3
3
|
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
4
|
require 'filemagic'
|
5
5
|
|
6
|
-
|
6
|
+
p FileMagic::VERSION
|
7
|
+
p FileMagic::MAGIC_VERSION
|
8
|
+
|
9
|
+
p FileMagic.new.flags
|
7
10
|
|
8
11
|
FileMagic.open(:mime) { |fm|
|
9
|
-
|
10
|
-
|
12
|
+
p fm.flags
|
13
|
+
p fm.file(__FILE__)
|
11
14
|
|
12
|
-
fm.
|
13
|
-
|
15
|
+
fm.flags = [:raw, :continue]
|
16
|
+
p fm.flags
|
14
17
|
}
|
15
18
|
|
16
19
|
fm = FileMagic.new
|
17
|
-
|
20
|
+
p fm.flags
|
18
21
|
|
19
22
|
mime = FileMagic.mime
|
20
|
-
|
23
|
+
p mime.flags
|
21
24
|
|
22
25
|
ARGV.each { |file|
|
23
|
-
|
24
|
-
|
26
|
+
p fm.file(file)
|
27
|
+
p fm.file(file, true)
|
25
28
|
|
26
|
-
|
27
|
-
|
29
|
+
p mime.file(file)
|
30
|
+
p mime.file(file, true)
|
28
31
|
}
|
data/lib/filemagic.rb
CHANGED
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: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
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-15 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|
@@ -29,6 +29,7 @@ executables: []
|
|
29
29
|
extensions:
|
30
30
|
- ext/extconf.rb
|
31
31
|
extra_rdoc_files:
|
32
|
+
- ChangeLog
|
32
33
|
- README
|
33
34
|
files:
|
34
35
|
- lib/filemagic/ext.rb
|
@@ -45,7 +46,7 @@ files:
|
|
45
46
|
- test/filemagic_test.rb
|
46
47
|
- test/excel-example.xls
|
47
48
|
- README
|
48
|
-
-
|
49
|
+
- ChangeLog
|
49
50
|
- Rakefile
|
50
51
|
- TODO
|
51
52
|
- info/filemagic.rd
|