ojsubmitter 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +152 -22
- data/lib/ojsubmitter/cli.rb +3 -0
- data/lib/ojsubmitter/judge/aoj.rb +4 -0
- data/lib/ojsubmitter/judge/codeforces.rb +2 -2
- data/lib/ojsubmitter/judge/spoj.rb +13 -13
- data/lib/ojsubmitter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 124914fec76b8a1b202797e835a73fe4de8385dc
|
4
|
+
data.tar.gz: bb2beaff82cd088c173ccc39e6b187483ff6db46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f50806fb64c218d31eed9ba39c59a703c14d3601e961e9c408837f938d0b54ef001b5bcdaf297db4732fbe3b3b013aacdab98bb66df2d9f01cd28496eb95612
|
7
|
+
data.tar.gz: e83aba4eb5aa6b2838ba2357a0a7bd90d522698dcff948c816e4450ab2c5a1b38d1e9c95624b5c80da431e8a8f8387747f78ddd1d20325ed661a9a209407f6fe
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/ojsubmitter.svg)](https://badge.fury.io/rb/ojsubmitter) [![Build Status](https://travis-ci.org/hadrori/ojsubmitter.svg?branch=master)](https://travis-ci.org/hadrori/ojsubmitter) [![Coverage Status](https://coveralls.io/repos/github/hadrori/ojsubmitter/badge.svg?branch=master)](https://coveralls.io/github/hadrori/ojsubmitter?branch=master) [![Dependency Status](https://gemnasium.com/hadrori/ojsubmitter.svg)](https://gemnasium.com/hadrori/ojsubmitter)
|
4
4
|
|
5
|
-
|
5
|
+
This gem helps you submit source code to online judges from command line interface.
|
6
6
|
|
7
7
|
## Requirements
|
8
8
|
|
@@ -18,23 +18,11 @@ You can also get this list from `ojsubmitter list` command.
|
|
18
18
|
|
19
19
|
## Installation
|
20
20
|
|
21
|
-
Add this line to your application's Gemfile:
|
22
|
-
|
23
|
-
```ruby
|
24
|
-
gem 'ojsubmitter'
|
25
|
-
```
|
26
|
-
|
27
|
-
And then execute:
|
28
|
-
|
29
|
-
$ bundle
|
30
|
-
|
31
|
-
Or install it yourself as:
|
32
|
-
|
33
21
|
$ gem install ojsubmitter
|
34
22
|
|
35
23
|
## Configure
|
36
24
|
|
37
|
-
Please run below command to create config file to home directory.
|
25
|
+
Please run below command to create config file to home directory(`~/.ojsconf.yml`).
|
38
26
|
You can set the default options of ojsubmitter command.
|
39
27
|
|
40
28
|
$ ojsubmitter init
|
@@ -44,9 +32,157 @@ You can set the default options of ojsubmitter command.
|
|
44
32
|
|
45
33
|
#### Submit
|
46
34
|
|
47
|
-
$ ojsubmitter -j [JUDGE_NAME] -u [USER_NAME] -p [PASSWORD] -l [LANGUAGE] -f [SOURCE_FILE]
|
35
|
+
$ ojsubmitter -j [JUDGE_NAME] -u [USER_NAME] -p [PASSWORD] -l [LANGUAGE] -f [SOURCE_FILE] -i [PROBLEM_ID]
|
36
|
+
|
37
|
+
This command has too many options, so you can use `.ojsconf.yml` to set default options.
|
38
|
+
After submitting, this will open the submission status page with web browser. If you don't want to open browser, please use `-n` option.
|
39
|
+
If you don't specify the problem id, this tool assume the problem id from file name and target judge name.
|
40
|
+
|
41
|
+
#### Available judges and options to submit.
|
42
|
+
|
43
|
+
| online judge | problem | judge (-j) | problem_id (-i) | file name (-f) |
|
44
|
+
|:--|:--|:--:|:--:|:--:|
|
45
|
+
| Aizu Online Judge | [0000](http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0000) | aoj | 0000 | 0000.cpp |
|
46
|
+
| PKU Judge Online | [1000](http://poj.org/problem?id=1000) | poj | 1000 | 1000.cpp |
|
47
|
+
| Sphere Online Judge | [PRIME1](http://www.spoj.com/problems/PRIME1/) | spoj | PRIME1 | prime1.cpp |
|
48
|
+
| Codeforces | [1A](http://codeforces.com/problemset/problem/1/A) | cf, codeforces | 1A | 1A.cpp |
|
49
|
+
|
50
|
+
When you submit to Codeforces and your file name is like `A.cpp`, this tool assume contest id from your current directory. For example, if your current directory is `/path/to/cf/1` and file name is `A.cpp`, problem id will be `1A`.
|
51
|
+
|
52
|
+
|
53
|
+
#### Available languages
|
54
|
+
|
55
|
+
All languages are case-insensitive.
|
56
|
+
|
57
|
+
#### Aizu Online Judge
|
58
|
+
|
59
|
+
Version infomation of AOJ is [here](http://judge.u-aizu.ac.jp/onlinejudge/status_note.jsp).
|
60
|
+
|
61
|
+
| Language | language option (-l) |
|
62
|
+
|:--|:--|
|
63
|
+
| C | C |
|
64
|
+
| C++ | C++ |
|
65
|
+
| C++11 | C++11 |
|
66
|
+
| C++14 | C++14 |
|
67
|
+
| JAVA | JAVA |
|
68
|
+
| Scala | Scala |
|
69
|
+
| Haskell | Haskell |
|
70
|
+
| OCaml | OCaml |
|
71
|
+
| C# | C# |
|
72
|
+
| D | D |
|
73
|
+
| Ruby | Ruby |
|
74
|
+
| Python | Python |
|
75
|
+
| Python3 | Python3 |
|
76
|
+
| PHP | PHP |
|
77
|
+
| JavaScript | JavaScript |
|
78
|
+
|
79
|
+
#### PKU JudgeOnline
|
80
|
+
|
81
|
+
Version infomation of POJ is [here](http://poj.org/page?id=1000).
|
82
|
+
|
83
|
+
| Language | language option (-l) |
|
84
|
+
|:--|:--|
|
85
|
+
| G++ | G++ |
|
86
|
+
| GCC | GCC |
|
87
|
+
| Java | Java |
|
88
|
+
| Pascal | Pascal |
|
89
|
+
| C++ | C++ |
|
90
|
+
| C | C |
|
91
|
+
| Fortran | Fortran |
|
92
|
+
|
93
|
+
#### Sphere Online Judge
|
94
|
+
|
95
|
+
Version infomation of SPOJ is [here](http://poj.org/page?id=1000).
|
96
|
+
|
97
|
+
| Language | language option (-l) |
|
98
|
+
|:--|:--|
|
99
|
+
| ADA 95 (gnat 5.1) | ADA |
|
100
|
+
| Assembler (nasm 2.11.05) | Assembler |
|
101
|
+
| Awk (gawk-4.1.1) | Awk |
|
102
|
+
| Bash (bash-4.3.33) | Bash |
|
103
|
+
| Brainf**k (bff 1.0.5) | Brainf**k |
|
104
|
+
| C (gcc 5.1) | C |
|
105
|
+
| C# (gmcs 4.0.2) | C# |
|
106
|
+
| C++ (g++ 5.1) | C++ |
|
107
|
+
| C++14 (g++ 5.1) | C++14 |
|
108
|
+
| C99 strict (gcc 5.1) | C99 |
|
109
|
+
| Clips (clips 6.24) | Clips |
|
110
|
+
| Clojure (clojure 1.7) | Clojure |
|
111
|
+
| Cobol (opencobol 1.1) | Cobol |
|
112
|
+
| Common Lisp (clisp 2.49) | CommonLisp |
|
113
|
+
| D (dmd 2.067.1) | D |
|
114
|
+
| Elixir (1.1.0) | Elixir |
|
115
|
+
| Erlang (erl 18) | Erlang |
|
116
|
+
| F# (fsharp 3.1) | F# |
|
117
|
+
| Fantom (1.0.67) | Fantom |
|
118
|
+
| Fortran 95 (gfortran 5.1) | Fortran |
|
119
|
+
| Go (gc 1.4.2) | Go |
|
120
|
+
| Groovy (2.4.4) | groovy |
|
121
|
+
| Haskell (ghc 7.8) | Haskell |
|
122
|
+
| Icon (iconc 9.4.3) | Icon |
|
123
|
+
| Intercal (ick 0.28-4) | Intercal |
|
124
|
+
| JAR (JavaSE 6) | JAR |
|
125
|
+
| Java (JavaSE 8u51) | Java |
|
126
|
+
| JavaScript (spidermonkey 24.) | JavaScript |
|
127
|
+
| Lua (luac 5.2) | Lua |
|
128
|
+
| Nemerle (ncc 0.9.3) | Nemerle |
|
129
|
+
| Nice (nicec 0.9.13) | Nice |
|
130
|
+
| Nim (nim 0.11.2) | Nim |
|
131
|
+
| ObjC (clang 3.7) | ObjC |
|
132
|
+
| Ocaml (ocamlopt 4.01.0) | Ocaml |
|
133
|
+
| Pascal (gpc 20070904) | Pascal |
|
134
|
+
| Perl (perl 5.20.1) | Perl |
|
135
|
+
| PHP (php 5.6.9) | PHP |
|
136
|
+
| PicoLisp (3.1.1) | PicoLisp |
|
137
|
+
| Pike (pike 7.8) | Pike |
|
138
|
+
| Prolog (swipl 7.2) | Prolog |
|
139
|
+
| Python (python 2.7.10) | Python |
|
140
|
+
| Python (PyPy 2.6) | PyPy |
|
141
|
+
| Python 3 (python 3.4) | Python3 |
|
142
|
+
| Ruby (ruby 2.1) | Ruby |
|
143
|
+
| Rust (1.0.0) | Rust |
|
144
|
+
| Scala (scala 2.11.7) | Scala |
|
145
|
+
| Scheme (guile 2.0.11) | Scheme |
|
146
|
+
| Sed (sed-4.2) | Sed |
|
147
|
+
| Smalltalk (gst 3.2.4) | Smalltalk |
|
148
|
+
| Tcl (tclsh 8.6) | Tcl |
|
149
|
+
| TECS () | TECS |
|
150
|
+
| Text (plain text) | Text |
|
151
|
+
| VB.net (vnbc 4.0.2) | VB.net |
|
152
|
+
| Whitespace (wspace 0.3) | Whitespace |
|
153
|
+
|
154
|
+
|
155
|
+
#### Codeforces
|
156
|
+
|
157
|
+
Version infomation of Codeforces is [here](http://codeforces.com/blog/entry/79).
|
158
|
+
|
159
|
+
|
160
|
+
| Language | language option (-l) |
|
161
|
+
|:--|:--|
|
162
|
+
| GNU GCC 5.1.0 | GCC |
|
163
|
+
| GNU G++ 5.1.0 | G++ |
|
164
|
+
| GNU G++11 5.1.0 | G++11 |
|
165
|
+
| Microsoft Visual C++ 2010 | MSC++ |
|
166
|
+
| C# Mono 3.12.1.0 | C# |
|
167
|
+
| MS C# .NET 4.0.30319 | MSC# |
|
168
|
+
| D DMD32 v2.069.2 | D |
|
169
|
+
| Go 1.5.2 | Go |
|
170
|
+
| Haskell GHC 7.8.3 | Haskell |
|
171
|
+
| Java 1.7.0_80 | Java7 |
|
172
|
+
| Java 1.8.0_66 | Java |
|
173
|
+
| OCaml 4.02.1 | OCaml |
|
174
|
+
| Delphi 7 | Delphi |
|
175
|
+
| Free Pascal 2.6.4 | Pascal |
|
176
|
+
| Perl 5.20.1 | Perl |
|
177
|
+
| PHP 5.4.42 | PHP |
|
178
|
+
| Python 2.7.10 | Python |
|
179
|
+
| Python 3.5.1 | Python3 |
|
180
|
+
| PyPy 2.7.10 (2.6.1) | PyPy |
|
181
|
+
| PyPy 3.2.5 (2.4.0) | PyPy3 |
|
182
|
+
| Ruby 2.0.0p645 | Ruby |
|
183
|
+
| Scala 2.11.7 | Scala |
|
184
|
+
| JavaScript V8 4.8.0 | JavaScript |
|
48
185
|
|
49
|
-
To omit these options, you can use config file `.ojsconf.yml` located in your home directory.
|
50
186
|
|
51
187
|
#### Help
|
52
188
|
|
@@ -54,12 +190,6 @@ Please read the help command to get more info.
|
|
54
190
|
|
55
191
|
$ ojsubmitter help
|
56
192
|
|
57
|
-
## Development
|
58
|
-
|
59
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
60
|
-
|
61
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
62
|
-
|
63
193
|
## Contributing
|
64
194
|
|
65
195
|
Bug reports and pull requests are welcome on GitHub at https://github.com/hadrori/ojsubmitter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/lib/ojsubmitter/cli.rb
CHANGED
@@ -6,24 +6,23 @@ module OJS
|
|
6
6
|
LANGUAGE_ID = {
|
7
7
|
'ada' => '7',
|
8
8
|
'assembler' => '13', # nasm
|
9
|
-
# 'Assembler' => '45', # Assembler GC g++
|
10
9
|
'awk' => '104',
|
11
10
|
'bash' => '28',
|
12
11
|
'brainf**k' => '12',
|
13
12
|
'c' => '11',
|
14
13
|
'c#' => '27',
|
15
|
-
'c++' => '1',
|
16
|
-
# 'C++' => '41', # g++ 4.3.2
|
14
|
+
'c++' => '1', # g++-5
|
17
15
|
'c++14' => '44',
|
18
16
|
'c99' => '34',
|
19
17
|
'clips' => '14',
|
20
18
|
'clojure' => '111',
|
21
19
|
'cobol' => '118',
|
22
20
|
'commonlisp' => '32', # clisp
|
23
|
-
|
24
|
-
'
|
21
|
+
'd' => '102', # dmd
|
22
|
+
'elixir' => '96',
|
25
23
|
'erlang' => '36',
|
26
24
|
'f#' => '124',
|
25
|
+
'fantom' => '92',
|
27
26
|
'fortran' => '5',
|
28
27
|
'go' => '114',
|
29
28
|
'groovy' => '121',
|
@@ -32,25 +31,26 @@ module OJS
|
|
32
31
|
'intercal' => '9',
|
33
32
|
'jar' => '24',
|
34
33
|
'java' => '10',
|
35
|
-
'javascript' => '112',
|
34
|
+
'javascript' => '112', # spidermonkey
|
36
35
|
'lua' => '26',
|
37
36
|
'nemerle' => '30',
|
38
37
|
'nice' => '25',
|
38
|
+
'nim' => '122',
|
39
|
+
'objc' => '83', # clang
|
39
40
|
'ocaml' => '8',
|
40
|
-
'pascal' =>
|
41
|
+
'pascal' => '2', # gpc
|
41
42
|
'perl' => '3',
|
42
43
|
'php' => '29',
|
44
|
+
'picolisp' => '94',
|
43
45
|
'pike' => '19',
|
44
46
|
'prolog' => '15',
|
45
|
-
'python' => '4',
|
46
|
-
|
47
|
-
'python3' =>
|
48
|
-
# 'Python3' => '116', # python 3.2.3
|
49
|
-
# 'Python3' => '126', # python 3.2.3 nbc
|
47
|
+
'python' => '4', # 2.7.0
|
48
|
+
'pypy' => '99', # 2.6
|
49
|
+
'python3' => '116', # Python 3.4
|
50
50
|
'ruby' => '17',
|
51
|
+
'rust' => '93',
|
51
52
|
'scala' => '39',
|
52
53
|
'scheme' => '33', # guile
|
53
|
-
# 'Scheme' => '18', # stalin
|
54
54
|
'sed' => '46',
|
55
55
|
'smalltalk' => '23',
|
56
56
|
'tcl' => '38',
|
data/lib/ojsubmitter/version.rb
CHANGED