mumukit-bridge 3.4.0 → 3.5.0

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: 66e391fb5883afa7b44cb2e07d6c0644e4c8198d8cd3e5bdc068a92d3307043f
4
- data.tar.gz: 1775fb4be32c64884d40077bc906bf7c476cf71eb538d6d836a1e8e47e151de2
3
+ metadata.gz: 9f05e53379537fddc6c7a1f8466c93d0cc620eb3f480f1f3611dc99588d65b96
4
+ data.tar.gz: f999445f1581e5d8767897c1692bc2e3c601c214e262a72f37fc1ac7d858a358
5
5
  SHA512:
6
- metadata.gz: 1166b80ae722c1f3743cb664a661d78be036402540c8f8e91926a0fba163771ff773f9d7ab9fc10fa37f20597625047542f83df59e69d09f88326f00ddddefd9
7
- data.tar.gz: 7b9480e4ba382b767a9867fa82f04babff100e0f00cf5cca4e1ad7435292a6e609105d9c39fddbc33e60ee4ebc6858cdf3e70e42be9c7fcbeba1d7b10eef9664
6
+ metadata.gz: d05d145fbf1e48ad34f816f150e9e5f00250e67750e5b470a41f96eca6453c3f397df53a53728071557dc16b5bf4ad7e1b32c7bfe46e54cd5e5a9e232b458022
7
+ data.tar.gz: 204bb4441d6fe5935e6aec79153aa5b89b9385974970352b2b840b42869d2de975996b3620925e90fd1cf2e32ba7e29b0f114ade6deb6199e350a595fdf925e5
@@ -50,34 +50,36 @@ module Mumukit
50
50
  def importable_info
51
51
  @language_json ||= info.merge('url' => test_runner_url)
52
52
  {
53
- name: @language_json['name'],
54
- comment_type: @language_json['comment_type'],
55
- test_runner_url: @language_json['url'],
56
- output_content_type: @language_json['output_content_type'],
53
+ name: @language_json['name'],
54
+ comment_type: @language_json['comment_type'],
55
+ test_runner_url: @language_json['url'],
56
+ output_content_type: @language_json['output_content_type'],
57
57
  prompt: (@language_json.dig('language', 'prompt') || 'ム') + ' ',
58
58
  extension: @language_json.dig('language', 'extension'),
59
59
  highlight_mode: @language_json.dig('language', 'ace_mode'),
60
60
  visible_success_output: @language_json.dig('language', 'graphic').present?,
61
61
  devicon: @language_json.dig('language', 'icon', 'name'),
62
- triable: @language_json.dig('features', 'try').present?,
63
- feedback: @language_json.dig('features', 'feedback').present?,
64
- queriable: @language_json.dig('features', 'query').present?,
65
- stateful_console: @language_json.dig('features', 'stateful').present?,
66
- test_extension: @language_json.dig('test_framework', 'test_extension'),
67
- test_template: @language_json.dig('test_framework', 'template'),
68
- layout_js_urls: get_assets_for(:layout, 'js'),
69
- layout_html_urls: get_assets_for(:layout, 'html'),
70
- layout_css_urls: get_assets_for(:layout, 'css'),
71
- editor_js_urls: get_assets_for(:editor, 'js'),
72
- editor_html_urls: get_assets_for(:editor, 'html'),
73
- editor_css_urls: get_assets_for(:editor, 'css')
62
+ triable: @language_json.dig('features', 'try').present?,
63
+ feedback: @language_json.dig('features', 'feedback').present?,
64
+ queriable: @language_json.dig('features', 'query').present?,
65
+ stateful_console: @language_json.dig('features', 'stateful').present?,
66
+ test_extension: @language_json.dig('test_framework', 'test_extension'),
67
+ test_template: @language_json.dig('test_framework', 'template'),
68
+ layout_js_urls: get_assets_for(:layout, 'js'),
69
+ layout_html_urls: get_assets_for(:layout, 'html'),
70
+ layout_css_urls: get_assets_for(:layout, 'css'),
71
+ editor_js_urls: get_assets_for(:editor, 'js'),
72
+ editor_html_urls: get_assets_for(:editor, 'html'),
73
+ editor_css_urls: get_assets_for(:editor, 'css')
74
74
  }
75
75
  end
76
76
 
77
- def info
78
- JSON.parse RestClient.get(
79
- "#{test_runner_url}/info",
80
- content_type: :json)
77
+ def assets(path, options={})
78
+ raw_get_to_server "assets/#{path}", options
79
+ end
80
+
81
+ def info(options={})
82
+ JSON.parse raw_get_to_server(:info, options.merge(content_type: :json))
81
83
  end
82
84
 
83
85
  def with_sever_response(request, route, &action)
@@ -87,6 +89,10 @@ module Mumukit
87
89
  {result: e.message, status: :errored}
88
90
  end
89
91
 
92
+ def raw_get_to_server(route, options)
93
+ RestClient.get("#{test_runner_url}/#{route}", options)
94
+ end
95
+
90
96
  def post_to_server(request, route)
91
97
  JSON.parse RestClient::Request.new(
92
98
  method: :post,
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Bridge
3
- VERSION = '3.4.0'
3
+ VERSION = '3.5.0'
4
4
  end
5
5
  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: 3.4.0
4
+ version: 3.5.0
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: 2018-01-18 00:00:00.000000000 Z
11
+ date: 2018-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler