emilio 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,5 +18,5 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency 'rails', '~> 3.0.0'
21
+ s.add_dependency 'rails', '~> 3'
22
22
  end
@@ -44,5 +44,6 @@ module Emilio
44
44
  end
45
45
  end
46
46
 
47
+ require 'emilio/scheduler_base'
47
48
  Dir["#{File.dirname(__FILE__)}/emilio/schedulers/*.rb"].each{|f| require f}
48
49
 
@@ -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("Error: #{e}")
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
@@ -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
- ic = Iconv.new('utf-8', email.text_part.charset)
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
- @body = ic.iconv(email.body.to_s)
21
- end
22
- @subject = ic.iconv(email.subject)
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
@@ -1,3 +1,3 @@
1
1
  module Emilio
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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
- hash: 27
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
- date: 2011-06-13 00:00:00 +02:00
19
- default_executable:
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
- prerelease: false
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
- hash: 7
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
- version_requirements: *id001
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/schedulers/base.rb
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
- has_rdoc: true
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
- hash: 3
76
- segments:
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
- hash: 3
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.6.2
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
-