mumuki-ruby-runner 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2b42e4d6d2a88e627145400a03dee6d85d245e88
4
+ data.tar.gz: c47151272a126cd96217c7c0e10bc2c16e298608
5
+ SHA512:
6
+ metadata.gz: 14a7ac9efcf50e4cf87f9e60caeb8b3bfeefcddbd3c14371b926cd672f32d6cafa64cce928ed258a9f9950f80acf7d1db4fcd41a31eca9587dc4a8c41f7c4dcb
7
+ data.tar.gz: d461227be5fc65ed97dee42eed8729caa9c4bc0a670acd6360024f83f8e7cd35f60d6b348a370d38a1c1026a951d6b2ba93500324fff74a24ab6f957b5cecc95
@@ -0,0 +1,16 @@
1
+ class RubyMetadataHook < Mumukit::Hook
2
+ def metadata
3
+ {language: {
4
+ name: 'ruby',
5
+ icon: {type: 'devicon', name: 'ruby'},
6
+ version: '2.0',
7
+ extension: 'rb',
8
+ ace_mode: 'ruby'
9
+ },
10
+ test_framework: {
11
+ name: 'rspec',
12
+ version: '2.13',
13
+ test_extension: '.rb'
14
+ }}
15
+ end
16
+ end
data/lib/query_hook.rb ADDED
@@ -0,0 +1,15 @@
1
+ class RubyQueryHook < Mumukit::Templates::FileHook
2
+ isolated true
3
+
4
+ def tempfile_extension
5
+ '.rb'
6
+ end
7
+
8
+ def compile_file_content(r)
9
+ "#{r.extra}\n#{r.content}\nprint('=> ' + (#{r.query}).inspect)"
10
+ end
11
+
12
+ def command_line(filename)
13
+ "ruby #{filename}"
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ require 'mumukit'
2
+
3
+ Mumukit.runner_name = 'ruby'
4
+ Mumukit.configure do |config|
5
+ config.docker_image = 'mumuki/mumuki-rspec-worker'
6
+ config.comment_type = Mumukit::Directives::CommentType::Ruby
7
+ config.structured = true
8
+ config.stateful = true
9
+ end
10
+
11
+ require_relative './metadata_hook'
12
+ require_relative './test_hook'
13
+ require_relative './query_hook'
data/lib/test_hook.rb ADDED
@@ -0,0 +1,25 @@
1
+ class RubyTestHook < Mumukit::Templates::FileHook
2
+ mashup
3
+ isolated true
4
+ structured true
5
+
6
+ def tempfile_extension
7
+ '.rb'
8
+ end
9
+
10
+ def command_line(filename)
11
+ "rspec #{filename} -f json"
12
+ end
13
+
14
+ def to_structured_result(result)
15
+ transform(super['examples'])
16
+ end
17
+
18
+ def transform(examples)
19
+ examples.map { |e| [e['full_description'], e['status'].to_sym, parse_out(e['exception'])] }
20
+ end
21
+
22
+ def parse_out(exception)
23
+ exception ? exception['message'] : ''
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mumuki-ruby-runner
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Franco Leonardo Bulgarelli
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mumukit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.4'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: codeclimate-test-reporter
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: mumukit-bridge
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.3'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.3'
97
+ description:
98
+ email:
99
+ - franco@mumuki.org
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - lib/metadata_hook.rb
105
+ - lib/query_hook.rb
106
+ - lib/ruby_runner.rb
107
+ - lib/test_hook.rb
108
+ homepage: http://github.com/mumuki/mumuki-ruby-server
109
+ licenses:
110
+ - MIT
111
+ metadata: {}
112
+ post_install_message:
113
+ rdoc_options: []
114
+ require_paths:
115
+ - lib
116
+ required_ruby_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ requirements: []
127
+ rubyforge_project:
128
+ rubygems_version: 2.4.8
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: Ruby Runner for Mumuki
132
+ test_files: []