mimemagic 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +8 -1
- data/.yardopts +5 -1
- data/CHANGELOG.md +15 -0
- data/Gemfile +3 -0
- data/README.md +4 -4
- data/Rakefile +7 -1
- data/ext/mimemagic/Rakefile +24 -4
- data/lib/mimemagic/version.rb +1 -1
- data/mimemagic.gemspec +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: bea73bdcae338c252c11c8277843f7eb8dc44973bd5914d7196dba814c0bb857
|
4
|
+
data.tar.gz: 6896a7a176e4adb7d4d27b8f99680176511d0c0db910fa339b20333adf394f78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1a8cad78a3938f61c11e9e8f8ab751db7e02f6f778f4128a215b186f71836ecf2169e81133f1cd5f6171214108ca46526ab161edc618127983fe92c51847546
|
7
|
+
data.tar.gz: 1e5bc77bb41ec5b3be0d19c7f1d8883e5e313df1b1035b6429c05eb7082f33323cdf48152be3f400853e3bbf0dc5b40c7ace4ffec50a39006d2494ea9835a10a
|
data/.gitignore
CHANGED
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -18,13 +18,28 @@ None
|
|
18
18
|
|
19
19
|
None
|
20
20
|
|
21
|
+
## 0.3.10
|
22
|
+
|
23
|
+
* Improve the development/test experience (@coldnebo, @kachick)
|
24
|
+
|
25
|
+
* Ensure the gem works in environments with gem caching (@haines)
|
26
|
+
|
27
|
+
* Add support for MacPorts installed dependencies (@brlanier)
|
28
|
+
|
29
|
+
* Allow using a dummy XML file in cases where the gem is just a transient
|
30
|
+
dependency. (@Scharrels)
|
31
|
+
|
21
32
|
## 0.3.9 (2021-03-25)
|
22
33
|
|
23
34
|
* Resolve issues parsing the version of freedesktop.org.xml shipped with
|
24
35
|
Ubuntu Trusty.
|
25
36
|
|
37
|
+
* Reintroduce overlays, since it seems at least some people were using
|
38
|
+
them.
|
39
|
+
|
26
40
|
* Make Rake a runtime dependency.
|
27
41
|
|
42
|
+
* Fix the test suite.
|
28
43
|
## 0.3.8 (2021-03-25)
|
29
44
|
|
30
45
|
Relax the dependency on Nokogiri to something less specific in order
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -46,10 +46,10 @@ http://www.rubydoc.info/github/mimemagicrb/mimemagic
|
|
46
46
|
Tests
|
47
47
|
=====
|
48
48
|
|
49
|
-
```
|
50
|
-
bundle install
|
49
|
+
```console
|
50
|
+
$ bundle install
|
51
51
|
|
52
|
-
rake test
|
52
|
+
$ bundle exec rake test
|
53
53
|
```
|
54
54
|
|
55
55
|
Authors
|
@@ -62,4 +62,4 @@ Authors
|
|
62
62
|
LICENSE
|
63
63
|
=======
|
64
64
|
|
65
|
-
MIT
|
65
|
+
{file:LICENSE MIT}
|
data/Rakefile
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
require 'rake/testtask'
|
2
|
+
require 'rake/clean'
|
3
|
+
|
4
|
+
namespace :ext do
|
5
|
+
load 'ext/mimemagic/Rakefile'
|
6
|
+
end
|
7
|
+
CLOBBER.include("lib/mimemagic/path.rb")
|
2
8
|
|
3
9
|
task :default => %w(test)
|
4
10
|
|
5
11
|
desc 'Run tests with minitest'
|
6
|
-
Rake::TestTask.new do |t|
|
12
|
+
Rake::TestTask.new("test" => "ext:default") do |t|
|
7
13
|
t.libs << 'test'
|
8
14
|
t.pattern = 'test/*_test.rb'
|
9
15
|
end
|
data/ext/mimemagic/Rakefile
CHANGED
@@ -6,6 +6,7 @@ def locate_mime_database
|
|
6
6
|
(File.expand_path(ENV["FREEDESKTOP_MIME_TYPES_PATH"]) if ENV["FREEDESKTOP_MIME_TYPES_PATH"]),
|
7
7
|
"/usr/local/share/mime/packages/freedesktop.org.xml",
|
8
8
|
"/opt/homebrew/share/mime/packages/freedesktop.org.xml",
|
9
|
+
"/opt/local/share/mime/packages/freedesktop.org.xml",
|
9
10
|
"/usr/share/mime/packages/freedesktop.org.xml"
|
10
11
|
].compact
|
11
12
|
path = possible_paths.find { |candidate| File.exist?(candidate) }
|
@@ -17,17 +18,36 @@ def locate_mime_database
|
|
17
18
|
Ensure you have either installed the shared-mime-info package for your distribution, or
|
18
19
|
obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to the location
|
19
20
|
of that file.
|
21
|
+
|
22
|
+
This gem might be installed as a dependency of some bigger package, such as rails, activestorage,
|
23
|
+
axlsx or cucumber. While most of these packages use the functionality of this gem, some gems have
|
24
|
+
included this gem by accident. Set USE_FREEDESKTOP_PLACEHOLDER=true if you are certain that you
|
25
|
+
do not need this gem, and wish to skip the inclusion of freedesktop.org.xml.
|
26
|
+
|
27
|
+
The FREEDESKTOP_PLACEHOLDER option is meant as a transitional feature, and will be deprecated in
|
28
|
+
the next release.
|
20
29
|
ERROR
|
21
30
|
end
|
22
31
|
|
23
32
|
desc "Build a file pointing at the database"
|
24
33
|
task :default do
|
25
|
-
mime_database_path =
|
26
|
-
|
27
|
-
|
34
|
+
mime_database_path = nil
|
35
|
+
if ENV["USE_FREEDESKTOP_PLACEHOLDER"] == "true"
|
36
|
+
File.write("../../dummy.xml", "")
|
37
|
+
mime_database_path = File.expand_path("../../dummy.xml")
|
38
|
+
else
|
39
|
+
mime_database_path = locate_mime_database
|
40
|
+
end
|
41
|
+
|
42
|
+
target_dir = "#{ENV.fetch("RUBYARCHDIR", "../lib")}/mimemagic"
|
43
|
+
mkdir_p target_dir
|
44
|
+
|
45
|
+
open("#{target_dir}/path.rb", "w") do |f|
|
46
|
+
f.print(<<~SOURCE
|
28
47
|
class MimeMagic
|
29
48
|
DATABASE_PATH="#{mime_database_path}"
|
30
49
|
end
|
31
|
-
|
50
|
+
SOURCE
|
51
|
+
)
|
32
52
|
end
|
33
53
|
end
|
data/lib/mimemagic/version.rb
CHANGED
data/mimemagic.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.extensions = %w(ext/mimemagic/Rakefile)
|
16
16
|
|
17
17
|
s.summary = 'Fast mime detection by extension or content'
|
18
|
-
s.description = 'Fast mime detection by extension or content
|
18
|
+
s.description = 'Fast mime detection by extension or content (Uses freedesktop.org.xml shared-mime-info database)'
|
19
19
|
s.homepage = 'https://github.com/mimemagicrb/mimemagic'
|
20
20
|
s.license = 'MIT'
|
21
21
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mimemagic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Mendler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-03-
|
12
|
+
date: 2021-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '5.14'
|
56
|
-
description: Fast mime detection by extension or content
|
56
|
+
description: Fast mime detection by extension or content (Uses freedesktop.org.xml
|
57
57
|
shared-mime-info database)
|
58
58
|
email:
|
59
59
|
- mail@daniel-mendler.de
|