navi_client 1.3.7 → 1.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49675ffc7d89176c662573f31286223970b00f0c077b814bae9504dcc2d7da32
4
- data.tar.gz: 0f7bc30b427cf4329af368511f3542d373d042b36e403e40730fe078149fda54
3
+ metadata.gz: 4ed77b0572dbd2f2b752cf59de9d5ddb24681efd4363abf6969aefc6e2dff391
4
+ data.tar.gz: 0677d7a8a9810b437973d38fe4eb8f2b55e87e508fba87adcd409dc5fb1df84f
5
5
  SHA512:
6
- metadata.gz: 0d6a997f842f9ccc0b857008d7bf3983f0ee92813c1dd0556c182795838bbd6547b91b754c9ad26b121c8199951809aca01aef1f937b05076fc889745e7fd356
7
- data.tar.gz: 79e349e6b70e72b1c15a503cd951c66c2d919d7d34560fa0f36098c82bc94ed67bc790dd1f9bf1e55dfa9866b1e23ee9ceb0aed6d76a6e76a0cc16d34154463f
6
+ metadata.gz: c5545b9a4c0f5a08b2d9a6d0af26e5f0fcc947fa0bb415134aec4e53ac1876474da049eab748281594871ee166bc00ce14d9523dfe3fbac5cb60a1f3de56958b
7
+ data.tar.gz: 97bd3be83071a1751a3cf1c9a9a83ae4689d6ff7d77f594e34fbd1e9ddef47c2aef6c31d9ab5ed4f93201eaf68dff9c326b2fe9b3427c336c36fc82c0c9a64f9
data/lib/client.rb CHANGED
@@ -96,20 +96,24 @@ module Client
96
96
  end
97
97
 
98
98
  message_ids.each_with_index do |message_id, i|
99
- # fetch all the email contents
100
- data = imap.uid_fetch(message_id, "RFC822")
101
- data.each do |d|
102
- msg = d.attr['RFC822']
103
- # instantiate a Mail object to avoid further IMAP parameters nightmares
104
- mail = Mail.read_from_string msg
105
-
106
- # call the block with mail object as param
107
- process_email_block.call mail, i, i == message_ids.length-1, message_id
108
-
109
- # mark as read
110
- if @mark_as_read
111
- imap.store(message_id, "+FLAGS", [:Seen])
99
+ begin
100
+ # fetch all the email contents
101
+ data = imap.uid_fetch(message_id, "RFC822")
102
+ data.each do |d|
103
+ msg = d.attr['RFC822']
104
+ # instantiate a Mail object to avoid further IMAP parameters nightmares
105
+ mail = Mail.read_from_string msg
106
+
107
+ # call the block with mail object as param
108
+ process_email_block.call mail, i, i == message_ids.length-1, message_id
109
+
110
+ # mark as read
111
+ if @mark_as_read
112
+ imap.store(message_id, "+FLAGS", [:Seen])
113
+ end
112
114
  end
115
+ rescue => e
116
+ logger.info "Issue processing email for uuid ##{message_id}, #{e.message}"
113
117
  end
114
118
  end
115
119
  end
@@ -10,7 +10,7 @@ module NaviClient
10
10
  include Client
11
11
  CONFIG_PATH = File.join(ENV['HOME'], '/.navi/config.yml')
12
12
 
13
- def initialize(sso_web_url = 'http://localhost:3008', client_type = "local", gen_csv_url = "http://localhost:3020/v2/generate_csv_input")
13
+ def initialize(sso_web_url = 'http://localhost:3008', client_type = "local", gen_csv_url = "http://localhost:3020/v2/generate_csv_input", debug = true)
14
14
  # flag to print Ruby library debug info (very detailed)
15
15
  @net_imap_debug = false
16
16
 
@@ -18,7 +18,7 @@ module NaviClient
18
18
  @mark_as_read = false
19
19
 
20
20
  # flag to turn on/off debug mode.
21
- @debug = false
21
+ @debug = debug
22
22
 
23
23
  # override the log file
24
24
  mkdir_if_not_exist(config['client_log_file'])
@@ -1,3 +1,3 @@
1
1
  module NaviClient
2
- VERSION = "1.3.7"
2
+ VERSION = "1.3.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: navi_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sujit
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2018-03-29 00:00:00.000000000 Z
13
+ date: 2018-03-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler