emilio 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/emilio.gemspec +1 -1
- data/lib/emilio.rb +1 -0
- data/lib/emilio/checker.rb +2 -1
- data/lib/emilio/receiver.rb +7 -8
- data/lib/emilio/{schedulers/base.rb → scheduler_base.rb} +0 -0
- data/lib/emilio/version.rb +1 -1
- metadata +34 -55
data/emilio.gemspec
CHANGED
data/lib/emilio.rb
CHANGED
data/lib/emilio/checker.rb
CHANGED
@@ -40,7 +40,8 @@ module Emilio
|
|
40
40
|
rescue Net::IMAP::ByeResponseError => e
|
41
41
|
Emilio.logger.error("Bye response: #{e}")
|
42
42
|
rescue => e
|
43
|
-
Emilio.logger.error(
|
43
|
+
Emilio.logger.error(e.message)
|
44
|
+
Emilio.logger.error(e.backtrace.join("\n"))
|
44
45
|
end
|
45
46
|
|
46
47
|
Time::DATE_FORMATS[:default] = old_time_format
|
data/lib/emilio/receiver.rb
CHANGED
@@ -6,20 +6,19 @@ module Emilio
|
|
6
6
|
@attachments = email.attachments
|
7
7
|
@sender = email.from.to_s
|
8
8
|
|
9
|
-
if email.multipart?
|
9
|
+
@body = if email.multipart?
|
10
10
|
if email.html_part.present?
|
11
|
-
ic = Iconv.new('utf-8', email.html_part.charset)
|
12
|
-
@body = ic.iconv(email.html_part.body.to_s)
|
13
11
|
@html = true
|
12
|
+
email.html_part
|
14
13
|
else
|
15
|
-
|
16
|
-
@body = ic.iconv(email.text_part.body.to_s)
|
14
|
+
email.text_part
|
17
15
|
end
|
18
16
|
else
|
19
17
|
ic = Iconv.new('utf-8', email.charset)
|
20
|
-
|
21
|
-
end
|
22
|
-
|
18
|
+
email
|
19
|
+
end.body.to_s.encode("utf-8")
|
20
|
+
|
21
|
+
@subject = email.subject.encode
|
23
22
|
Emilio.logger.info("Parsed email [#{@subject}] from [#{@sender}]")
|
24
23
|
|
25
24
|
parse
|
File without changes
|
data/lib/emilio/version.rb
CHANGED
metadata
CHANGED
@@ -1,49 +1,39 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: emilio
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 0.1.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Roger Campos
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-05-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: rails
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
18
|
+
requirements:
|
27
19
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 3
|
32
|
-
- 0
|
33
|
-
- 0
|
34
|
-
version: 3.0.0
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3'
|
35
22
|
type: :runtime
|
36
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3'
|
37
30
|
description: Parse incoming emails with IMAP
|
38
|
-
email:
|
31
|
+
email:
|
39
32
|
- roger@itnig.net
|
40
33
|
executables: []
|
41
|
-
|
42
34
|
extensions: []
|
43
|
-
|
44
35
|
extra_rdoc_files: []
|
45
|
-
|
46
|
-
files:
|
36
|
+
files:
|
47
37
|
- .gitignore
|
48
38
|
- Gemfile
|
49
39
|
- README.md
|
@@ -54,43 +44,32 @@ files:
|
|
54
44
|
- lib/emilio/logger.rb
|
55
45
|
- lib/emilio/railtie.rb
|
56
46
|
- lib/emilio/receiver.rb
|
57
|
-
- lib/emilio/
|
47
|
+
- lib/emilio/scheduler_base.rb
|
58
48
|
- lib/emilio/schedulers/delayed_job.rb
|
59
49
|
- lib/emilio/schedulers/delayed_job/scheduler.rb
|
60
50
|
- lib/emilio/version.rb
|
61
|
-
|
62
|
-
homepage: ""
|
51
|
+
homepage: ''
|
63
52
|
licenses: []
|
64
|
-
|
65
53
|
post_install_message:
|
66
54
|
rdoc_options: []
|
67
|
-
|
68
|
-
require_paths:
|
55
|
+
require_paths:
|
69
56
|
- lib
|
70
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
58
|
none: false
|
72
|
-
requirements:
|
73
|
-
- -
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
|
77
|
-
- 0
|
78
|
-
version: "0"
|
79
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
64
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
|
85
|
-
segments:
|
86
|
-
- 0
|
87
|
-
version: "0"
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
88
69
|
requirements: []
|
89
|
-
|
90
70
|
rubyforge_project: emilio
|
91
|
-
rubygems_version: 1.
|
71
|
+
rubygems_version: 1.8.18
|
92
72
|
signing_key:
|
93
73
|
specification_version: 3
|
94
74
|
summary: Parse incoming emails with IMAP
|
95
75
|
test_files: []
|
96
|
-
|