mumukit 0.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/bin/limit +10 -0
  3. data/bin/mulang +0 -0
  4. data/lib/locales/en.yml +4 -0
  5. data/lib/locales/es.yml +4 -0
  6. data/lib/mumukit/defaults/default_expectations_hook.rb +9 -0
  7. data/lib/mumukit/defaults/default_feedback_hook.rb +5 -0
  8. data/lib/mumukit/defaults/default_metadata_hook.rb +5 -0
  9. data/lib/mumukit/defaults/default_query_hook.rb +9 -0
  10. data/lib/mumukit/defaults/default_test_hook.rb +9 -0
  11. data/lib/mumukit/defaults/default_validation_hook.rb +4 -0
  12. data/lib/mumukit/defaults.rb +11 -0
  13. data/lib/mumukit/env.rb +11 -0
  14. data/lib/mumukit/hook.rb +30 -0
  15. data/lib/mumukit/isolated_environment.rb +51 -0
  16. data/lib/mumukit/metatest/checker.rb +34 -0
  17. data/lib/mumukit/metatest/errors.rb +10 -0
  18. data/lib/mumukit/metatest/framework.rb +20 -0
  19. data/lib/mumukit/metatest/identity_runner.rb +7 -0
  20. data/lib/mumukit/metatest.rb +7 -0
  21. data/lib/mumukit/request_validation_error.rb +4 -0
  22. data/lib/mumukit/runner.rb +33 -0
  23. data/lib/mumukit/runtime/info.rb +30 -0
  24. data/lib/mumukit/runtime/runtime.rb +35 -0
  25. data/lib/mumukit/runtime/shortcuts.rb +12 -0
  26. data/lib/mumukit/runtime/symbol.rb +17 -0
  27. data/lib/mumukit/runtime.rb +4 -0
  28. data/lib/mumukit/server/app.rb +71 -0
  29. data/lib/mumukit/server/response_builder.rb +62 -0
  30. data/lib/mumukit/server/test_server.rb +118 -0
  31. data/lib/mumukit/server.rb +7 -0
  32. data/lib/mumukit/templates/file_hook.rb +49 -0
  33. data/lib/mumukit/templates/mulang_expectations_hook.rb +57 -0
  34. data/lib/mumukit/templates/with_code_smells.rb +7 -0
  35. data/lib/mumukit/templates/with_embedded_environment.rb +12 -0
  36. data/lib/mumukit/templates/with_isolated_environment.rb +11 -0
  37. data/lib/mumukit/templates/with_mashup_file_content.rb +11 -0
  38. data/lib/mumukit/templates/with_structured_results.rb +15 -0
  39. data/lib/mumukit/templates.rb +12 -0
  40. data/lib/mumukit/version.rb +1 -1
  41. data/lib/mumukit/with_command_line.rb +33 -1
  42. data/lib/mumukit/with_content_type.rb +5 -0
  43. data/lib/mumukit/with_tempfile.rb +13 -2
  44. data/lib/mumukit.rb +62 -8
  45. metadata +180 -21
  46. data/lib/mumukit/file_test_compiler.rb +0 -14
  47. data/lib/mumukit/file_test_runner.rb +0 -20
  48. data/lib/mumukit/stub.rb +0 -5
  49. data/lib/mumukit/test_server.rb +0 -42
  50. data/lib/mumukit/test_server_app.rb +0 -28
  51. data/lib/stubs/expectations_runner.rb +0 -5
  52. data/lib/stubs/test_runner.rb +0 -2
@@ -1,42 +0,0 @@
1
- require 'yaml'
2
-
3
- class Mumukit::TestServer
4
- attr_reader :config
5
-
6
- def initialize(config)
7
- @config = config
8
- end
9
-
10
- def run!(request)
11
- content = request['content']
12
-
13
- test_results = run_tests! config, request['test'], request['extra'], content
14
- expectation_results = run_expectations! config, request['expectations'], content
15
-
16
- response = {exit: test_results[1], out: test_results[0], expectationResults: expectation_results}
17
- response[:feedback] = test_results[2] if test_results[2]
18
-
19
- response
20
- rescue Exception => e
21
- {exit: :failed, out: "#{e.message}:\n#{e.backtrace.join("\n")}"}
22
- end
23
-
24
-
25
- def run_tests!(config, test, extra, content)
26
- compiler = TestCompiler.new(config)
27
- runner = TestRunner.new(config)
28
-
29
- compilation = compiler.create_compilation!(test, extra, content)
30
- runner.run_compilation!(compilation)
31
- end
32
-
33
- def run_expectations!(config, expectations, content)
34
- expectations_runner = ExpectationsRunner.new(config)
35
-
36
- if expectations
37
- expectations_runner.run_expectations!(expectations, content)
38
- else
39
- []
40
- end
41
- end
42
- end
@@ -1,28 +0,0 @@
1
- require 'sinatra/base'
2
- require 'yaml'
3
- require 'json'
4
-
5
- class Mumukit::TestServerApp < Sinatra::Base
6
- configure do
7
- set :mumuki_url, 'http://mumuki.io'
8
- end
9
-
10
- configure :development do
11
- set :config_filename, 'config/development.yml'
12
- end
13
-
14
- configure :production do
15
- set :config_filename, 'config/production.yml'
16
- end
17
-
18
- config = YAML.load_file(settings.config_filename) rescue nil
19
- server = Mumukit::TestServer.new(config)
20
-
21
- post '/test' do
22
- JSON.generate(server.run!(JSON.parse(request.body.read)))
23
- end
24
-
25
- get '/*' do
26
- redirect settings.mumuki_url
27
- end
28
- end
@@ -1,5 +0,0 @@
1
- class ExpectationsRunner < Mumukit::Stub
2
- def run_expectations!(expectations, content)
3
- []
4
- end
5
- end
@@ -1,2 +0,0 @@
1
- class TestRunner
2
- end