rbbrs24 0.1.0 → 0.1.1
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/rbbrs24.rb +40 -14
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5efc6324df4893eebf830e6134d38de5df74df5170819f8e62af701a3f24a550
|
4
|
+
data.tar.gz: 67f73b62392556e580779e31fea21e08669bf95dbec8625cb77330fba65ee541
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edc136a4a8e1a9e804a4162e5b1805b7022a4d25f1cc04583ff1e0f2d6085ccb882548a9d81df3a9fc00f31f1b67af7cfc6c18a576e557005fe568faf425d330
|
7
|
+
data.tar.gz: 1b461123a4dba458447335d7dfdd1d0cca4a669976b1bc2c17a21a9529c4a9e7a9612ecebdba7ab35f0fa58cf33b6804980b0619d38ac64c5f26532bab62a6f1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rbbrs24.rb
CHANGED
@@ -6,31 +6,57 @@
|
|
6
6
|
# be executed on the server. Recommended for private use only.
|
7
7
|
|
8
8
|
class Rbbrs24
|
9
|
-
|
10
|
-
def initialize(action: 'run')
|
11
|
-
@action = action
|
12
|
-
end
|
13
9
|
|
14
|
-
|
15
|
-
|
10
|
+
attr_accessor :html_input, :html_output, :css
|
11
|
+
|
12
|
+
def initialize(action: 'run', code: '')
|
13
|
+
|
14
|
+
@action, @code = action, code
|
15
|
+
|
16
|
+
@css = %q(
|
17
|
+
form {background-color: #e34}
|
18
|
+
textarea {background-color: #eee}
|
19
|
+
)
|
20
|
+
|
21
|
+
@pg = %q(
|
16
22
|
<html>
|
17
23
|
<head>
|
18
24
|
<style>
|
19
|
-
|
20
|
-
textarea {background-color: #eee}
|
25
|
+
$css
|
21
26
|
</style>
|
22
27
|
</head>
|
23
28
|
<body>
|
24
|
-
|
25
|
-
|
26
|
-
|
29
|
+
$div
|
30
|
+
</body>
|
31
|
+
</html>
|
32
|
+
)
|
33
|
+
|
34
|
+
@html_input = %q(
|
35
|
+
<div class='code'>
|
36
|
+
<form action="$action" method="get" target="output">
|
37
|
+
<textarea autofocus="true" name="input1">$code</textarea>
|
27
38
|
<input type="submit" value="run"/>
|
28
39
|
</form>
|
29
40
|
<iframe name="output" id="output"/>
|
30
41
|
</div>
|
31
|
-
|
32
|
-
|
33
|
-
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
def render_input()
|
47
|
+
@html_input.sub('$action', @action).sub('$code', @code)
|
48
|
+
end
|
49
|
+
|
50
|
+
def render_input_pg()
|
51
|
+
@pg.sub('$css', @css).sub('$div', render_input())
|
52
|
+
end
|
53
|
+
|
54
|
+
def render_output()
|
55
|
+
@html_output.sub('$action', @action).sub('$code', code)
|
56
|
+
end
|
57
|
+
|
58
|
+
def render_output_pg()
|
59
|
+
@pg.sub('$css', @css).sub('$div', render_input())
|
34
60
|
end
|
35
61
|
|
36
62
|
def evalx(s)
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|