decoration_mail 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{decoration_mail}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
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-03-22}
12
+ s.date = %q{2011-03-23}
13
13
  s.description = %q{Decoration Mail Parser}
14
14
  s.email = %q{d.akatsuka@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
43
43
  ]
44
44
  s.homepage = %q{https://github.com/dakatsuka/decoration_mail}
45
45
  s.require_paths = ["lib"]
46
- s.rubygems_version = %q{1.6.2}
46
+ s.rubygems_version = %q{1.3.7}
47
47
  s.summary = %q{Decoration Mail Parser}
48
48
  s.test_files = [
49
49
  "spec/spec_helper.rb",
@@ -53,6 +53,7 @@ Gem::Specification.new do |s|
53
53
  ]
54
54
 
55
55
  if s.respond_to? :specification_version then
56
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
56
57
  s.specification_version = 3
57
58
 
58
59
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ require 'kconv'
2
3
 
3
4
  module DecorationMail
4
5
  class Base
@@ -6,7 +7,7 @@ module DecorationMail
6
7
 
7
8
  def initialize(mail)
8
9
  each_attachments(mail)
9
- @subject = mail.subject.blank? ? nil : mail.subject.encode("UTF-8")
10
+ @subject = mail.subject.blank? ? nil : mail.subject.toutf8
10
11
  @body_text = parse_text(mail.text_part)
11
12
  @body_html = parse_html(mail.html_part)
12
13
  end
@@ -36,11 +37,11 @@ module DecorationMail
36
37
 
37
38
  private
38
39
  def parse_text(text)
39
- text.to_s.encode("UTF-8")
40
+ text.to_s.toutf8
40
41
  end
41
42
 
42
43
  def parse_html(html)
43
- html = html.body.to_s.force_encoding(html.charset).encode("UTF-8")
44
+ html = html.body.to_s.toutf8
44
45
  html = Hpricot.parse(html)
45
46
 
46
47
  if html.search("body").empty?
metadata CHANGED
@@ -1,8 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decoration_mail
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.3
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 4
9
+ version: 0.2.4
6
10
  platform: ruby
7
11
  authors:
8
12
  - Dai Akatsuka
@@ -10,7 +14,7 @@ autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
16
 
13
- date: 2011-03-22 00:00:00 +09:00
17
+ date: 2011-03-23 00:00:00 +09:00
14
18
  default_executable:
15
19
  dependencies:
16
20
  - !ruby/object:Gem::Dependency
@@ -20,6 +24,10 @@ dependencies:
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 2
29
+ - 2
30
+ - 9
23
31
  version: 2.2.9
24
32
  type: :runtime
25
33
  prerelease: false
@@ -31,6 +39,10 @@ dependencies:
31
39
  requirements:
32
40
  - - ">="
33
41
  - !ruby/object:Gem::Version
42
+ segments:
43
+ - 0
44
+ - 8
45
+ - 3
34
46
  version: 0.8.3
35
47
  type: :runtime
36
48
  prerelease: false
@@ -42,6 +54,9 @@ dependencies:
42
54
  requirements:
43
55
  - - ">="
44
56
  - !ruby/object:Gem::Version
57
+ segments:
58
+ - 2
59
+ - 0
45
60
  version: "2.0"
46
61
  type: :development
47
62
  prerelease: false
@@ -53,6 +68,8 @@ dependencies:
53
68
  requirements:
54
69
  - - ">="
55
70
  - !ruby/object:Gem::Version
71
+ segments:
72
+ - 0
56
73
  version: "0"
57
74
  type: :development
58
75
  prerelease: false
@@ -104,17 +121,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
121
  requirements:
105
122
  - - ">="
106
123
  - !ruby/object:Gem::Version
124
+ segments:
125
+ - 0
107
126
  version: "0"
108
127
  required_rubygems_version: !ruby/object:Gem::Requirement
109
128
  none: false
110
129
  requirements:
111
130
  - - ">="
112
131
  - !ruby/object:Gem::Version
132
+ segments:
133
+ - 0
113
134
  version: "0"
114
135
  requirements: []
115
136
 
116
137
  rubyforge_project:
117
- rubygems_version: 1.6.2
138
+ rubygems_version: 1.3.7
118
139
  signing_key:
119
140
  specification_version: 3
120
141
  summary: Decoration Mail Parser