ideone 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ideone.rb +10 -3
- data/test/basic.rb +12 -0
- metadata +6 -6
data/lib/ideone.rb
CHANGED
@@ -27,6 +27,12 @@ module Ideone
|
|
27
27
|
:php => 29,
|
28
28
|
:python => 4,
|
29
29
|
:ruby => 17,
|
30
|
+
:lua => 26,
|
31
|
+
:tcl => 38,
|
32
|
+
:bf => 12,
|
33
|
+
:bc => 110,
|
34
|
+
:gawk => 104,
|
35
|
+
:nasm => 13,
|
30
36
|
}
|
31
37
|
TIMEOUT = 4 # iterations
|
32
38
|
|
@@ -38,7 +44,8 @@ module Ideone
|
|
38
44
|
{
|
39
45
|
'lang' => lang,
|
40
46
|
'run' => 0,
|
41
|
-
'file' => code
|
47
|
+
'file' => code,
|
48
|
+
'public' => 0
|
42
49
|
}
|
43
50
|
).header['location'][1..-1]
|
44
51
|
end
|
@@ -91,11 +98,11 @@ module Ideone
|
|
91
98
|
raise IdeoneError, "Timed out while waiting for code result."
|
92
99
|
end
|
93
100
|
|
94
|
-
err = res['inouterr'].match(/<label>stderr:<\/label>.*?<pre
|
101
|
+
err = res['inouterr'].match(/<label>stderr:<\/label>.*?<pre.*?>\n(.*?)\n<\/pre>/m)
|
95
102
|
if err
|
96
103
|
err[1]
|
97
104
|
else
|
98
|
-
out = res['inouterr'].match(/<label>output:<\/label>.*?<pre
|
105
|
+
out = res['inouterr'].match(/<label>output:<\/label>.*?<pre.*?>\n(.*?)\n<\/pre>/m)
|
99
106
|
if out
|
100
107
|
CGI.unescapeHTML out[1]
|
101
108
|
end
|
data/test/basic.rb
CHANGED
@@ -26,6 +26,18 @@ describe 'an ideone gem user' do
|
|
26
26
|
results.should.equal %{text on stdout\n}
|
27
27
|
end
|
28
28
|
|
29
|
+
it 'can submit Lua code and receive stdout' do
|
30
|
+
paste_id = Ideone.submit( :lua, %{print "text on stdout"} )
|
31
|
+
results = Ideone.run( paste_id, nil )
|
32
|
+
results.should.equal %{text on stdout\n}
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'can submit Tcl code and receive stdout' do
|
36
|
+
paste_id = Ideone.submit( :tcl, %{puts "text on stdout";} )
|
37
|
+
results = Ideone.run( paste_id, nil )
|
38
|
+
results.should.equal %{text on stdout\n}
|
39
|
+
end
|
40
|
+
|
29
41
|
it 'can submit Bash code and receive stdout' do
|
30
42
|
paste_id = Ideone.submit( :bash, %{echo "text on stdout"} )
|
31
43
|
results = Ideone.run( paste_id, nil )
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ideone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 4
|
10
|
+
version: 0.8.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pistos
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-29 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -42,10 +42,10 @@ extra_rdoc_files: []
|
|
42
42
|
|
43
43
|
files:
|
44
44
|
- lib/ideone.rb
|
45
|
-
- test/basic.rb
|
46
45
|
- test/with-input.rb
|
47
|
-
-
|
46
|
+
- test/basic.rb
|
48
47
|
- examples/with-stdin.rb
|
48
|
+
- examples/hello-world.rb
|
49
49
|
- LICENCE
|
50
50
|
- LICENSE
|
51
51
|
- README.md
|