decoration_mail 0.1.0 → 0.1.1
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.
- data/README.rdoc +5 -0
- data/VERSION +1 -1
- data/decoration_mail.gemspec +10 -7
- data/lib/decoration_mail/base.rb +5 -0
- data/lib/decoration_mail/image.rb +5 -0
- data/spec/resources/softbank_decoration_with_attachment.eml +4 -11
- data/spec/unit/base_spec.rb +1 -0
- data/spec/unit/image_spec.rb +21 -0
- metadata +5 -3
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/decoration_mail.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{decoration_mail}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dai Akatsuka"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-24}
|
13
13
|
s.description = %q{Decoration Mail Parser}
|
14
14
|
s.email = %q{d.akatsuka@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
"README.rdoc",
|
23
23
|
"Rakefile",
|
24
24
|
"VERSION",
|
25
|
+
"decoration_mail.gemspec",
|
25
26
|
"init.rb",
|
26
27
|
"lib/decoration_mail.rb",
|
27
28
|
"lib/decoration_mail/base.rb",
|
@@ -36,7 +37,8 @@ Gem::Specification.new do |s|
|
|
36
37
|
"spec/resources/softbank_decoration_with_attachment.eml",
|
37
38
|
"spec/spec_helper.rb",
|
38
39
|
"spec/unit/base_spec.rb",
|
39
|
-
"spec/unit/converter_spec.rb"
|
40
|
+
"spec/unit/converter_spec.rb",
|
41
|
+
"spec/unit/image_spec.rb"
|
40
42
|
]
|
41
43
|
s.homepage = %q{https://github.com/dakatsuka/decoration_mail}
|
42
44
|
s.require_paths = ["lib"]
|
@@ -45,7 +47,8 @@ Gem::Specification.new do |s|
|
|
45
47
|
s.test_files = [
|
46
48
|
"spec/spec_helper.rb",
|
47
49
|
"spec/unit/base_spec.rb",
|
48
|
-
"spec/unit/converter_spec.rb"
|
50
|
+
"spec/unit/converter_spec.rb",
|
51
|
+
"spec/unit/image_spec.rb"
|
49
52
|
]
|
50
53
|
|
51
54
|
if s.respond_to? :specification_version then
|
@@ -53,18 +56,18 @@ Gem::Specification.new do |s|
|
|
53
56
|
s.specification_version = 3
|
54
57
|
|
55
58
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
56
|
-
s.add_runtime_dependency(%q<mail>, [">= 2.2.
|
59
|
+
s.add_runtime_dependency(%q<mail>, [">= 2.2.9"])
|
57
60
|
s.add_runtime_dependency(%q<hpricot>, [">= 0.8.3"])
|
58
61
|
s.add_development_dependency(%q<rspec>, [">= 2.0"])
|
59
62
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
60
63
|
else
|
61
|
-
s.add_dependency(%q<mail>, [">= 2.2.
|
64
|
+
s.add_dependency(%q<mail>, [">= 2.2.9"])
|
62
65
|
s.add_dependency(%q<hpricot>, [">= 0.8.3"])
|
63
66
|
s.add_dependency(%q<rspec>, [">= 2.0"])
|
64
67
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
65
68
|
end
|
66
69
|
else
|
67
|
-
s.add_dependency(%q<mail>, [">= 2.2.
|
70
|
+
s.add_dependency(%q<mail>, [">= 2.2.9"])
|
68
71
|
s.add_dependency(%q<hpricot>, [">= 0.8.3"])
|
69
72
|
s.add_dependency(%q<rspec>, [">= 2.0"])
|
70
73
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
data/lib/decoration_mail/base.rb
CHANGED
@@ -4,10 +4,15 @@ module DecorationMail
|
|
4
4
|
class Base
|
5
5
|
def initialize(mail)
|
6
6
|
@attachments = mail.attachments
|
7
|
+
@subject = NKF.nkf("-w", mail.subject)
|
7
8
|
@body_text = parse_text(mail.text_part)
|
8
9
|
@body_html = parse_html(mail.html_part)
|
9
10
|
end
|
10
11
|
|
12
|
+
def subject
|
13
|
+
@subject
|
14
|
+
end
|
15
|
+
|
11
16
|
def images
|
12
17
|
images = []
|
13
18
|
|
@@ -1,14 +1,7 @@
|
|
1
|
-
Return-Path: <
|
2
|
-
X-Spam-Checker-Version: SpamAssassin 3.1.7-deb3 (2006-10-05) on
|
3
|
-
ist-www1.ist-corp.jp
|
4
|
-
X-Spam-Level: ****
|
5
|
-
X-Spam-Status: No, score=4.5 required=7.0 tests=CONTENT_TYPE_PRESENT,
|
6
|
-
DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,FAKEDWORD_ONE,
|
7
|
-
FAKEDWORD_VERTICALLINE,FAKEDWORD_ZERO,HTML_IMAGE_ONLY_12,HTML_MESSAGE,
|
8
|
-
ISO2022JP_BODY,QENCPTR1,QENCPTR2 autolearn=no version=3.1.7-deb3
|
1
|
+
Return-Path: <example@softbank.ne.jp>
|
9
2
|
X-Original-To: d.akatsuka@ist-corp.jp
|
10
3
|
Delivered-To: akatsuka@ist-corp.jp
|
11
|
-
Received: from
|
4
|
+
Received: from xxxxx.softbank.ne.jp (xxxxx.softbank.ne.jp [255.255.255.255])
|
12
5
|
by ist-corp.jp (Postfix) with SMTP id 962DB38280
|
13
6
|
for <d.akatsuka@ist-corp.jp>; Tue, 8 Feb 2011 16:36:43 +0900 (JST)
|
14
7
|
Subject: =?ISO-2022-JP?B?GyRCJUclMyVhITwlaxsoQg==?=
|
@@ -17,9 +10,9 @@ Content-Type:multipart/related;
|
|
17
10
|
boundary="aadbeiviljhdlcec_942SH"
|
18
11
|
Date: Tue, 08 Feb 2011 16:36:43 +0900
|
19
12
|
Message-ID: <20110208163643282885.3543@0016E68C4108>
|
20
|
-
From: <
|
13
|
+
From: <example@softbank.ne.jp>
|
21
14
|
To: d.akatsuka@ist-corp.jp
|
22
|
-
Sender:
|
15
|
+
Sender:example@softbank.ne.jp
|
23
16
|
X-Priority: 3
|
24
17
|
|
25
18
|
|
data/spec/unit/base_spec.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
3
|
+
|
4
|
+
describe DecorationMail::Image do
|
5
|
+
before {
|
6
|
+
@mail = Mail.read(File.expand_path('../../resources/docomo_decoration_with_attachment.eml', __FILE__))
|
7
|
+
@deco = @mail.decoration
|
8
|
+
|
9
|
+
images = []
|
10
|
+
@deco.save {|image| images << image}
|
11
|
+
@image = images.first
|
12
|
+
}
|
13
|
+
|
14
|
+
subject { @image }
|
15
|
+
|
16
|
+
it { should respond_to :path }
|
17
|
+
its(:read) { should eql @mail.attachments.first.read }
|
18
|
+
its(:content_id) { should eql "cid:01@110207.142735@______F03B@docomo.ne.jp" }
|
19
|
+
its(:filename) { should eql "06_gochisou_header.gif" }
|
20
|
+
its(:extension) { should eql "gif" }
|
21
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Dai Akatsuka
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-02-
|
17
|
+
date: 2011-02-24 00:00:00 +09:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- spec/spec_helper.rb
|
106
106
|
- spec/unit/base_spec.rb
|
107
107
|
- spec/unit/converter_spec.rb
|
108
|
+
- spec/unit/image_spec.rb
|
108
109
|
has_rdoc: true
|
109
110
|
homepage: https://github.com/dakatsuka/decoration_mail
|
110
111
|
licenses: []
|
@@ -141,3 +142,4 @@ test_files:
|
|
141
142
|
- spec/spec_helper.rb
|
142
143
|
- spec/unit/base_spec.rb
|
143
144
|
- spec/unit/converter_spec.rb
|
145
|
+
- spec/unit/image_spec.rb
|