mumukit-bridge 1.1.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/mumukit/bridge.rb +2 -1
- data/lib/mumukit/bridge/runner.rb +16 -6
- data/lib/mumukit/bridge/thesaurus.rb +6 -9
- data/lib/mumukit/bridge/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjcxMjNjOWI0MGQ4OTJkYjUxNDc4OGY3YTNiYWY4YzA3YmExMmNkNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGIyZDJlMWZiODM0NDgyZmJiYWNkYTc0ZDQ1OGM5MWEyM2JlNDhmMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDg2YTQyNjllZDRkMzdmMGI4NTU5YTAyNmJhZGMzYjA2NGE1ZjZjNzMzMDIx
|
10
|
+
YWU1MmU3ZGYwZTQ5NWEzYzRhNjRmYTZjMjVhNzc4YTZiNjg3NjVhM2Q1Yzhl
|
11
|
+
ZmNjYmI2OWUxYzEyYTcxZjYwODhlYWY0YmY2ZmYxOGI1MjdlYzk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmQ4NGZlMWU5Yjk2ZjQ1OWQxMDQ0ZGVhOTlkNDE1MWI5ODFmYzIyMmMzZDQz
|
14
|
+
YzJmNGQ1Yjk5NzdiODlhODliM2M5MDMzMzJlZGMwOGJlNjI5MzYxMmRiNzJj
|
15
|
+
MWU5ZTkzYzNmMjUyMzc0MWQwMjFmMjRmYjJiYWRlZjNlODgwZWM=
|
data/lib/mumukit/bridge.rb
CHANGED
@@ -28,11 +28,17 @@ module Mumukit
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def run_query!(request)
|
31
|
-
with_sever_response request, 'query' do |
|
31
|
+
with_sever_response request, 'query' do |it|
|
32
32
|
{status: it['exit'].to_sym, result: it['out']}
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
def info
|
37
|
+
JSON.parse RestClient.get(
|
38
|
+
"#{test_runner_url}/info",
|
39
|
+
content_type: :json)
|
40
|
+
end
|
41
|
+
|
36
42
|
def with_sever_response(request, route, &action)
|
37
43
|
response = post_to_server(request, route)
|
38
44
|
action.call(response)
|
@@ -40,12 +46,16 @@ module Mumukit
|
|
40
46
|
{result: e.message, status: :errored}
|
41
47
|
end
|
42
48
|
|
43
|
-
def post_to_server(request, route)
|
44
|
-
JSON.parse RestClient.
|
45
|
-
|
46
|
-
|
47
|
-
|
49
|
+
def post_to_server(request, route, timeout=10)
|
50
|
+
JSON.parse RestClient::Request.new(
|
51
|
+
method: :post,
|
52
|
+
url: "#{test_runner_url}/#{route}",
|
53
|
+
payload: request.to_json,
|
54
|
+
timeout: timeout,
|
55
|
+
open_timeout: timeout,
|
56
|
+
headers: {content_type: :json}).execute()
|
48
57
|
end
|
58
|
+
|
49
59
|
end
|
50
60
|
end
|
51
61
|
end
|
@@ -3,21 +3,18 @@ module Mumukit
|
|
3
3
|
class Thesaurus
|
4
4
|
attr_accessor :url
|
5
5
|
|
6
|
-
def initialize(url = 'http://
|
6
|
+
def initialize(url = 'http://thesaurus.mumuki.io')
|
7
7
|
@url = url
|
8
|
-
@language = {}
|
9
8
|
end
|
10
9
|
|
11
|
-
def
|
12
|
-
@
|
10
|
+
def runners
|
11
|
+
@runners ||= JSON.parse(get('runners'))['runners']
|
13
12
|
end
|
14
13
|
|
15
|
-
|
16
|
-
@language[name] ||= get "languages/#{name}"
|
17
|
-
end
|
14
|
+
private
|
18
15
|
|
19
|
-
def get(
|
20
|
-
|
16
|
+
def get(resource)
|
17
|
+
RestClient.get("#{url}/#{resource}")
|
21
18
|
end
|
22
19
|
end
|
23
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-bridge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -67,19 +67,19 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: mumukit-core
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '0.1'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '0.1'
|
83
83
|
description:
|
84
84
|
email:
|
85
85
|
- flbulgarelli@yahoo.com.ar
|