mumuki-html-runner 1.0.0
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.
- checksums.yaml +7 -0
- data/lib/html_runner.rb +12 -0
- data/lib/locales/en.yml +7 -0
- data/lib/locales/es.yml +7 -0
- data/lib/metadata_hook.rb +15 -0
- data/lib/test_hook.rb +32 -0
- metadata +161 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f11f47fdc2df295563a72e3afa828cfd9ccd2132
|
4
|
+
data.tar.gz: 6f7c3651dc3b9e92e12797e2f16d554779f0e2b1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bdfd19ff5ec8d4ceb1d3a9b46a274d66e481db373bfebc69421fc99d19ddb39eabc5f3044a20869fc9193b86f65c4c29170c8e238078f05b8fb28ce77f1af30e
|
7
|
+
data.tar.gz: 2a1439b6aea177e24d7a4554cf595b0830dec516bfb662820eb2fae79434ce7fb6d43706089ed2c602ea067527fc8d696bdeb0c83797ccfc5a903f9e4e0261e7
|
data/lib/html_runner.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'mumukit'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
I18n.load_translations_path File.join(__dir__, 'locales', '*.yml')
|
5
|
+
|
6
|
+
Mumukit.runner_name = 'html'
|
7
|
+
Mumukit.configure do |config|
|
8
|
+
config.content_type = 'html'
|
9
|
+
end
|
10
|
+
|
11
|
+
require_relative './metadata_hook'
|
12
|
+
require_relative './test_hook'
|
data/lib/locales/en.yml
ADDED
data/lib/locales/es.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
class TextMetadataHook < Mumukit::Hook
|
2
|
+
def metadata
|
3
|
+
{language: {
|
4
|
+
name: 'html',
|
5
|
+
icon: {type: 'devicon', name: 'html'},
|
6
|
+
extension: 'html',
|
7
|
+
graphic: true
|
8
|
+
},
|
9
|
+
test_framework: {
|
10
|
+
name: 'html',
|
11
|
+
test_extension: 'html'
|
12
|
+
}
|
13
|
+
}
|
14
|
+
end
|
15
|
+
end
|
data/lib/test_hook.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'mumukit/hook'
|
2
|
+
|
3
|
+
class String
|
4
|
+
def visible_chars
|
5
|
+
gsub(/\s+/, '')
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class HtmlTestHook < Mumukit::Hook
|
10
|
+
def compile(request)
|
11
|
+
request
|
12
|
+
end
|
13
|
+
|
14
|
+
def run!(request)
|
15
|
+
puts request
|
16
|
+
expected = request[:test]
|
17
|
+
actual = request[:content]
|
18
|
+
|
19
|
+
if expected.visible_chars == actual.visible_chars
|
20
|
+
[render_html(actual), :passed]
|
21
|
+
else
|
22
|
+
[render_html(actual), :failed]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def render_html(actual)
|
27
|
+
"<br><iframe
|
28
|
+
style=\"border-color: #e6e6e6; border-style: solid; border-width: thin; width: 100%;\"
|
29
|
+
srcdoc=\"#{actual}\"></iframe>"
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mumuki-html-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: 2017-03-28 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.7'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mumukit-content-type
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.4.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.4.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.4'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: codeclimate-test-reporter
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
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: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: mumukit-bridge
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.3'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.3'
|
125
|
+
description:
|
126
|
+
email:
|
127
|
+
- franco@mumuki.org
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- lib/html_runner.rb
|
133
|
+
- lib/locales/en.yml
|
134
|
+
- lib/locales/es.yml
|
135
|
+
- lib/metadata_hook.rb
|
136
|
+
- lib/test_hook.rb
|
137
|
+
homepage: http://github.com/mumuki/mumuki-html-server
|
138
|
+
licenses:
|
139
|
+
- MIT
|
140
|
+
metadata: {}
|
141
|
+
post_install_message:
|
142
|
+
rdoc_options: []
|
143
|
+
require_paths:
|
144
|
+
- lib
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
requirements: []
|
156
|
+
rubyforge_project:
|
157
|
+
rubygems_version: 2.5.1
|
158
|
+
signing_key:
|
159
|
+
specification_version: 4
|
160
|
+
summary: HTML Runner for Mumuki
|
161
|
+
test_files: []
|