sentra 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sentra/version.rb +1 -1
- data/lib/sentra.rb +7 -2
- data/sentra.gemspec +1 -1
- data/tools/multithread_check.rb +5 -5
- data/tools/{remote_check.rb → singlethread_check.rb} +4 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 273e51bf4c313d06f8308d539fcf8fcb9a4e51c7
|
4
|
+
data.tar.gz: 8a2a44dc92649ae9a5cbbb1c7cc0e1caa21f468b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 746e94f142565b264eb66065c28db7dc8cee30dca9a9ef628dced2d2dc5d7443fa2968bc2b27d2eb821c63a07a2a29675c2e01e6e075ffa78bde04057c5cbbd4
|
7
|
+
data.tar.gz: 2bbbd9cff1f7b1659329e0c89ff3c7b795497ffe06cbd34de6cafd1b1cd2c7653cdef56250d9ae7cafc27e0c86aa412947c3a24e64f6d6e58238846f83835684
|
data/lib/sentra/version.rb
CHANGED
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'],
|
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'],
|
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."
|
data/tools/multithread_check.rb
CHANGED
@@ -8,7 +8,7 @@ require 'sentra/rest_client'
|
|
8
8
|
require "sentra/sents"
|
9
9
|
|
10
10
|
|
11
|
-
num_threads =
|
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 '
|
27
|
+
puts 'STARTED THREAD NUMBER: ' + @id.to_s
|
28
28
|
q = {}
|
29
29
|
q['content'] = @contents[@id]
|
30
|
-
puts "
|
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 "
|
37
|
-
|
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://
|
8
|
+
url = "http://localhost:4567/sentra/analyzer/atomic?key=QD3F7Yr2u098RfaB"
|
10
9
|
response = RestClient2.post(url, q.to_json)
|
11
|
-
|
10
|
+
|
12
11
|
json = JSON.parse(response.body)
|
13
|
-
|
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
|
+
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/
|
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
|
- - '>='
|