mimemagic-dorian 0.5.4 → 0.5.5

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
  SHA256:
3
- metadata.gz: 060e2ae0726ea36fcb9f30276d9a4337f2a59b76a8dc0c0f9bc2d747966a850a
4
- data.tar.gz: afc690980aaed5df5e70a6794a34189d380ac71392877c61aa7846c49ee71ee0
3
+ metadata.gz: 144a66162ec74400e632d236e81adbaa15a5e508c55f780b1b8314800af3fc64
4
+ data.tar.gz: 0c17b8d7bcb7b35cd49e2e89ebe7f81a05ae41a5a20309171e4632bf01005a0a
5
5
  SHA512:
6
- metadata.gz: d141cc2c0bb627b671771e64f3ab309784ac0d42b2bbfff7d73e1c480632cd994520ae320c5ae08386f0bc812cfbf5875902c87fe9bfcc019f207653b424fcc6
7
- data.tar.gz: bfbdfa6941490d426dad7dec017de72f92b6312be59b89730c87162027309ada8174b72b9ec70b88b7c51db3171befc77167e44d9990700be12c637bea7c0a35
6
+ metadata.gz: 1837bd49db48079d34ae234b73825d449164c9ab6a4c9c2e8b4faa5f386a871342f6d1893cbeaa1cf11d821a5fd4bb9295d98b8aca4bbbb23d5591382fa7a695
7
+ data.tar.gz: 97f8bc92d245a7c3cd1f6dff1340064ac95c3c01a882c0703774cfa0ac74d407775f3b26c0acb98e720e05718ae96b3ce3f9ad564c27136e1bdb452fbc51ebaf
@@ -1,5 +1,5 @@
1
1
  class MimeMagic
2
2
  # MimeMagic version string
3
3
  # @api public
4
- VERSION = '0.5.4'
4
+ VERSION = '0.5.5'
5
5
  end
@@ -0,0 +1 @@
1
+ require 'mimemagic'
data/lib/mimemagic.rb CHANGED
@@ -155,10 +155,11 @@ class MimeMagic
155
155
  #
156
156
  def descendant_of? ancestor
157
157
  # always false if we don't know what this is
158
- return unless c = canonical
158
+ return false unless c = canonical
159
+ return false unless ancestor = self.class[ancestor].canonical
159
160
 
160
161
  # ancestor canonical could be nil which will be false
161
- c.lineage.include? self.class[ancestor].canonical
162
+ c.lineage.include? ancestor
162
163
  end
163
164
 
164
165
  # Returns true if type is child of parent type. Behaves the same as
@@ -217,8 +218,9 @@ class MimeMagic
217
218
  # @return [false, true] whether the two are equal.
218
219
  #
219
220
  def eql?(other)
221
+ return false unless other
220
222
  # coerce the rhs
221
- other = self.class[other] || self.class.default_type
223
+ other = self.class[other] or return false
222
224
 
223
225
  # check for an exact match
224
226
  return true if type == other.type
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mimemagic-dorian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Taylor
@@ -9,7 +9,7 @@ authors:
9
9
  - Jon Wood
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-06-03 00:00:00.000000000 Z
12
+ date: 2026-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -75,6 +75,7 @@ files:
75
75
  - README.md
76
76
  - Rakefile
77
77
  - ext/mimemagic/Rakefile
78
+ - lib/mimemagic-dorian.rb
78
79
  - lib/mimemagic.rb
79
80
  - lib/mimemagic/tables.rb
80
81
  - lib/mimemagic/version.rb