navi_client 1.3.7 → 1.3.8
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.
- checksums.yaml +4 -4
- data/lib/client.rb +17 -13
- data/lib/local/navi_local_client.rb +2 -2
- data/lib/navi_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ed77b0572dbd2f2b752cf59de9d5ddb24681efd4363abf6969aefc6e2dff391
|
4
|
+
data.tar.gz: 0677d7a8a9810b437973d38fe4eb8f2b55e87e508fba87adcd409dc5fb1df84f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
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 =
|
21
|
+
@debug = debug
|
22
22
|
|
23
23
|
# override the log file
|
24
24
|
mkdir_if_not_exist(config['client_log_file'])
|
data/lib/navi_client/version.rb
CHANGED
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.
|
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-
|
13
|
+
date: 2018-03-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|