ruby-filemagic 0.5.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a838370185e74426017deaa1c9b9e41935636c68
4
- data.tar.gz: c7fc52e6fd4a78dea2ede8b329641cc2f4a6fa17
3
+ metadata.gz: dc404160b6bdf763a0a5545a8dcc3494dca9c875
4
+ data.tar.gz: 2d3998f17942cc9a98f88dfb86a9ceaf563139a4
5
5
  SHA512:
6
- metadata.gz: c05274940e05af64ac2609e9a03d3fc22a4175f61d1e29d83e30c85a129531953383952d82e491040431d9127f7fecb5fde61c38a30966f793eda611194d074c
7
- data.tar.gz: 05869472cbb9bfec6be74f95976a8ea26d3dbca77070578a6e69505d66882e480047a6df765973cbaebdcc410de57bb9a7b72a85a91cdc08f9356d80b0e61e91
6
+ metadata.gz: 16897fa6cf7f428b2873fe1e1386ddcfd743dfd466d4e46dbd1278ba4c817a7428516b55a3822ccd6cdfd09194f3bb3314e0c3ccb36945bd8ecfd99279fdf4c9
7
+ data.tar.gz: 276914ae240cd3412b2d7361b061a8d010cd5f552ef1c08d26f55b9e2d097b8b5f265e8699bef19ddf920bb6c15bbc1d0b519f03f1429c09fb61427078ac3bb8
data/ChangeLog CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  = Revision history for ruby-filemagic
4
4
 
5
+ == 0.5.1 [2014-04-15]
6
+
7
+ * New method FileMagic#io.
8
+ * Housekeeping.
9
+
5
10
  == 0.5.0 [2013-12-19]
6
11
 
7
12
  * Removed usage of +RARRAY_PTR+ (cf. Ruby bug
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to filemagic version 0.5.0
5
+ This documentation refers to filemagic version 0.5.1
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -42,11 +42,10 @@ Travis
42
42
 
43
43
  == LINKS
44
44
 
45
- <b></b>
46
45
  Homepage (defunct):: http://grub.ath.cx/filemagic/
47
- Documentation:: http://blackwinter.github.com/ruby-filemagic
48
- Source code:: http://github.com/blackwinter/ruby-filemagic
49
- RubyGem:: http://rubygems.org/gems/ruby-filemagic
46
+ Documentation:: https://blackwinter.github.io/ruby-filemagic/
47
+ Source code:: https://github.com/blackwinter/ruby-filemagic
48
+ RubyGem:: https://rubygems.org/gems/ruby-filemagic
50
49
 
51
50
 
52
51
  == AUTHORS
data/Rakefile CHANGED
@@ -15,9 +15,8 @@ begin
15
15
  :extra_files => FileList['info/*'].to_a,
16
16
  :dependencies => %w[],
17
17
  :extension => {
18
- :name => 'filemagic',
19
- :ext_dir => 'ext',
20
- :lib_dir => 'lib',
18
+ :name => 'ruby_filemagic',
19
+ :ext_name => 'filemagic',
21
20
  :cross_compile => false
22
21
  }
23
22
  }
@@ -5,7 +5,7 @@ dir_config('magic')
5
5
 
6
6
  if have_library('magic', 'magic_open') && have_header('magic.h')
7
7
  have_header('file/patchlevel.h')
8
- create_makefile('filemagic')
8
+ create_makefile('filemagic/ruby_filemagic')
9
9
  else
10
10
  abort '*** ERROR: missing required library to compile this module'
11
11
  end
@@ -270,7 +270,7 @@ rb_magic_free(magic_t cookie) {
270
270
  }
271
271
 
272
272
  void
273
- Init_filemagic() {
273
+ Init_ruby_filemagic() {
274
274
  char version[8] = "0";
275
275
  cFileMagic = rb_define_class("FileMagic", rb_cObject);
276
276
 
@@ -43,6 +43,6 @@ static VALUE rb_magic_flags_to_int(VALUE);
43
43
  static VALUE rb_magic_apply_simple(VALUE, const char*, VALUE);
44
44
 
45
45
  static void rb_magic_free(magic_t);
46
- void Init_filemagic(void);
46
+ void Init_ruby_filemagic(void);
47
47
 
48
48
  #endif /* FILEMAGIC_H */
@@ -1,4 +1,4 @@
1
- require 'filemagic.so'
1
+ require 'filemagic/ruby_filemagic'
2
2
  require 'filemagic/version'
3
3
 
4
4
  class FileMagic
@@ -43,7 +43,7 @@ class FileMagic
43
43
  SIMPLE_RE = %r{([.\w\/-]+)}
44
44
 
45
45
  @fm = Hash.new { |fm, flags|
46
- fm.has_key?(key = flags.to_s) ? fm[key] : fm[key] = new(*flags)
46
+ fm.key?(key = flags.to_s) ? fm[key] : fm[key] = new(*flags)
47
47
  }
48
48
 
49
49
  class << self
@@ -89,6 +89,10 @@ class FileMagic
89
89
  @simplified
90
90
  end
91
91
 
92
+ def io(io, length = 8)
93
+ buffer(io.read(length))
94
+ end
95
+
92
96
  def inspect
93
97
  super.insert(-2, closed? ? ' (closed)' : '')
94
98
  end
@@ -4,7 +4,7 @@ class FileMagic
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 5
7
- TINY = 0
7
+ TINY = 1
8
8
 
9
9
  class << self
10
10
 
@@ -0,0 +1 @@
1
+ require 'filemagic'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-filemagic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Whitton
@@ -9,32 +9,75 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-19 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2014-04-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: hen
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: test-unit
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
14
56
  description: Ruby bindings to the magic(4) library
15
57
  email:
16
58
  - tinymountain@gmail.com
17
59
  - jens.wille@gmail.com
18
60
  executables: []
19
61
  extensions:
20
- - ext/extconf.rb
62
+ - ext/filemagic/extconf.rb
21
63
  extra_rdoc_files:
22
64
  - README
23
65
  - ChangeLog
24
- - ext/filemagic.c
66
+ - ext/filemagic/filemagic.c
25
67
  files:
26
- - lib/filemagic.rb
27
- - lib/filemagic/ext.rb
28
- - lib/filemagic/version.rb
29
- - info/example.rb
30
- - info/filemagic.rd
31
68
  - ChangeLog
32
69
  - README
33
70
  - Rakefile
34
71
  - TODO
35
- - ext/extconf.rb
36
- - ext/filemagic.c
37
- - ext/filemagic.h
72
+ - ext/filemagic/extconf.rb
73
+ - ext/filemagic/filemagic.c
74
+ - ext/filemagic/filemagic.h
75
+ - info/example.rb
76
+ - info/filemagic.rd
77
+ - lib/filemagic.rb
78
+ - lib/filemagic/ext.rb
79
+ - lib/filemagic/version.rb
80
+ - lib/ruby-filemagic.rb
38
81
  - test/excel-example.xls
39
82
  - test/filemagic_test.rb
40
83
  - test/leaktest.rb
@@ -49,15 +92,14 @@ licenses:
49
92
  metadata: {}
50
93
  post_install_message: |2+
51
94
 
52
- ruby-filemagic-0.5.0 [2013-12-19]:
95
+ ruby-filemagic-0.5.1 [2014-04-15]:
53
96
 
54
- * Removed usage of +RARRAY_PTR+ (cf. Ruby bug
55
- {#8399}[https://bugs.ruby-lang.org/issues/8399]).
97
+ * New method FileMagic#io.
56
98
  * Housekeeping.
57
99
 
58
100
  rdoc_options:
59
101
  - "--title"
60
- - ruby-filemagic Application documentation (v0.5.0)
102
+ - ruby-filemagic Application documentation (v0.5.1)
61
103
  - "--charset"
62
104
  - UTF-8
63
105
  - "--line-numbers"
@@ -78,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
120
  version: '0'
79
121
  requirements: []
80
122
  rubyforge_project:
81
- rubygems_version: 2.1.11
123
+ rubygems_version: 2.2.2
82
124
  signing_key:
83
125
  specification_version: 4
84
126
  summary: Ruby bindings to the magic(4) library