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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4fd0913a748d2d67b4a358ccca05d3bbfb5a5136449db11a1fc081be4a85cdb
4
- data.tar.gz: 743ab891f1d8860f17476cc1e699a27cf8cb836efaaf02301907d63488c05f35
3
+ metadata.gz: 5efc6324df4893eebf830e6134d38de5df74df5170819f8e62af701a3f24a550
4
+ data.tar.gz: 67f73b62392556e580779e31fea21e08669bf95dbec8625cb77330fba65ee541
5
5
  SHA512:
6
- metadata.gz: 4e6f994155a751be9fb20cad7dfc2df92d207435caeed26a02abc9a08c051869e7a79d8abff01abfdbbd2a3d2f1a750d57b12d9b310baa26d97e6da763d03db8
7
- data.tar.gz: 2a441c0c2bad2029d7aa72fc66439131d0f9a047255a6a6aa32cd786394ba65ddf27cafb9b0852e16638fd7c7d558f1958846242e157720c2a4d895ef1753abb
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
- def render_input()
15
- %Q(
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
- form {background-color: #e34}
20
- textarea {background-color: #eee}
25
+ $css
21
26
  </style>
22
27
  </head>
23
28
  <body>
24
- <div>
25
- <form action="#{@action}" method="get" target="output">
26
- <textarea autofocus="true" name="input1"></textarea>
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
- </body>
32
- </html>
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbrs24
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file