sentra 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03bd62dfaa1b99334cb24f70268ff008e7b75105
4
- data.tar.gz: 0151facbc528f27196a4e53242c81838a8382696
3
+ metadata.gz: 273e51bf4c313d06f8308d539fcf8fcb9a4e51c7
4
+ data.tar.gz: 8a2a44dc92649ae9a5cbbb1c7cc0e1caa21f468b
5
5
  SHA512:
6
- metadata.gz: c51381d084bcc6909964d37e6d3f755a3c438699f75c4bbbd0887f46b771daf41f093a8fff5c14414e05293d8713dee1e15df192d05d9f12247e335efaa92ef8
7
- data.tar.gz: 67db4c28ceb97d91e3a20dd4d2b7c0753292df306cf8f2a827d9ef6a36d8a018ec11c507dcc3fa6dffbbb128363ab16f97d155cdd83adbd046c4757858ce2e99
6
+ metadata.gz: 746e94f142565b264eb66065c28db7dc8cee30dca9a9ef628dced2d2dc5d7443fa2968bc2b27d2eb821c63a07a2a29675c2e01e6e075ffa78bde04057c5cbbd4
7
+ data.tar.gz: 2bbbd9cff1f7b1659329e0c89ff3c7b795497ffe06cbd34de6cafd1b1cd2c7653cdef56250d9ae7cafc27e0c86aa412947c3a24e64f6d6e58238846f83835684
@@ -1,3 +1,3 @@
1
1
  module Sentra
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
data/lib/sentra.rb CHANGED
@@ -6,6 +6,7 @@ require 'json'
6
6
  require 'sentra/opr'
7
7
  require 'sentra/rest_client'
8
8
  require "sentra/sents"
9
+ require 'securerandom'
9
10
 
10
11
 
11
12
  module Sentra
@@ -34,7 +35,9 @@ module Sentra
34
35
  if params['key'] and params['key'] =="QD3F7Yr2u098RfaB" and query['content']
35
36
  p 'new'
36
37
  processing_client = Sentra::ProcessingClient.new
37
- processing_client.prepare_article query['content'], "http://zoral.com.ua", "Test1"
38
+ processing_client.prepare_article query['content'],
39
+ "http://" +SecureRandom.urlsafe_base64 + ".com/" + SecureRandom.urlsafe_base64,
40
+ "Test1"
38
41
  response = processing_client.send
39
42
  processing_client.process_result(response).to_json
40
43
 
@@ -53,7 +56,9 @@ module Sentra
53
56
  responses = []
54
57
  processing_client = Sentra::ProcessingClient.new
55
58
  query['tweets'].each_with_index do |tweet, index|
56
- processing_client.prepare_article tweet['content'], "http://zoral.com.ua/" + index.to_s, "Test" + index.to_s
59
+ processing_client.prepare_article tweet['content'],
60
+ "http://" + SecureRandom.urlsafe_base64 + ".com/" + SecureRandom.urlsafe_base64,
61
+ "Test" + index.to_s
57
62
  response = processing_client.send
58
63
  responses.push(processing_client.process_result(response))
59
64
  end
data/sentra.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
18
  spec.bindir = "exe"
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
- spec.require_paths = ["lib"]
20
+ spec.require_paths = ["lib","tools"]
21
21
 
22
22
  if spec.respond_to?(:metadata)
23
23
  spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
@@ -8,7 +8,7 @@ require 'sentra/rest_client'
8
8
  require "sentra/sents"
9
9
 
10
10
 
11
- num_threads = 2
11
+ num_threads = 4
12
12
  host = '5.9.118.83'
13
13
  namespace = 'consolidation'
14
14
 
@@ -24,17 +24,17 @@ class CheckLoad
24
24
  @contents = contents
25
25
  end
26
26
  def call
27
- puts 'Started Thread Number' + @id.to_s
27
+ puts 'STARTED THREAD NUMBER: ' + @id.to_s
28
28
  q = {}
29
29
  q['content'] = @contents[@id]
30
- puts "Ready to send content = " + q['content']
30
+ puts "QUERY TO SEND: '" + q['content'] + "'"
31
31
 
32
32
  url = "http://localhost:4567/sentra/analyzer/atomic?key=QD3F7Yr2u098RfaB"
33
33
  response = RestClient2.post(url, q.to_json)
34
34
 
35
35
  json = JSON.parse(response.body)
36
- puts "Received response by Thread Number " + @id.to_s
37
- p json
36
+ puts "RECEIVED RESPONSE FROM THREAD: " + @id.to_s + " FOR CONTENT '" + q['content'] + "' RESULT: " +
37
+ json.to_s
38
38
  end
39
39
  end
40
40
 
@@ -1,13 +1,12 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
- #require 'sentra'
3
2
  require 'sentra/rest_client'
4
3
 
5
4
  q = {}
6
5
  q['content'] = 'It goes down the drain. The service was good, but coffee was bad. Sony Inc is a good company. Even though it was on New Years day, Tim and his two crew members had no problem and were happy to have us. It is a cat.'
7
- puts q['content']
6
+ puts "QUERY TO SEND: '" + q['content'] + "'"
8
7
 
9
- url = "http://10.1.2.230:4560/sentra/analyzer/atomic"
8
+ url = "http://localhost:4567/sentra/analyzer/atomic?key=QD3F7Yr2u098RfaB"
10
9
  response = RestClient2.post(url, q.to_json)
11
- p response
10
+
12
11
  json = JSON.parse(response.body)
13
- p json
12
+ puts "RECEIVED RESPONSE: " + json.to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - kshakirov
@@ -147,7 +147,7 @@ files:
147
147
  - lib/sentra/version.rb
148
148
  - sentra.gemspec
149
149
  - tools/multithread_check.rb
150
- - tools/remote_check.rb
150
+ - tools/singlethread_check.rb
151
151
  homepage: https://rubygems.org
152
152
  licenses:
153
153
  - MIT
@@ -158,6 +158,7 @@ post_install_message:
158
158
  rdoc_options: []
159
159
  require_paths:
160
160
  - lib
161
+ - tools
161
162
  required_ruby_version: !ruby/object:Gem::Requirement
162
163
  requirements:
163
164
  - - '>='