mumuki-wollok-runner 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +5 -13
  2. data/lib/metadata_hook.rb +1 -1
  3. data/lib/query_hook.rb +18 -17
  4. metadata +20 -20
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjU1MjZiMWU4Y2Q1MjliYjJlOTZlY2NlNzRhOTI1M2MwZWZhZmQzYw==
5
- data.tar.gz: !binary |-
6
- MDVhNTA3ZGU3NDExN2M5Y2FiOTI2NTU3M2E2OWM1ZTc0NzA5Yzc0ZQ==
2
+ SHA1:
3
+ metadata.gz: 5a6733a861de3e4199272d1a810e672ced8c108c
4
+ data.tar.gz: d429672cba3031121de0b701014061f14c2763cd
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- Y2E4ZTQ4MGU5OGMzMjM0YWI3ODNhYWUyNjEyOWYwYTk4MzZjM2JiOTNkZjdi
10
- NzgyNTE2YzlhNWZkNTcyNjJkOTE2YzFhYTYyMGIyMzYwZTJjZTg2OWJmM2Nl
11
- NWQ5NTYxNzc5Y2U4YzRlNGU3MWU3Yzc0ZDVlNjNhNTdhMTVkMzA=
12
- data.tar.gz: !binary |-
13
- NmUzMWJlZTBlMTBmNTliZDVkMDg0NDU2MTU3NTQ0Y2YxYjk0Y2M2NTM4OGUw
14
- ZGI4ODY2MTc1YWQ3MDdiNzUwMTI4NmNlNjMyM2YxNTVhMDg4YTFjOTk0YzE3
15
- NzE3Zjk1MDkyMTMzYWU0NGZkOGIxM2VlZWRlYWI3NTE5MDE5YzM=
6
+ metadata.gz: 8ef79d3770440429fea57064f8a97b4ff5896f8802442d86a45ac64a17a067ede11d345e8eaa658b2ba2dd96aa2bb0a41b89d828eb2cd0785620e89ef7eb9f72
7
+ data.tar.gz: dd1e4ecad360961ed212d578d5544ab08af17f672e1b260da6d2583765449ffcdd7f3c685579f0b6b5551443db542b8414b8d0493a1f72f210669692736fe101
data/lib/metadata_hook.rb CHANGED
@@ -2,7 +2,7 @@ class WollokMetadataHook < Mumukit::Hook
2
2
  def metadata
3
3
  {language: {
4
4
  name: 'wollok',
5
- icon: {type: 'devicon', name: 'code'},
5
+ icon: {type: 'devicon', name: 'wollok'},
6
6
  version: '1.5',
7
7
  extension: 'wlk',
8
8
  ace_mode: 'wollok'
data/lib/query_hook.rb CHANGED
@@ -1,11 +1,25 @@
1
1
  require 'rest-client'
2
2
 
3
+ class WollokCookie < Mumukit::Cookie
4
+ private
5
+
6
+ def statements_code
7
+ statements.map { |statement| "try { #{statement} } catch e : Exception { }" }.join("\n")
8
+ end
9
+
10
+ def stdout_separator_code
11
+ "console.println(\"#{stdout_separator}\")"
12
+ end
13
+ end
14
+
3
15
  class WollokQueryHook < WollokHook
16
+ stateful_through WollokCookie
17
+
4
18
  def transform_response(response)
5
19
  if errored? response
6
20
  [extract_compilation_errors(response), :errored]
7
21
  elsif response['consoleOutput'].present?
8
- [response['consoleOutput'], :passed]
22
+ [trim_cookie_output(response['consoleOutput']), :passed]
9
23
  elsif response['runtimeError'].present?
10
24
  [response['runtimeError']['message'], :failed]
11
25
  else
@@ -31,23 +45,13 @@ object mumukiPrettyPrinter {
31
45
  }
32
46
 
33
47
  object mumukiConsole {
34
- var inCookie = false
35
-
36
- method enterCookie() { inCookie = true }
37
- method exitCookie() { inCookie = false }
38
-
39
48
  method println(anObject) {
40
- if (!inCookie) {
41
- console.println(anObject)
42
- }
49
+ console.println(anObject)
43
50
  }
44
51
  }
45
52
 
46
53
  program mumuki {
47
- mumukiConsole.enterCookie()
48
- #{build_state(r.cookie)}
49
- mumukiConsole.exitCookie()
50
-
54
+ #{build_cookie_code(r)}
51
55
  #{
52
56
  if %w(var const).any? { |it| r.query.strip.start_with? it }
53
57
  "#{r.query}\nmumukiPrettyPrinter.prettyPrint(void)"
@@ -59,7 +63,4 @@ program mumuki {
59
63
  WLK
60
64
  end
61
65
 
62
- def build_state(cookie)
63
- (cookie||[]).map { |statement| "try { #{statement} } catch e : Exception { }" }.join("\n")
64
- end
65
- end
66
+ end
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-wollok-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
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-10-13 00:00:00.000000000 Z
11
+ date: 2017-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.6'
19
+ version: '2.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.6'
26
+ version: '2.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rest-client
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.7'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '10.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '3.4'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '3.4'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: codeclimate-test-reporter
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: mumukit-bridge
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.3'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.3'
111
111
  description:
@@ -130,12 +130,12 @@ require_paths:
130
130
  - lib
131
131
  required_ruby_version: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - ! '>='
133
+ - - ">="
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - ! '>='
138
+ - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []