ruby-filemagic 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3eb3ecc3b55441028fac03c58ce23b94b4535489
4
- data.tar.gz: fe98ff3cc87c0bcc11aec60b4e4e1297dd296a4a
2
+ SHA256:
3
+ metadata.gz: 072a4b2682df79e50b62c7cf1c0b42db262bac212f90ec741fdf5b82b89a661f
4
+ data.tar.gz: ccce9e4086fd53a704ff20d5ed0fdeeec384f21e346ac0e228505f8802337b02
5
5
  SHA512:
6
- metadata.gz: b68a7914cf407d134b75e230b7fa61f2a07bcc9c4d1811203265e4a05c675f69e0f65b02b5453174943c9fe824fcc661467399af81477e87c2daa4d17333fce6
7
- data.tar.gz: e7e784821698c04c53a3d04fa011fbea772549c6d10fa92487e245711ed7e20def7cb1c9d07c5913a82c92aff9d1e81c2d29140c19f22ad8e15b6f34b7f4293d
6
+ metadata.gz: 42f6d02a666eefcfa9647cabe589ade5b7b2bae7e37cf9613b20cfe5190ab722543659028bf601b3b196a58c911596eed30cc9413544f3cdeaa5b335aa09c576
7
+ data.tar.gz: acf53f89c934e944917b80cfa62150da43b6b430bf4bce8798ad17b93dc54546a5092c42bdd0facf8eb35a0e12c56415a3b48409075e6262aadc93dcaae77be9
data/CONTRIBUTING.md CHANGED
@@ -1 +1 @@
1
- Please note that this project is in **maintenance mode**. Bug reports and pull requests are welcome, but only [file](http://www.darwinsys.com/file/) **5.11 or higher** is actually supported.
1
+ Please note that this project is **no longer maintained**. I'm happy to hand over ownership to anyone who shows serious interest.
data/ChangeLog CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  = Revision history for ruby-filemagic
4
4
 
5
+ == 0.7.3 [2022-01-07]
6
+
7
+ * Dockerfile to build native extension (pull request #26 by Pavel Lobashov).
8
+ * Include paths for ARM-based Apple Macs (Apple Silicon) (pull request #35 by
9
+ @545ch4).
10
+
5
11
  == 0.7.2 [2017-07-02]
6
12
 
7
13
  * Fix segfault on <tt>buffer(nil)</tt> when compiled with GCC (pull request
data/Dockerfile ADDED
@@ -0,0 +1,37 @@
1
+ FROM ruby:2.4
2
+
3
+ RUN apt-get update && apt-get install -y mingw-w64 && gem install rake-compiler
4
+ ENV HOST_ARCH i686-w64-mingw32
5
+
6
+ ENV GNURX_VERSION 2.5.1
7
+ ENV GNURX_SOURCE /mingw-libgnurx-$GNURX_VERSION
8
+ RUN curl https://vorboss.dl.sourceforge.net/project/mingw/Other/UserContributed/regex/mingw-regex-$GNURX_VERSION/mingw-libgnurx-$GNURX_VERSION-src.tar.gz | \
9
+ tar xzvf - && \
10
+ cd $GNURX_SOURCE && \
11
+ ./configure --host=$HOST_ARCH --enable-static --disable-shared && \
12
+ make
13
+
14
+ ENV MAGIC_VERSION 5.31
15
+ ENV MAGIC_SOURCE /file-$MAGIC_VERSION
16
+ RUN curl ftp://ftp.astron.com/pub/file/file-$MAGIC_VERSION.tar.gz | \
17
+ tar xzvf - && \
18
+ cd $MAGIC_SOURCE && \
19
+ ./configure --disable-silent-rules --enable-fsect-man5 && \
20
+ make && \
21
+ make clean && \
22
+ LDFLAGS=-L$GNURX_SOURCE CFLAGS=-I$GNURX_SOURCE ./configure --disable-silent-rules --enable-fsect-man5 --host=$HOST_ARCH && \
23
+ make || true
24
+
25
+ ENV CROSS_RUBIES 2.3.4 2.4.1
26
+ RUN for i in $CROSS_RUBIES; do rake-compiler cross-ruby VERSION=$i; done
27
+
28
+ ENV APP_SOURCE /ruby-filemagic
29
+ RUN mkdir $APP_SOURCE
30
+ WORKDIR $APP_SOURCE
31
+
32
+ RUN echo "source 'https://rubygems.org'\ngemspec\n" > Gemfile
33
+ COPY *.gemspec .
34
+ RUN bundle install
35
+
36
+ COPY . .
37
+ ENTRYPOINT rake gem:native WITH_CROSS_GNURX=$GNURX_SOURCE WITH_CROSS_MAGIC=$MAGIC_SOURCE
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to filemagic version 0.7.2
5
+ This documentation refers to filemagic version 0.7.3
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -38,9 +38,9 @@ FileMagic extension module. See also libmagic(3), file(1) and magic(4).
38
38
  require 'filemagic'
39
39
 
40
40
  p FileMagic::VERSION
41
- # => "0.7.2"
41
+ # => "0.7.3"
42
42
  p FileMagic::MAGIC_VERSION
43
- # => "5.28"
43
+ # => "5.39"
44
44
 
45
45
  p FileMagic.new.flags
46
46
  # => []
@@ -83,11 +83,16 @@ Fedora/SuSE:: +file-devel+
83
83
  Gentoo:: +sys-libs/libmagic+
84
84
  OS X:: <tt>brew install libmagic</tt>
85
85
 
86
+ === Build native extension
87
+
88
+ rake docker:gem:native
89
+
90
+ Requires Docker[https://docker.com] to be installed.
86
91
 
87
92
  == LINKS
88
93
 
89
- Homepage:: http://www.darwinsys.com/file/
90
- Documentation:: https://blackwinter.github.com/ruby-filemagic
94
+ Homepage:: https://www.darwinsys.com/file/
95
+ Documentation:: https://blackwinter.github.io/ruby-filemagic
91
96
  Source code:: https://github.com/blackwinter/ruby-filemagic
92
97
  RubyGem:: https://rubygems.org/gems/ruby-filemagic
93
98
  Travis CI:: https://travis-ci.org/blackwinter/ruby-filemagic
@@ -104,6 +109,9 @@ Travis CI:: https://travis-ci.org/blackwinter/ruby-filemagic
104
109
  * Martin Carpenter <mailto:mcarpenter@free.fr> for Ruby 1.9.2 compatibility
105
110
  and other improvements.
106
111
 
112
+ * Pavel Lobashov (@ShockwaveNN) for Dockerfile to build cross-compiled Windows
113
+ extension (pull request #26).
114
+
107
115
 
108
116
  == COPYING
109
117
 
data/Rakefile CHANGED
@@ -21,7 +21,6 @@ begin
21
21
  homepage: :blackwinter,
22
22
  local_files: [mgc],
23
23
  extension: {
24
- cross_compile: false,
25
24
  with_cross_gnurx: lambda { |dir| [dir] },
26
25
  with_cross_magic: lambda { |dir| [src =
27
26
  File.join(dir, 'src'), File.join(src, '.libs')] }
@@ -33,3 +32,20 @@ begin
33
32
  rescue LoadError => err
34
33
  warn "Please install the `hen' gem. (#{err})"
35
34
  end
35
+
36
+ namespace :docker do
37
+
38
+ name = "ruby-filemagic-gem-native:#{FileMagic::VERSION}"
39
+
40
+ task :build do
41
+ sh *%W[docker build -t #{name} .]
42
+ end
43
+
44
+ task :run do
45
+ sh *%W[docker run -it --rm -v #{Dir.pwd}/pkg:/ruby-filemagic/pkg #{name}]
46
+ end
47
+
48
+ desc "Build native gems using docker image #{name}"
49
+ task 'gem:native' => %w[build run]
50
+
51
+ end
@@ -3,12 +3,14 @@ require 'mkmf'
3
3
  HEADER_DIRS = [
4
4
  '/opt/local/include', # MacPorts
5
5
  '/usr/local/include', # compiled from source and Homebrew
6
+ '/opt/homebrew/include', # compiled from source and Homebrew (ARM based Macs)
6
7
  '/usr/include', # system
7
8
  ]
8
9
 
9
10
  LIB_DIRS = [
10
11
  '/opt/local/lib', # MacPorts
11
12
  '/usr/local/lib', # compiled from source and Homebrew
13
+ '/opt/homebrew/lib', # compiled from source and Homebrew (ARM based Macs)
12
14
  '/usr/lib', # system
13
15
  ]
14
16
 
@@ -4,7 +4,7 @@ class FileMagic
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 7
7
- TINY = 2
7
+ TINY = 3
8
8
 
9
9
  class << self
10
10
 
@@ -130,7 +130,10 @@ magic file from #{FileMagic.path}
130
130
  fm = FileMagic.new(FileMagic::MAGIC_NONE)
131
131
  res = silence_stderr { fm.check(path_to('perl.mgc')) }
132
132
  fm.close
133
- assert(res)
133
+ assert(match_version(
134
+ 0 => res,
135
+ 5.39 => !res
136
+ ))
134
137
  end
135
138
 
136
139
  def test_compile
@@ -238,7 +241,8 @@ magic file from #{FileMagic.path}
238
241
  assert_equal(match_version(
239
242
  0 => 'application/vnd.ms-office',
240
243
  5.11 => 'application/msword',
241
- 5.14 => 'application/vnd.ms-office'
244
+ 5.14 => 'application/vnd.ms-office',
245
+ 5.39 => 'application/vnd.ms-excel'
242
246
  ), fm.file(path_to('excel-example.xls')))
243
247
  end
244
248
 
metadata CHANGED
@@ -1,36 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-filemagic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Whitton
8
8
  - Jens Wille
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
- cert_chain:
12
- - |
13
- -----BEGIN CERTIFICATE-----
14
- MIIDMDCCAhigAwIBAgIBADANBgkqhkiG9w0BAQUFADA+MQswCQYDVQQDDAJ3dzEb
15
- MBkGCgmSJomT8ixkARkWC2JsYWNrd2ludGVyMRIwEAYKCZImiZPyLGQBGRYCZGUw
16
- HhcNMTMwMTMxMDkyMjIyWhcNMTQwMTMxMDkyMjIyWjA+MQswCQYDVQQDDAJ3dzEb
17
- MBkGCgmSJomT8ixkARkWC2JsYWNrd2ludGVyMRIwEAYKCZImiZPyLGQBGRYCZGUw
18
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVXmfa6rbTwKOvtuGoROc1
19
- I4qZjgLX0BA4WecYB97PjwLJmJ1hRvf9JulVCJYYmt5ZEPPXbgi9xLbcp6ofGmnC
20
- i68/kbhcz20/fRUtIJ2phU3ypQTEd2pFddpL7SR2FxLkzvvg5E6nslGn7o2erDpO
21
- 8sm610A3xsgT/eNIr9QA7k4pHh18X1KvZKmmQR4/AjVyKmKawzauKUoHHepjvjVs
22
- s0pVoM7UmOmrS4SafQ3OwUo37f19CVdN2/FW7z3e5+iYhKxdIFdhniX9iDWtA3Jn
23
- 7oUOtiolhCRK4P/c30UjTCDkRkOldsWciFUasROJ5VAV2SVv7FtGHoQLDZ/++tRr
24
- AgMBAAGjOTA3MAkGA1UdEwQCMAAwHQYDVR0OBBYEFIAPWU4BEoYUe82hY/0EkoGd
25
- Oo/WMAsGA1UdDwQEAwIEsDANBgkqhkiG9w0BAQUFAAOCAQEAf2YnB0mj42of22dA
26
- MimgJCAEgB3H5aHbZ6B5WVnFvrC2UUnhP+/kLj/6UgOfqcasy4Xh62NVGuNrf7rF
27
- 7NMN87XwexGuU2GCpIMUd6VCTA7zMP2OWuXEcba7jT5OtiI55buO0J4CRtyeX1XF
28
- qwlGgx4ItcGhMTlDFXj3IkpeVtjD8O7yWE21bHf9lLURmqK/r9KjoxrrVi7+cESJ
29
- H19TDW3R9p594jCl1ykPs3dz/0Bk+r1HTd35Yw+yBbyprSJb4S7OcRRHCryuo09l
30
- NBGyZvOBuqUp0xostWSk0dfxyn/YQ7eqvQRGBhK1VGa7Tg/KYqnemDE57+VOXrua
31
- 59wzaA==
32
- -----END CERTIFICATE-----
33
- date: 2017-07-02 00:00:00.000000000 Z
11
+ cert_chain: []
12
+ date: 2022-01-07 00:00:00.000000000 Z
34
13
  dependencies:
35
14
  - !ruby/object:Gem::Dependency
36
15
  name: hen
@@ -38,20 +17,20 @@ dependencies:
38
17
  requirements:
39
18
  - - "~>"
40
19
  - !ruby/object:Gem::Version
41
- version: '0.8'
20
+ version: '0.9'
42
21
  - - ">="
43
22
  - !ruby/object:Gem::Version
44
- version: 0.8.7
23
+ version: 0.9.1
45
24
  type: :development
46
25
  prerelease: false
47
26
  version_requirements: !ruby/object:Gem::Requirement
48
27
  requirements:
49
28
  - - "~>"
50
29
  - !ruby/object:Gem::Version
51
- version: '0.8'
30
+ version: '0.9'
52
31
  - - ">="
53
32
  - !ruby/object:Gem::Version
54
- version: 0.8.7
33
+ version: 0.9.1
55
34
  - !ruby/object:Gem::Dependency
56
35
  name: rake
57
36
  requirement: !ruby/object:Gem::Requirement
@@ -106,6 +85,7 @@ extra_rdoc_files:
106
85
  files:
107
86
  - CONTRIBUTING.md
108
87
  - ChangeLog
88
+ - Dockerfile
109
89
  - README
110
90
  - Rakefile
111
91
  - TODO
@@ -132,14 +112,15 @@ licenses:
132
112
  metadata: {}
133
113
  post_install_message: |2+
134
114
 
135
- ruby-filemagic-0.7.2 [2017-07-02]:
115
+ ruby-filemagic-0.7.3 [2022-01-07]:
136
116
 
137
- * Fix segfault on <tt>buffer(nil)</tt> when compiled with GCC (pull request
138
- #24 by Yuya Tanaka).
117
+ * Dockerfile to build native extension (pull request #26 by Pavel Lobashov).
118
+ * Include paths for ARM-based Apple Macs (Apple Silicon) (pull request #35 by
119
+ @545ch4).
139
120
 
140
121
  rdoc_options:
141
122
  - "--title"
142
- - ruby-filemagic Application documentation (v0.7.2)
123
+ - ruby-filemagic Application documentation (v0.7.3)
143
124
  - "--charset"
144
125
  - UTF-8
145
126
  - "--line-numbers"
@@ -159,9 +140,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
140
  - !ruby/object:Gem::Version
160
141
  version: '0'
161
142
  requirements: []
162
- rubyforge_project:
163
- rubygems_version: 2.6.8
164
- signing_key:
143
+ rubygems_version: 3.2.5
144
+ signing_key:
165
145
  specification_version: 4
166
146
  summary: Ruby bindings to the magic(4) library
167
147
  test_files: []
148
+ ...