most 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. data/Copying.txt +679 -0
  2. data/History.txt +15 -0
  3. data/Manifest.txt +95 -0
  4. data/PostInstall.txt +6 -0
  5. data/Rakefile +44 -0
  6. data/Readme.rdoc +146 -0
  7. data/bin/most +31 -0
  8. data/lib/most.rb +52 -0
  9. data/lib/most/context.rb +244 -0
  10. data/lib/most/core.rb +171 -0
  11. data/lib/most/di/container.rb +148 -0
  12. data/lib/most/di/proxy.rb +55 -0
  13. data/lib/most/di/service.rb +63 -0
  14. data/lib/most/di/service_factory.rb +40 -0
  15. data/lib/most/environment.rb +67 -0
  16. data/lib/most/executor.rb +80 -0
  17. data/lib/most/helpers/array.rb +31 -0
  18. data/lib/most/helpers/hash.rb +25 -0
  19. data/lib/most/helpers/kernel.rb +35 -0
  20. data/lib/most/helpers/memory_out.rb +93 -0
  21. data/lib/most/helpers/numeric.rb +59 -0
  22. data/lib/most/helpers/object.rb +65 -0
  23. data/lib/most/helpers/symbol.rb +31 -0
  24. data/lib/most/interfaces/meta_programmable.rb +59 -0
  25. data/lib/most/starter.rb +126 -0
  26. data/lib/most/structures/box.rb +199 -0
  27. data/lib/most/structures/submission.rb +117 -0
  28. data/lib/most/structures/test_case.rb +173 -0
  29. data/lib/most/structures/test_runner.rb +103 -0
  30. data/lib/most/structures/types/options.rb +67 -0
  31. data/lib/most/structures/types/path.rb +39 -0
  32. data/lib/most/structures/types/report.rb +84 -0
  33. data/lib/most/submissions/cpp_memory_out_sample.rb +34 -0
  34. data/lib/most/submissions/cpp_sample.rb +36 -0
  35. data/lib/most/submissions/cpp_timeout_sample.rb +34 -0
  36. data/lib/most/submissions/cs_sample.rb +36 -0
  37. data/lib/most/submissions/erlang_sample.rb +36 -0
  38. data/lib/most/submissions/haskell_sample.rb +36 -0
  39. data/lib/most/submissions/java_sample.rb +36 -0
  40. data/lib/most/submissions/lisp_sample.rb +32 -0
  41. data/lib/most/submissions/lua_sample.rb +36 -0
  42. data/lib/most/submissions/ocaml_sample.rb +36 -0
  43. data/lib/most/submissions/pascal_sample.rb +36 -0
  44. data/lib/most/submissions/perl_sample.rb +32 -0
  45. data/lib/most/submissions/php_sample.rb +32 -0
  46. data/lib/most/submissions/python_sample.rb +32 -0
  47. data/lib/most/submissions/ruby_sample.rb +32 -0
  48. data/lib/most/submissions/vb_sample.rb +36 -0
  49. data/lib/most/tasks/general/win/cs.rb +60 -0
  50. data/lib/most/tasks/general/win/erlang.rb +86 -0
  51. data/lib/most/tasks/general/win/gcc.rb +39 -0
  52. data/lib/most/tasks/general/win/haskell.rb +75 -0
  53. data/lib/most/tasks/general/win/java.rb +72 -0
  54. data/lib/most/tasks/general/win/lisp.rb +59 -0
  55. data/lib/most/tasks/general/win/lua.rb +75 -0
  56. data/lib/most/tasks/general/win/ocaml.rb +77 -0
  57. data/lib/most/tasks/general/win/pascal.rb +73 -0
  58. data/lib/most/tasks/general/win/perl.rb +61 -0
  59. data/lib/most/tasks/general/win/php.rb +59 -0
  60. data/lib/most/tasks/general/win/python.rb +59 -0
  61. data/lib/most/tasks/general/win/ruby.rb +61 -0
  62. data/lib/most/tasks/general/win/vb.rb +60 -0
  63. data/lib/most/tasks/general/win/vc.rb +79 -0
  64. data/lib/most/tasks/general/win/vs.rb +52 -0
  65. data/samples/problem/solutions/cpp/main.cpp +9 -0
  66. data/samples/problem/solutions/cpp/tests.yml +19 -0
  67. data/samples/problem/solutions/cs/main.cs +17 -0
  68. data/samples/problem/solutions/cs/tests.yml +19 -0
  69. data/samples/problem/solutions/erlang/main.erl +2 -0
  70. data/samples/problem/solutions/erlang/tests.yml +19 -0
  71. data/samples/problem/solutions/haskell/main.hs +5 -0
  72. data/samples/problem/solutions/haskell/tests.yml +19 -0
  73. data/samples/problem/solutions/java/Main.java +14 -0
  74. data/samples/problem/solutions/java/tests.yml +19 -0
  75. data/samples/problem/solutions/lisp/main.lisp +1 -0
  76. data/samples/problem/solutions/lisp/tests.yml +19 -0
  77. data/samples/problem/solutions/lua/main.lua +4 -0
  78. data/samples/problem/solutions/lua/tests.yml +19 -0
  79. data/samples/problem/solutions/ocaml/main.ml +3 -0
  80. data/samples/problem/solutions/ocaml/tests.yml +19 -0
  81. data/samples/problem/solutions/pascal/main.pas +5 -0
  82. data/samples/problem/solutions/pascal/tests.yml +19 -0
  83. data/samples/problem/solutions/perl/main.pl +2 -0
  84. data/samples/problem/solutions/perl/tests.yml +19 -0
  85. data/samples/problem/solutions/php/main.php +1 -0
  86. data/samples/problem/solutions/php/tests.yml +19 -0
  87. data/samples/problem/solutions/python/main.py +1 -0
  88. data/samples/problem/solutions/python/tests.yml +19 -0
  89. data/samples/problem/solutions/ruby/main.rb +1 -0
  90. data/samples/problem/solutions/ruby/tests.yml +19 -0
  91. data/samples/problem/solutions/vb/main.vb +14 -0
  92. data/samples/problem/solutions/vb/tests.yml +19 -0
  93. data/samples/time_memory/solutions/cpp/main.cpp +21 -0
  94. data/samples/time_memory/solutions/cpp/tests.yml +19 -0
  95. data/tasks/samples.rb +31 -0
  96. metadata +242 -0
@@ -0,0 +1,34 @@
1
+ submission do
2
+ name 'C/C++ "MemoryOut" Test'
3
+
4
+ entities :source_file => path('main.cpp'), :executable => path('main.exe')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'C/C++ Runner'
19
+
20
+ add_step Proc do
21
+ rake_clean 'win:vc:compile', entities[:source_file]
22
+ end
23
+
24
+ add_step Proc do
25
+ total_memory_out 10.megabytes do
26
+ rake_clean 'win:vc:run', entities[:executable], input
27
+ end
28
+ end
29
+
30
+ end
31
+ end
32
+
33
+ end
34
+ end
@@ -0,0 +1,36 @@
1
+ submission do
2
+ name 'Simple C/C++ Submission'
3
+
4
+ entities :source_file => path('main.cpp'), :executable => path('main.exe')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'C/C++ Runner'
19
+
20
+ add_step Proc do
21
+ rake_clean 'win:vc:compile', entities[:source_file]
22
+ end
23
+
24
+ add_step Proc do
25
+ timeout specs[:time] do
26
+ total_memory_out specs[:memory] do
27
+ rake_clean 'win:vc:run', entities[:executable], input
28
+ end
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,34 @@
1
+ submission do
2
+ name 'C/C++ "Timeout" Test'
3
+
4
+ entities :source_file => path('main.cpp'), :executable => path('main.exe')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'C/C++ Runner'
19
+
20
+ add_step Proc do
21
+ rake_clean 'win:vc:compile', entities[:source_file]
22
+ end
23
+
24
+ add_step Proc do
25
+ timeout 5.seconds do
26
+ rake_clean 'win:vc:run', entities[:executable], input
27
+ end
28
+ end
29
+
30
+ end
31
+ end
32
+
33
+ end
34
+ end
@@ -0,0 +1,36 @@
1
+ submission do
2
+ name 'Simple C# Submission'
3
+
4
+ entities :source_file => path('main.cs'), :executable => path('main.exe')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'C# Runner'
19
+
20
+ add_step Proc do
21
+ rake_clean 'win:cs:compile', entities[:source_file]
22
+ end
23
+
24
+ add_step Proc do
25
+ timeout specs[:time] do
26
+ total_memory_out specs[:memory] do
27
+ rake_clean 'win:cs:run', entities[:executable], input
28
+ end
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ submission do
2
+ name 'Simple Erlang Submission'
3
+
4
+ entities :source_file => path('main.erl'), :entry_function => path('main')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'Erlang Runner'
19
+
20
+ add_step Proc do
21
+ rake_clean 'win:erlang:compile', entities[:source_file]
22
+ end
23
+
24
+ add_step Proc do
25
+ timeout specs[:time] do
26
+ total_memory_out specs[:memory] do
27
+ rake_clean 'win:erlang:run', entities[:entry_function], input
28
+ end
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ submission do
2
+ name 'Simple Haskell Submission'
3
+
4
+ entities :source_file => path('main.hs'), :executable => path('main.exe')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'Haskell Runner'
19
+
20
+ add_step Proc do
21
+ rake_clean 'win:haskell:compile', entities[:source_file]
22
+ end
23
+
24
+ add_step Proc do
25
+ timeout specs[:time] do
26
+ total_memory_out specs[:memory] do
27
+ rake_clean 'win:haskell:run', entities[:executable], input
28
+ end
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ submission do
2
+ name 'Simple Java Submission'
3
+
4
+ entities :source_file => path('Main.java'), :executable => path('Main')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'Java Runner'
19
+
20
+ add_step Proc do
21
+ rake_clean 'win:java:compile', entities[:source_file]
22
+ end
23
+
24
+ add_step Proc do
25
+ timeout specs[:time] do
26
+ total_memory_out specs[:memory] do
27
+ rake_clean 'win:java:run', entities[:executable], input
28
+ end
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,32 @@
1
+ submission do
2
+ name 'Simple Lisp Submission'
3
+
4
+ entities :executable => path('main.lisp')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'Lisp Runner'
19
+
20
+ add_step Proc do
21
+ timeout specs[:time] do
22
+ total_memory_out specs[:memory] do
23
+ rake_clean 'win:lisp:run', entities[:executable], input
24
+ end
25
+ end
26
+ end
27
+
28
+ end
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,36 @@
1
+ submission do
2
+ name 'Simple Lua Submission'
3
+
4
+ entities :source_file => path('main.lua'), :executable => path('main.out')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'Lua Runner'
19
+
20
+ add_step Proc do
21
+ rake_clean 'win:lua:compile', entities[:source_file], entities[:executable]
22
+ end
23
+
24
+ add_step Proc do
25
+ timeout specs[:time] do
26
+ total_memory_out specs[:memory] do
27
+ rake_clean 'win:lua:run', entities[:executable], input
28
+ end
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ submission do
2
+ name 'Simple OCaml Submission'
3
+
4
+ entities :source_file => path('main.ml'), :executable => path('main.exe')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'OCaml Runner'
19
+
20
+ add_step Proc do
21
+ rake_clean 'win:ocaml:compile', entities[:source_file], entities[:executable]
22
+ end
23
+
24
+ add_step Proc do
25
+ timeout specs[:time] do
26
+ total_memory_out specs[:memory] do
27
+ rake_clean 'win:ocaml:run', entities[:executable], input
28
+ end
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ submission do
2
+ name 'Simple Pascal Submission'
3
+
4
+ entities :source_file => path('main.pas'), :executable => path('main.exe')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'Pascal Runner'
19
+
20
+ add_step Proc do
21
+ rake_clean 'win:pascal:compile', entities[:source_file]
22
+ end
23
+
24
+ add_step Proc do
25
+ timeout specs[:time] do
26
+ total_memory_out specs[:memory] do
27
+ rake_clean 'win:pascal:run', entities[:executable], input
28
+ end
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,32 @@
1
+ submission do
2
+ name 'Simple Perl Submission'
3
+
4
+ entities :executable => path('main.pl')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'Perl Runner'
19
+
20
+ add_step Proc do
21
+ timeout specs[:time] do
22
+ total_memory_out specs[:memory] do
23
+ rake_clean 'win:perl:run', entities[:executable], input
24
+ end
25
+ end
26
+ end
27
+
28
+ end
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ submission do
2
+ name 'Simple PHP Submission'
3
+
4
+ entities :executable => path('main.php')
5
+
6
+ options :tests => {:report => {:differences => true, :time => true, :specs => true},
7
+ :steps => {:break => {:unsuccessful => true}}}
8
+
9
+ YAML.load_file('tests.yml').each_with_index do |specs, i|
10
+
11
+ add_test TestCase do
12
+ name "Test #{i + 1}"
13
+
14
+ input specs[:input]
15
+ output specs[:output]
16
+
17
+ runner TestRunner do
18
+ name 'PHP Runner'
19
+
20
+ add_step Proc do
21
+ timeout specs[:time] do
22
+ total_memory_out specs[:memory] do
23
+ rake_clean 'win:php:run', entities[:executable], input
24
+ end
25
+ end
26
+ end
27
+
28
+ end
29
+ end
30
+
31
+ end
32
+ end