ljudge-ruby 0.0.1 → 0.0.2
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
- data/README.md +6 -1
- data/lib/ljudge/version.rb +1 -1
- data/lib/ljudge.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f945421d728bbc0cf07ef1912a508dfffd54123
|
4
|
+
data.tar.gz: 4a10be5757b1d01a9e5ef0aae5f42ee647263879
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe2aec5406606dfd8913e1f2bac6349ecfb3d2dcdc17ee6bdd4abf2f212d534abc7aa339dae58f7aa9d7f5b115d08abfd5877a1aa15bd11a2e2a0bd5f019f851
|
7
|
+
data.tar.gz: bf1f78cf1773eeddbd705de545fbf34ee6861b3ad20118e32e5101f073818f2b8f6e9995a7dc01a440b6eea74d4300b27874961037b713a314cb9a48eaa15765
|
data/README.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# ljudge-ruby
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/ljudge-ruby)
|
4
|
+
[](https://codeclimate.com/github/wormful/ljudge-ruby)
|
5
|
+
[](https://travis-ci.org/wormful/ljudge-ruby)
|
6
|
+
|
7
|
+
|
3
8
|
Ruby binding for [ljudge](https://github.com/quark-zju/ljudge)
|
4
9
|
|
5
10
|
## Installation
|
@@ -42,4 +47,4 @@ options = {
|
|
42
47
|
|
43
48
|
Ljudge.run(args, options)
|
44
49
|
#=> {"checkerCompilation"=>{"log"=>"", "success"=>true}, "compilation"=>{"log"=>"", "success"=>true}, "testcases"=>[{"memory"=>131072, "result"=>"ACCEPTED", "time"=>0.001}, {"memory"=>221184, "result"=>"WRONG_ANSWER", "time"=>0.001}]}
|
45
|
-
```
|
50
|
+
```
|
data/lib/ljudge/version.rb
CHANGED
data/lib/ljudge.rb
CHANGED
@@ -29,7 +29,7 @@ module Ljudge
|
|
29
29
|
env.each { |key, value| command << "--env #{key} #{value} "}
|
30
30
|
output = IO.popen(command, err: [:child, :out]).readlines.join
|
31
31
|
begin
|
32
|
-
JSON::restore(output)
|
32
|
+
JSON::restore(output[output.index('{')..output.rindex('}')])
|
33
33
|
rescue JSON::ParserError
|
34
34
|
output
|
35
35
|
end
|
@@ -38,13 +38,13 @@ module Ljudge
|
|
38
38
|
def self.to_option_str(hash)
|
39
39
|
str = ""
|
40
40
|
hash.each do |key, value|
|
41
|
+
option_name = key.to_s.gsub(/_/, '-')
|
41
42
|
if value.is_a? Array
|
42
|
-
value.each { |args| str <<
|
43
|
+
value.each { |args| str << "--#{option_name} #{to_option_str(args)}" }
|
43
44
|
else
|
44
|
-
str <<
|
45
|
-
str << value.to_s << ' '
|
45
|
+
str << "--#{option_name} #{value.to_s} "
|
46
46
|
end
|
47
47
|
end
|
48
48
|
str
|
49
49
|
end
|
50
|
-
end
|
50
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ljudge-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yilin Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|