attachments 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/attachments.rb +2 -0
- data/lib/attachments/extract.rb +9 -1
- data/lib/attachments/filemagic.rb +1 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/attachments.rb
CHANGED
data/lib/attachments/extract.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require 'rubygems'
|
2
4
|
require 'uuidtools'
|
3
5
|
require 'fileutils'
|
@@ -32,7 +34,13 @@ module Attachments
|
|
32
34
|
@last_parsed = filename
|
33
35
|
|
34
36
|
# Load the email
|
35
|
-
|
37
|
+
m = File.read(filename)
|
38
|
+
begin
|
39
|
+
m.force_encoding("UTF-8")
|
40
|
+
rescue
|
41
|
+
# force_encoding not supported in ruby 1.8
|
42
|
+
end
|
43
|
+
@mail = Mail.new(m)
|
36
44
|
|
37
45
|
# Parse parts recursively until it is not multipart
|
38
46
|
# Ignore types that are not suited for forwarding
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attachments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rune Myrland
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-14 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|