mumukit 0.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/limit +10 -0
- data/bin/mulang +0 -0
- data/lib/locales/en.yml +4 -0
- data/lib/locales/es.yml +4 -0
- data/lib/mumukit/defaults/default_expectations_hook.rb +9 -0
- data/lib/mumukit/defaults/default_feedback_hook.rb +5 -0
- data/lib/mumukit/defaults/default_metadata_hook.rb +5 -0
- data/lib/mumukit/defaults/default_query_hook.rb +9 -0
- data/lib/mumukit/defaults/default_test_hook.rb +9 -0
- data/lib/mumukit/defaults/default_validation_hook.rb +4 -0
- data/lib/mumukit/defaults.rb +11 -0
- data/lib/mumukit/env.rb +11 -0
- data/lib/mumukit/hook.rb +30 -0
- data/lib/mumukit/isolated_environment.rb +51 -0
- data/lib/mumukit/metatest/checker.rb +34 -0
- data/lib/mumukit/metatest/errors.rb +10 -0
- data/lib/mumukit/metatest/framework.rb +20 -0
- data/lib/mumukit/metatest/identity_runner.rb +7 -0
- data/lib/mumukit/metatest.rb +7 -0
- data/lib/mumukit/request_validation_error.rb +4 -0
- data/lib/mumukit/runner.rb +33 -0
- data/lib/mumukit/runtime/info.rb +30 -0
- data/lib/mumukit/runtime/runtime.rb +35 -0
- data/lib/mumukit/runtime/shortcuts.rb +12 -0
- data/lib/mumukit/runtime/symbol.rb +17 -0
- data/lib/mumukit/runtime.rb +4 -0
- data/lib/mumukit/server/app.rb +71 -0
- data/lib/mumukit/server/response_builder.rb +62 -0
- data/lib/mumukit/server/test_server.rb +118 -0
- data/lib/mumukit/server.rb +7 -0
- data/lib/mumukit/templates/file_hook.rb +49 -0
- data/lib/mumukit/templates/mulang_expectations_hook.rb +57 -0
- data/lib/mumukit/templates/with_code_smells.rb +7 -0
- data/lib/mumukit/templates/with_embedded_environment.rb +12 -0
- data/lib/mumukit/templates/with_isolated_environment.rb +11 -0
- data/lib/mumukit/templates/with_mashup_file_content.rb +11 -0
- data/lib/mumukit/templates/with_structured_results.rb +15 -0
- data/lib/mumukit/templates.rb +12 -0
- data/lib/mumukit/version.rb +1 -1
- data/lib/mumukit/with_command_line.rb +33 -1
- data/lib/mumukit/with_content_type.rb +5 -0
- data/lib/mumukit/with_tempfile.rb +13 -2
- data/lib/mumukit.rb +62 -8
- metadata +180 -21
- data/lib/mumukit/file_test_compiler.rb +0 -14
- data/lib/mumukit/file_test_runner.rb +0 -20
- data/lib/mumukit/stub.rb +0 -5
- data/lib/mumukit/test_server.rb +0 -42
- data/lib/mumukit/test_server_app.rb +0 -28
- data/lib/stubs/expectations_runner.rb +0 -5
- data/lib/stubs/test_runner.rb +0 -2
@@ -0,0 +1,49 @@
|
|
1
|
+
module Mumukit
|
2
|
+
class Templates::FileHook < Mumukit::Hook
|
3
|
+
include Mumukit::WithTempfile
|
4
|
+
|
5
|
+
def compile(request)
|
6
|
+
write_tempfile! compile_file_content(request)
|
7
|
+
end
|
8
|
+
|
9
|
+
def run!(file)
|
10
|
+
result, status = run_file!(file)
|
11
|
+
post_process_file(file, result.force_encoding('UTF-8'), status)
|
12
|
+
ensure
|
13
|
+
file.unlink
|
14
|
+
end
|
15
|
+
|
16
|
+
def post_process_file(file, result, status)
|
17
|
+
[result, status]
|
18
|
+
end
|
19
|
+
|
20
|
+
required :compile_file_content
|
21
|
+
required :command_line
|
22
|
+
|
23
|
+
required :run_file!, 'Wrong configuration. You must include an environment mixin'
|
24
|
+
|
25
|
+
def self.structured(value=true)
|
26
|
+
if value
|
27
|
+
include Mumukit::Templates::WithStructuredResults
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.isolated(value=true)
|
32
|
+
if value
|
33
|
+
include Mumukit::Templates::WithIsolatedEnvironment
|
34
|
+
else
|
35
|
+
include Mumukit::Templates::WithEmbeddedEnvironment
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.mashup(*args)
|
40
|
+
include Mumukit::Templates::WithMashupFileContent
|
41
|
+
|
42
|
+
args = args.present? ? args : [:extra, :content, :test]
|
43
|
+
|
44
|
+
if args
|
45
|
+
define_method(:mashup_fields) { args }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module Mumukit
|
2
|
+
class Templates::MulangExpectationsHook < Mumukit::Templates::FileHook
|
3
|
+
isolated false
|
4
|
+
|
5
|
+
required :language, 'You have to provide a Mulang-compatible language in order to use this hook'
|
6
|
+
|
7
|
+
def tempfile_extension
|
8
|
+
'.json'
|
9
|
+
end
|
10
|
+
|
11
|
+
def command_line(filename)
|
12
|
+
"cat #{filename} | #{mulang_path} -s"
|
13
|
+
end
|
14
|
+
|
15
|
+
def post_process_file(file, result, status)
|
16
|
+
parse_response JSON.pretty_parse(result)
|
17
|
+
end
|
18
|
+
|
19
|
+
def compile_file_content(request)
|
20
|
+
compile_json_file_content(request).to_json
|
21
|
+
end
|
22
|
+
|
23
|
+
def compile_json_file_content(request)
|
24
|
+
{
|
25
|
+
expectations: request[:expectations].map { |it| compile_expectation(it.deep_symbolize_keys) },
|
26
|
+
code: {
|
27
|
+
content: compile_content(request[:content]),
|
28
|
+
language: language}
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
def compile_content(content)
|
33
|
+
content
|
34
|
+
end
|
35
|
+
|
36
|
+
def compile_expectation(expectation)
|
37
|
+
(expectation[:verb].present? ? {tag: :Advanced} : {tag: :Basic}).merge(expectation)
|
38
|
+
end
|
39
|
+
|
40
|
+
def parse_response(response)
|
41
|
+
response['results'].map do |it|
|
42
|
+
{result: it['result'],
|
43
|
+
expectation: parse_expectation(it['expectation'])}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def parse_expectation(expectation)
|
48
|
+
expectation.deep_symbolize_keys.except(:tag)
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.include_smells(value=true)
|
52
|
+
if value
|
53
|
+
include Mumukit::Templates::WithCodeSmells
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Mumukit::Templates::WithStructuredResults
|
2
|
+
def post_process_file(file, result, status)
|
3
|
+
if [:passed, :failed].include? status
|
4
|
+
[to_structured_result(result)]
|
5
|
+
else
|
6
|
+
[result, status]
|
7
|
+
end
|
8
|
+
rescue JSON::ParserError
|
9
|
+
[result, :errored]
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_structured_result(result)
|
13
|
+
JSON.pretty_parse(result)
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Mumukit
|
2
|
+
module Templates
|
3
|
+
end
|
4
|
+
end
|
5
|
+
|
6
|
+
require_relative './templates/file_hook'
|
7
|
+
require_relative './templates/with_structured_results'
|
8
|
+
require_relative './templates/with_mashup_file_content'
|
9
|
+
require_relative './templates/with_embedded_environment'
|
10
|
+
require_relative './templates/with_isolated_environment'
|
11
|
+
require_relative './templates/mulang_expectations_hook'
|
12
|
+
require_relative './templates/with_code_smells'
|
data/lib/mumukit/version.rb
CHANGED
@@ -1,7 +1,39 @@
|
|
1
1
|
module Mumukit
|
2
2
|
module WithCommandLine
|
3
|
+
SIGINT = 2
|
4
|
+
SIGSEGV = 11
|
5
|
+
SIGXCPU = 24
|
6
|
+
|
7
|
+
def command_size_limit
|
8
|
+
Mumukit.config.command_size_limit
|
9
|
+
end
|
10
|
+
|
11
|
+
def command_time_limit
|
12
|
+
Mumukit.config.command_time_limit
|
13
|
+
end
|
14
|
+
|
15
|
+
def limit_command
|
16
|
+
Mumukit.config.limit_script
|
17
|
+
end
|
18
|
+
|
3
19
|
def run_command(command)
|
4
|
-
|
20
|
+
out = %x{#{limit_command} #{command_size_limit} #{command_time_limit} $(cat <<EOLIMIT
|
21
|
+
#{command}
|
22
|
+
EOLIMIT
|
23
|
+
)}
|
24
|
+
case $?.exitstatus
|
25
|
+
when 0 then [out, :passed]
|
26
|
+
when signal_status(SIGINT) then [I18n.t('mumukit.memory_exceeded'), :aborted]
|
27
|
+
when signal_status(SIGSEGV) then [I18n.t('mumukit.memory_exceeded'), :aborted]
|
28
|
+
when signal_status(SIGXCPU) then [I18n.t('mumukit.time_exceeded', limit: command_time_limit), :aborted]
|
29
|
+
else [out, :failed]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def signal_status(signal)
|
34
|
+
# see http://tldp.org/LDP/abs/html/exitcodes.html
|
35
|
+
128 + signal
|
5
36
|
end
|
37
|
+
|
6
38
|
end
|
7
39
|
end
|
@@ -3,14 +3,25 @@ require 'tempfile'
|
|
3
3
|
module Mumukit
|
4
4
|
module WithTempfile
|
5
5
|
def create_tempfile
|
6
|
-
Tempfile.new('mumuki.compile')
|
6
|
+
Tempfile.new(['mumuki.compile', tempfile_extension])
|
7
|
+
end
|
8
|
+
|
9
|
+
def tempfile_extension
|
10
|
+
''
|
7
11
|
end
|
8
12
|
|
9
13
|
def write_tempfile!(content)
|
14
|
+
with_tempfile do |file|
|
15
|
+
file.write(content)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def with_tempfile
|
10
20
|
file = create_tempfile
|
11
|
-
file
|
21
|
+
yield file
|
12
22
|
file.close
|
13
23
|
file
|
14
24
|
end
|
25
|
+
|
15
26
|
end
|
16
27
|
end
|
data/lib/mumukit.rb
CHANGED
@@ -1,14 +1,68 @@
|
|
1
|
+
require 'i18n'
|
2
|
+
require 'i18n/backend/fallbacks'
|
3
|
+
require 'mumukit/core'
|
4
|
+
require 'mumukit/directives'
|
5
|
+
require 'ostruct'
|
6
|
+
|
7
|
+
pwd = File.expand_path(File.dirname(__FILE__))
|
8
|
+
|
9
|
+
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
|
10
|
+
I18n.load_path += Dir[File.join(pwd, 'locales', '*.yml')]
|
11
|
+
|
12
|
+
I18n.backend.load_translations
|
13
|
+
|
1
14
|
module Mumukit
|
15
|
+
def self.current_runner=(runner)
|
16
|
+
@current_runner = runner
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.current_runner
|
20
|
+
raise "no runner selected. Did you forget to set current runner's name?" unless @current_runner
|
21
|
+
@current_runner
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.runner_name=(name)
|
25
|
+
self.current_runner = Mumukit::Runner.new(name)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.runner_name
|
29
|
+
current_runner.name
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.configure_defaults(&block)
|
33
|
+
Mumukit::Runner.configure_defaults(&block)
|
34
|
+
end
|
35
|
+
|
36
|
+
class << self
|
37
|
+
delegate :prefix, :config, :configure, :runtime, :configure_runtime, to: :current_runner
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
require_relative 'mumukit/runner'
|
42
|
+
|
43
|
+
Mumukit.configure_defaults do |config|
|
44
|
+
config.limit_script = File.join(pwd, '..', 'bin', 'limit')
|
45
|
+
config.content_type = :plain
|
46
|
+
config.comment_type = Mumukit::Directives::CommentType::Cpp
|
47
|
+
config.preprocessor_enabled = true
|
48
|
+
config.structured = false
|
49
|
+
config.stateful = false
|
50
|
+
config.command_time_limit = 4
|
51
|
+
config.command_size_limit = 1024
|
2
52
|
end
|
3
53
|
|
54
|
+
require 'mumukit/content_type'
|
55
|
+
|
4
56
|
require_relative 'mumukit/version'
|
5
|
-
require_relative 'mumukit/
|
57
|
+
require_relative 'mumukit/env'
|
6
58
|
require_relative 'mumukit/with_tempfile'
|
59
|
+
require_relative 'mumukit/with_content_type'
|
7
60
|
require_relative 'mumukit/with_command_line'
|
8
|
-
require_relative 'mumukit/
|
9
|
-
require_relative 'mumukit/
|
10
|
-
|
11
|
-
require_relative '
|
12
|
-
|
13
|
-
require_relative 'mumukit/
|
14
|
-
require_relative 'mumukit/
|
61
|
+
require_relative 'mumukit/hook'
|
62
|
+
require_relative 'mumukit/runtime'
|
63
|
+
require_relative 'mumukit/isolated_environment'
|
64
|
+
require_relative 'mumukit/templates'
|
65
|
+
require_relative 'mumukit/request_validation_error'
|
66
|
+
require_relative 'mumukit/defaults'
|
67
|
+
require_relative 'mumukit/metatest'
|
68
|
+
require_relative 'mumukit/server'
|
metadata
CHANGED
@@ -1,71 +1,197 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.4.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:
|
11
|
+
date: 2016-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
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: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '2'
|
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: '2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: codeclimate-test-reporter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: sinatra
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- - ~>
|
73
|
+
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '1.4'
|
62
76
|
type: :runtime
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- - ~>
|
80
|
+
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '1.4'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activesupport
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: i18n
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.7'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.7'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: puma
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: docker-api
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.22.2
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.22.2
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: excon
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.46'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.46'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: mumukit-core
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.1'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.1'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: mumukit-directives
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0.1'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0.1'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: mumukit-content-type
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0.2'
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0.2'
|
69
195
|
description: Helpers for building a Mumuki Test Server
|
70
196
|
email:
|
71
197
|
- flbulgarelli@yahoo.com.ar
|
@@ -73,17 +199,49 @@ executables: []
|
|
73
199
|
extensions: []
|
74
200
|
extra_rdoc_files: []
|
75
201
|
files:
|
76
|
-
-
|
77
|
-
-
|
202
|
+
- bin/limit
|
203
|
+
- bin/mulang
|
204
|
+
- lib/locales/en.yml
|
205
|
+
- lib/locales/es.yml
|
78
206
|
- lib/mumukit.rb
|
207
|
+
- lib/mumukit/defaults.rb
|
208
|
+
- lib/mumukit/defaults/default_expectations_hook.rb
|
209
|
+
- lib/mumukit/defaults/default_feedback_hook.rb
|
210
|
+
- lib/mumukit/defaults/default_metadata_hook.rb
|
211
|
+
- lib/mumukit/defaults/default_query_hook.rb
|
212
|
+
- lib/mumukit/defaults/default_test_hook.rb
|
213
|
+
- lib/mumukit/defaults/default_validation_hook.rb
|
214
|
+
- lib/mumukit/env.rb
|
215
|
+
- lib/mumukit/hook.rb
|
216
|
+
- lib/mumukit/isolated_environment.rb
|
217
|
+
- lib/mumukit/metatest.rb
|
218
|
+
- lib/mumukit/metatest/checker.rb
|
219
|
+
- lib/mumukit/metatest/errors.rb
|
220
|
+
- lib/mumukit/metatest/framework.rb
|
221
|
+
- lib/mumukit/metatest/identity_runner.rb
|
222
|
+
- lib/mumukit/request_validation_error.rb
|
223
|
+
- lib/mumukit/runner.rb
|
224
|
+
- lib/mumukit/runtime.rb
|
225
|
+
- lib/mumukit/runtime/info.rb
|
226
|
+
- lib/mumukit/runtime/runtime.rb
|
227
|
+
- lib/mumukit/runtime/shortcuts.rb
|
228
|
+
- lib/mumukit/runtime/symbol.rb
|
229
|
+
- lib/mumukit/server.rb
|
230
|
+
- lib/mumukit/server/app.rb
|
231
|
+
- lib/mumukit/server/response_builder.rb
|
232
|
+
- lib/mumukit/server/test_server.rb
|
233
|
+
- lib/mumukit/templates.rb
|
234
|
+
- lib/mumukit/templates/file_hook.rb
|
235
|
+
- lib/mumukit/templates/mulang_expectations_hook.rb
|
236
|
+
- lib/mumukit/templates/with_code_smells.rb
|
237
|
+
- lib/mumukit/templates/with_embedded_environment.rb
|
238
|
+
- lib/mumukit/templates/with_isolated_environment.rb
|
239
|
+
- lib/mumukit/templates/with_mashup_file_content.rb
|
240
|
+
- lib/mumukit/templates/with_structured_results.rb
|
241
|
+
- lib/mumukit/version.rb
|
79
242
|
- lib/mumukit/with_command_line.rb
|
243
|
+
- lib/mumukit/with_content_type.rb
|
80
244
|
- lib/mumukit/with_tempfile.rb
|
81
|
-
- lib/mumukit/stub.rb
|
82
|
-
- lib/mumukit/file_test_compiler.rb
|
83
|
-
- lib/mumukit/test_server.rb
|
84
|
-
- lib/mumukit/version.rb
|
85
|
-
- lib/mumukit/file_test_runner.rb
|
86
|
-
- lib/mumukit/test_server_app.rb
|
87
245
|
homepage: https://github.com/flbulgarelli/mumukit
|
88
246
|
licenses:
|
89
247
|
- MIT
|
@@ -92,19 +250,20 @@ post_install_message:
|
|
92
250
|
rdoc_options: []
|
93
251
|
require_paths:
|
94
252
|
- lib
|
253
|
+
- bin
|
95
254
|
required_ruby_version: !ruby/object:Gem::Requirement
|
96
255
|
requirements:
|
97
|
-
- -
|
256
|
+
- - ">="
|
98
257
|
- !ruby/object:Gem::Version
|
99
258
|
version: '0'
|
100
259
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
260
|
requirements:
|
102
|
-
- -
|
261
|
+
- - ">="
|
103
262
|
- !ruby/object:Gem::Version
|
104
263
|
version: '0'
|
105
264
|
requirements: []
|
106
265
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
266
|
+
rubygems_version: 2.4.8
|
108
267
|
signing_key:
|
109
268
|
specification_version: 4
|
110
269
|
summary: Mumuki Test Server Development Kit
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module Mumukit
|
2
|
-
class FileTestCompiler < Mumukit::Stub
|
3
|
-
include Mumukit::WithTempfile
|
4
|
-
|
5
|
-
def compile(test, extra, content)
|
6
|
-
raise 'You need to implement this method'
|
7
|
-
end
|
8
|
-
|
9
|
-
def create_compilation!(test, extra, content)
|
10
|
-
write_tempfile! compile(test, extra, content)
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
class FileTestRunner < Mumukit::Stub
|
2
|
-
include Mumukit::WithCommandLine
|
3
|
-
def run_compilation!(file)
|
4
|
-
post_process_file(file, *run_test_file!(file))
|
5
|
-
ensure
|
6
|
-
file.unlink
|
7
|
-
end
|
8
|
-
|
9
|
-
def post_process_file(file, result, status)
|
10
|
-
[result, status]
|
11
|
-
end
|
12
|
-
|
13
|
-
def run_test_file!(file)
|
14
|
-
run_command run_test_command(file)
|
15
|
-
end
|
16
|
-
|
17
|
-
def run_test_command(file)
|
18
|
-
raise 'You need to implement this method'
|
19
|
-
end
|
20
|
-
end
|