navi_client 1.3.3 → 1.3.4

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: b7810ed026c2d49433d2b0e25ac0fcd49cd2c15823bd44b2308d18c44d462f02
4
- data.tar.gz: d24ddc1054dbdfc6c8c20ed2a458c9b2240a216caf5f9c775a8ec2d4adbede40
3
+ metadata.gz: 35a451ff83ce2920c09bcdafee34f8e4d22f9d11a44bc4bec4989954ff4ba56f
4
+ data.tar.gz: 3190e61415272e72b9a8cd0a093346689d090b31065de1d76f1ee32eae897ed3
5
5
  SHA512:
6
- metadata.gz: ad4631fd864a936100708cdd5b66c25416ba0d47e6b7ffb65ffcdc0c4767038854820aa0369e7608df5483f22e6976e19c00b4e87b76f0b1b95c4431d322cd13
7
- data.tar.gz: 96c3c79eced0d78cf52ed03585f4ee3478ee1938fbeabadeca1533577c6958b8394e7e5ce0929b04941f93fc8545f4cf05044986362f78469a7204603820d461
6
+ metadata.gz: 7019517eeb16bcf04bbe60603021fd8d47a16a871e9989c68b835e7e1d170318ed971ef8cbe5628ba29afc474ffa0cd2c822da17449b2a678c880640ab5e1d0b
7
+ data.tar.gz: f2db4f8ab1f38fdc531a0b34e2729d34621485545cb2afbf889904a8e81ae8867d79779faf027be8f36734cfa638eae4a716cef316447d9279d34c020cd1cd39
data/lib/client.rb CHANGED
@@ -80,8 +80,8 @@ module Client
80
80
 
81
81
  message_ids = imap.uid_search(search_condition)
82
82
 
83
- meta_dir = @download_path + config['username'] + '/meta/'
84
- message_ids_saved = File.directory?(meta_dir) || @client_type == "cloud" ? (Dir.entries meta_dir).map { |i| i.split("_").first.to_i } : []
83
+ meta_dir = @download_path + 'meta/'
84
+ message_ids_saved = File.directory?(meta_dir) ? (Dir.entries meta_dir).map { |i| i.split("_").first.to_i } : []
85
85
 
86
86
  message_ids = message_ids - message_ids_saved
87
87
 
@@ -58,6 +58,7 @@ module NaviClient
58
58
 
59
59
  def set_current_user_email(email)
60
60
  @current_user_email = email
61
+ @download_path = config[:s3_download_folder] + '/' + email + "/"
61
62
  end
62
63
 
63
64
  ##
@@ -69,7 +70,7 @@ module NaviClient
69
70
  filepath = download_path + "/inputs/" + (Time.now.to_f * 1000).to_s
70
71
  filename = upload_to_s3(filepath, in_filenames.join("\n"))
71
72
 
72
- HTTPService::NaviAI.start(filepath: filename, client_id: @id, client_type: @client_type, token: @token)
73
+ HTTPService::NaviAI.start(filepath: filename, client_id: @id, client_type: @client_type, token: @token, email: @current_user_email)
73
74
  end
74
75
  end
75
76
 
@@ -3,12 +3,12 @@ require "httparty"
3
3
  module HTTPService
4
4
  class NaviAI
5
5
 
6
- def self.start(filepath:, client_id: nil, client_type:, token:)
6
+ def self.start(filepath:, client_id: nil, client_type:, token:, email:)
7
7
  go_url = 'http://localhost:9090/v2/metas'
8
8
  if client_type == 'cloud'
9
9
  go_url = 'http://34.214.134.104:9090/v2/metas'
10
10
  end
11
- HTTParty.post(go_url, body: { client_id: client_id, client_type: client_type, list_meta_path: filepath, token: token }.to_json)
11
+ HTTParty.post(go_url, body: { client_id: client_id, client_type: client_type, list_meta_path: filepath, token: token, email: email }.to_json)
12
12
  end
13
13
 
14
14
  def self.generate_csv(email)
@@ -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')
13
+ def initialize(sso_web_url = 'http://localhost:3008', client_type = "local")
14
14
  # flag to print Ruby library debug info (very detailed)
15
15
  @net_imap_debug = false
16
16
 
@@ -29,10 +29,10 @@ module NaviClient
29
29
  # authentication token received from sso_web used to authenticate the request to database_api
30
30
  @token = nil
31
31
 
32
- @download_path = config['download_path']
32
+ @download_path = config['download_path'] + config['username'] + '/'
33
33
 
34
34
  # client_type
35
- @client_type = "local"
35
+ @client_type = client_type
36
36
  end
37
37
 
38
38
  #
@@ -100,7 +100,7 @@ module NaviClient
100
100
  in_filenames.each { |element| f.puts(element) }
101
101
  end
102
102
 
103
- HTTPService::NaviAI.start(filepath: filename, client_type: @client_type, token: @token)
103
+ HTTPService::NaviAI.start(filepath: filename, client_type: @client_type, token: @token, email: config['username'])
104
104
  end
105
105
  end
106
106
 
@@ -1,3 +1,3 @@
1
1
  module NaviClient
2
- VERSION = "1.3.3"
2
+ VERSION = "1.3.4"
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.3
4
+ version: 1.3.4
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-06 00:00:00.000000000 Z
13
+ date: 2018-03-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler