sentra 0.1.9 → 0.2.1
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/sentra/sents.rb +1 -1
- data/lib/sentra/version.rb +1 -1
- data/lib/sentra.rb +1 -9
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c193f60f03deb274a90ec981273219fdc163dd1
|
|
4
|
+
data.tar.gz: f339043744f90bda9610f2352f30edb96003ec34
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 98e897c0e10ec07563fca736e742e66c3355e0064eff1c992babc639dc28a0953c1b17a0dead795b42734d2f436d15accdc0a8930d90306db7791a1abd0f5ceb
|
|
7
|
+
data.tar.gz: 2095052828d840c40ef4b9edaa88ec504f229a58dfe9e90f475f383213c8d15337579437240eca2f4d8f2414802e1ba5f14069b8ac3d72088bac40f95e9a9373
|
data/lib/sentra/sents.rb
CHANGED
data/lib/sentra/version.rb
CHANGED
data/lib/sentra.rb
CHANGED
|
@@ -35,14 +35,11 @@ module Sentra
|
|
|
35
35
|
begin
|
|
36
36
|
query = JSON.parse(query)
|
|
37
37
|
rescue Exception => e
|
|
38
|
-
puts
|
|
39
|
-
p query
|
|
40
|
-
p e.message
|
|
38
|
+
puts e.message
|
|
41
39
|
query = {}
|
|
42
40
|
query['content'] = nil
|
|
43
41
|
end
|
|
44
42
|
if params['key'] and params['key'] =="QD3F7Yr2u098RfaB" and query['content']
|
|
45
|
-
p 'new'
|
|
46
43
|
processing_client = Sentra::ProcessingClient.new
|
|
47
44
|
processing_client.prepare_article query['content'],
|
|
48
45
|
"http://" +SecureRandom.urlsafe_base64 + ".com/" + SecureRandom.urlsafe_base64,
|
|
@@ -52,7 +49,6 @@ module Sentra
|
|
|
52
49
|
processing_client.process_result(response).to_json
|
|
53
50
|
rescue Exception => e
|
|
54
51
|
puts e.message
|
|
55
|
-
p response
|
|
56
52
|
response = {'error' => e.message}
|
|
57
53
|
response.to_json
|
|
58
54
|
end
|
|
@@ -71,8 +67,6 @@ module Sentra
|
|
|
71
67
|
query = JSON.parse(query)
|
|
72
68
|
rescue Exception => e
|
|
73
69
|
puts 'Error with JSON'
|
|
74
|
-
p query
|
|
75
|
-
p e.message
|
|
76
70
|
query = nil
|
|
77
71
|
end
|
|
78
72
|
if params['key'] and params['key'] =="QD3F7Yr2u098RfaB" and query
|
|
@@ -93,8 +87,6 @@ module Sentra
|
|
|
93
87
|
responses.to_json
|
|
94
88
|
rescue Exception => e
|
|
95
89
|
puts 'Errors with converting result to json'
|
|
96
|
-
p responses
|
|
97
|
-
p e.message
|
|
98
90
|
end
|
|
99
91
|
elsif params['key'] and params['key'] =="QD3F7Yr2u098RfaB" and not query and not query['content']
|
|
100
92
|
return "There is no text to process"
|