mimer_plus 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +8 -5
- data/lib/mimer_plus.rb +1 -1
- data/mimer_plus.gemspec +2 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -6,7 +6,7 @@ Mimer has been tested to work on Debian 5.0 and Mac OS X 10.5+. This gem is usel
|
|
6
6
|
|
7
7
|
== Install
|
8
8
|
|
9
|
-
gem install
|
9
|
+
gem install mimer_plus
|
10
10
|
|
11
11
|
You may need to install the gemcutter gem first.
|
12
12
|
|
@@ -14,16 +14,19 @@ You may need to install the gemcutter gem first.
|
|
14
14
|
|
15
15
|
It's quite easy:
|
16
16
|
|
17
|
-
mimer = Mimer.identify('/tmp/testfile')
|
17
|
+
$ mimer = Mimer.identify('/tmp/testfile')
|
18
18
|
|
19
|
-
mimer.mime_type
|
19
|
+
$ mimer.mime_type
|
20
20
|
=> "image/jpeg; charset=binary"
|
21
21
|
|
22
|
-
mimer.text?
|
22
|
+
$ mimer.text?
|
23
23
|
=> false
|
24
24
|
|
25
|
-
mimer.image?
|
25
|
+
$ mimer.image?
|
26
26
|
=> true
|
27
|
+
|
28
|
+
$ mimer.some_strange_type?
|
29
|
+
=> false
|
27
30
|
|
28
31
|
== Get the code
|
29
32
|
|
data/lib/mimer_plus.rb
CHANGED
@@ -44,7 +44,7 @@ class Mimer
|
|
44
44
|
|
45
45
|
# Responds to every method that ends with a question mark that isn't implemented in {Mimer}
|
46
46
|
def method_missing(m, *args, &block)
|
47
|
-
return mime_type.match
|
47
|
+
return !! mime_type.match(/#{m.to_s.gsub(/\?$/, '')}/i) if m.to_s.match(/\?$/)
|
48
48
|
super(m, *args, &block)
|
49
49
|
end
|
50
50
|
|
data/mimer_plus.gemspec
CHANGED
@@ -2,11 +2,11 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "mimer_plus"
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.3"
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ["Linus Oleander", "Ariejan de Vroom"]
|
8
8
|
s.email = ["linus@oleander.nu", "ariejan@ariejan.net"]
|
9
|
-
s.homepage = "https://github.com/oleander/
|
9
|
+
s.homepage = "https://github.com/oleander/mimer"
|
10
10
|
s.summary = %q{Find the mime-type of a file using unix' `file` command. This does not look at file extension, ever.}
|
11
11
|
s.description = %q{Find the mime-type of a file using unix' `file` command. This does not look at file extension, ever...}
|
12
12
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Linus Oleander
|
@@ -59,7 +59,7 @@ files:
|
|
59
59
|
- spec/mimer_plus_spec.rb
|
60
60
|
- spec/spec_helper.rb
|
61
61
|
has_rdoc: true
|
62
|
-
homepage: https://github.com/oleander/
|
62
|
+
homepage: https://github.com/oleander/mimer
|
63
63
|
licenses: []
|
64
64
|
|
65
65
|
post_install_message:
|