at_coder_friends 0.6.3 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +3 -2
  3. data/.travis.yml +1 -3
  4. data/CHANGELOG.md +37 -0
  5. data/Gemfile.lock +53 -48
  6. data/README.md +1 -1
  7. data/at_coder_friends.gemspec +5 -7
  8. data/config/default.yml +146 -72
  9. data/docs/CONFIGURATION.md +222 -136
  10. data/lib/at_coder_friends.rb +1 -0
  11. data/lib/at_coder_friends/cli.rb +8 -0
  12. data/lib/at_coder_friends/config_loader.rb +11 -3
  13. data/lib/at_coder_friends/context.rb +10 -6
  14. data/lib/at_coder_friends/emitter.rb +2 -2
  15. data/lib/at_coder_friends/generator/base.rb +3 -2
  16. data/lib/at_coder_friends/generator/main.rb +2 -1
  17. data/lib/at_coder_friends/parser/constraints.rb +1 -0
  18. data/lib/at_coder_friends/parser/input_format.rb +2 -0
  19. data/lib/at_coder_friends/parser/input_type.rb +3 -2
  20. data/lib/at_coder_friends/parser/modulo.rb +1 -1
  21. data/lib/at_coder_friends/parser/sections.rb +3 -3
  22. data/lib/at_coder_friends/path_info.rb +51 -0
  23. data/lib/at_coder_friends/path_util.rb +0 -31
  24. data/lib/at_coder_friends/scraping/agent.rb +11 -2
  25. data/lib/at_coder_friends/scraping/custom_test.rb +5 -6
  26. data/lib/at_coder_friends/scraping/submission.rb +6 -7
  27. data/lib/at_coder_friends/scraping/tasks.rb +8 -3
  28. data/lib/at_coder_friends/test_runner/base.rb +17 -4
  29. data/lib/at_coder_friends/test_runner/judge.rb +7 -9
  30. data/lib/at_coder_friends/test_runner/sample.rb +2 -4
  31. data/lib/at_coder_friends/verifier.rb +2 -3
  32. data/lib/at_coder_friends/version.rb +1 -1
  33. data/templates/cxx_builtin.cxx.erb +26 -35
  34. data/templates/ruby_builtin.rb.erb +17 -18
  35. metadata +7 -16
  36. data/tasks/regression/check_const.rake +0 -137
  37. data/tasks/regression/check_diff.rake +0 -30
  38. data/tasks/regression/check_fmt.rake +0 -45
  39. data/tasks/regression/check_parse.rake +0 -69
  40. data/tasks/regression/list_handler.rb +0 -46
  41. data/tasks/regression/regression.rb +0 -38
  42. data/tasks/regression/report_handler.rb +0 -20
  43. data/tasks/regression/section_list.rake +0 -53
  44. data/tasks/regression/setup.rake +0 -48
@@ -29,91 +29,165 @@ generators:
29
29
  - RubyBuiltin
30
30
  - CxxBuiltin
31
31
  ext_settings:
32
- 'awk':
33
- submit_lang: '3506' # Awk (mawk)
34
- 'bf':
35
- submit_lang: '3507' # Brainfuck
36
- 'c':
37
- submit_lang: '3002' # C (GCC)
32
+ 'awk': # Awk (mawk)
33
+ submit_lang:
34
+ - '4009'
35
+ - '3506'
36
+ 'bf': # Brainfuck
37
+ submit_lang:
38
+ - '4062'
39
+ - '3507'
40
+ 'c': # C (GCC)
41
+ submit_lang:
42
+ - '4001'
43
+ - '3002'
38
44
  test_cmd:
39
45
  default: '"{dir}/{base}"'
40
46
  windows: '"{dir}/{base}.exe"'
41
- 'cbl':
42
- submit_lang: '3526' # COBOL - Free
43
- 'clj':
44
- submit_lang: '3007' # Clojure
45
- 'cr':
46
- submit_lang: '3511' # Crystal
47
- 'cs':
48
- submit_lang: '3006' # C# (Mono)
47
+ 'cbl': # COBOL - Free
48
+ submit_lang:
49
+ - '4061'
50
+ - '3526'
51
+ 'clj': # Clojure
52
+ submit_lang:
53
+ - '4013'
54
+ - '3007'
55
+ 'cr': # Crystal
56
+ submit_lang:
57
+ - '4014'
58
+ - '3511'
59
+ 'cs': # C# (Mono-mcs)
60
+ submit_lang:
61
+ - '4011'
62
+ - '3006'
49
63
  test_cmd:
50
64
  default: 'mono "{dir}/{base}.exe"'
51
65
  windows: '"{dir}/{base}.exe"'
52
- 'cxx':
53
- submit_lang: '3003' # C++14 (GCC)
66
+ 'cxx': # C++ (GCC)
67
+ submit_lang:
68
+ - '4003'
69
+ - '3003'
54
70
  test_cmd:
55
71
  default: '"{dir}/{base}"'
56
72
  windows: '"{dir}/{base}.exe"'
57
- 'd':
58
- submit_lang: '3009' # D (DMD64)
59
- 'f90':
60
- submit_lang: '3012' # Fortran (gfortran)
61
- 'fs':
62
- submit_lang: '3512' # F# (Mono)
63
- 'go':
64
- submit_lang: '3013' # Go
65
- 'hs':
66
- submit_lang: '3014' # Haskell (GHC)
67
- 'java':
68
- submit_lang: '3016' # Java8 (OpenJDK)
73
+ 'd': # D (DMD64)
74
+ submit_lang:
75
+ - '4015'
76
+ - '3009'
77
+ 'dart': # Dart
78
+ submit_lang: '4018'
79
+ 'f90': # Fortran (gfortran)
80
+ submit_lang:
81
+ - '4025'
82
+ - '3012'
83
+ 'fs': # F# (Mono)
84
+ submit_lang:
85
+ - '4023'
86
+ - '3512'
87
+ 'go': # Go
88
+ submit_lang:
89
+ - '4026'
90
+ - '3013'
91
+ 'hs': # Haskell (GHC)
92
+ submit_lang:
93
+ - '4027'
94
+ - '3014'
95
+ 'java': # Java (OpenJDK)
96
+ submit_lang:
97
+ - '4005'
98
+ - '3016'
69
99
  test_cmd:
70
100
  default: 'java -cp "{dir}" Main'
71
- 'jl':
72
- submit_lang: '3518' # Julia
73
- 'js':
74
- submit_lang: '3017' # JavaScript (node.js)
75
- 'kt':
76
- submit_lang: '3523' # Kotlin
77
- 'lisp':
78
- submit_lang: '3008' # Common Lisp
79
- 'lua':
80
- submit_lang: '3515' # LuaJIT
81
- 'm':
82
- submit_lang: '3519' # Octave
83
- 'ml':
84
- submit_lang: '3018' # OCaml
85
- 'nim':
86
- submit_lang: '3520' # Nim
87
- 'pas':
88
- submit_lang: '3019' # Pascal (FPC)
89
- 'php':
90
- submit_lang: '3524' # PHP7
91
- 'pl':
92
- submit_lang: '3020' # Perl
93
- 'py':
94
- submit_lang: '3023' # Python3
95
- 'rb':
96
- submit_lang: '3024' # Ruby
101
+ 'jl': # Julia
102
+ submit_lang:
103
+ - '4031'
104
+ - '3518'
105
+ 'js': # JavaScript (node.js)
106
+ submit_lang:
107
+ - '4030'
108
+ - '3017'
109
+ 'kt': # Kotlin
110
+ submit_lang:
111
+ - '4032'
112
+ - '3523'
113
+ 'lisp': # Common Lisp
114
+ submit_lang:
115
+ - '4038'
116
+ - '3008'
117
+ 'lua': # LuaJIT
118
+ submit_lang:
119
+ - '4034'
120
+ - '3515'
121
+ 'm': # Octave
122
+ submit_lang:
123
+ - '4040'
124
+ - '3519'
125
+ 'ml': # OCaml
126
+ submit_lang:
127
+ - '4039'
128
+ - '3018'
129
+ 'nim': # Nim
130
+ submit_lang:
131
+ - '4036'
132
+ - '3520'
133
+ 'pas': # Pascal (FPC)
134
+ submit_lang:
135
+ - '4041'
136
+ - '3019'
137
+ 'php': # PHP7
138
+ submit_lang:
139
+ - '4044'
140
+ - '3524'
141
+ 'pl': # Perl
142
+ submit_lang:
143
+ - '4042'
144
+ - '3020'
145
+ 'py': # Python3
146
+ submit_lang:
147
+ - '4006'
148
+ - '3023'
149
+ 'rb': # Ruby
150
+ submit_lang:
151
+ - '4049'
152
+ - '3024'
97
153
  test_cmd:
98
154
  default: 'ruby "{dir}/{base}.rb"'
99
- 'rs':
100
- submit_lang: '3504' # Rust
101
- 'scala':
102
- submit_lang: '3025' # Scala
103
- 'scm':
104
- submit_lang: '3026' # Scheme (Gauche)
105
- 'sed':
106
- submit_lang: '3505' # Sed (GNU sed)
107
- 'sh':
108
- submit_lang: '3001' # Bash (GNU bash)
109
- 'swift':
110
- submit_lang: '3503' # Swift
111
- 'ts':
112
- submit_lang: '3521' # TypeScript
113
- 'txt':
114
- submit_lang: '3027' # Text (cat)
115
- 'vb':
116
- submit_lang: '3028' # Visual Basic (Mono)
155
+ 'rs': # Rust
156
+ submit_lang:
157
+ - '4050'
158
+ - '3504'
159
+ 'scala': # Scala
160
+ submit_lang:
161
+ - '4051'
162
+ - '3025'
163
+ 'scm': # Scheme (Gauche)
164
+ submit_lang:
165
+ - '4053'
166
+ - '3026'
167
+ 'sed': # Sed (GNU sed)
168
+ submit_lang:
169
+ - '4066'
170
+ - '3505'
171
+ 'sh': # Bash (GNU bash)
172
+ submit_lang:
173
+ - '4007'
174
+ - '3001'
175
+ 'swift': # Swift
176
+ submit_lang:
177
+ - '4055'
178
+ - '3503'
179
+ 'ts': # TypeScript
180
+ submit_lang:
181
+ - '4057'
182
+ - '3521'
183
+ 'txt': # Text (cat)
184
+ submit_lang:
185
+ - '4056'
186
+ - '3027'
187
+ 'vb': # Visual Basic (Mono)
188
+ submit_lang:
189
+ - '4058'
190
+ - '3028'
117
191
  ```
118
192
 
119
193
  ## Configuration options
@@ -205,66 +279,78 @@ ext_settings:
205
279
  |---------|-------------|---------|
206
280
  |default_template|Source template file path|[/templates/cxx_builtin.cxx.erb](/templates/cxx_builtin.cxx.erb)|
207
281
 
208
- ### Language ID list (2019/09/16)
282
+ ### Language ID list (2020/06/21)
209
283
 
210
284
  | Language ID | Description |
211
285
  |-------------|-------------|
212
- |3003|C++14 (GCC 5.4.1)|
213
- |3001|Bash (GNU bash v4.3.11)|
214
- |3002|C (GCC 5.4.1)|
215
- |3004|C (Clang 3.8.0)|
216
- |3005|C++14 (Clang 3.8.0)|
217
- |3006|C# (Mono 4.6.2.0)|
218
- |3007|Clojure (1.8.0)|
219
- |3008|Common Lisp (SBCL 1.1.14)|
220
- |3009|D (DMD64 v2.070.1)|
221
- |3010|D (LDC 0.17.0)|
222
- |3011|D (GDC 4.9.4)|
223
- |3012|Fortran (gfortran v4.8.4)|
224
- |3013|Go (1.6)|
225
- |3014|Haskell (GHC 7.10.3)|
226
- |3015|Java7 (OpenJDK 1.7.0)|
227
- |3016|Java8 (OpenJDK 1.8.0)|
228
- |3017|JavaScript (node.js v5.12)|
229
- |3018|OCaml (4.02.3)|
230
- |3019|Pascal (FPC 2.6.2)|
231
- |3020|Perl (v5.18.2)|
232
- |3021|PHP (5.6.30)|
233
- |3022|Python2 (2.7.6)|
234
- |3023|Python3 (3.4.3)|
235
- |3024|Ruby (2.3.3)|
236
- |3025|Scala (2.11.7)|
237
- |3026|Scheme (Gauche 0.9.3.3)|
238
- |3027|Text (cat)|
239
- |3028|Visual Basic (Mono 4.0.1)|
240
- |3029|C++ (GCC 5.4.1)|
241
- |3030|C++ (Clang 3.8.0)|
242
- |3501|Objective-C (GCC 5.3.0)|
243
- |3502|Objective-C (Clang3.8.0)|
244
- |3503|Swift (swift-2.2-RELEASE)|
245
- |3504|Rust (1.15.1)|
246
- |3505|Sed (GNU sed 4.2.2)|
247
- |3506|Awk (mawk 1.3.3)|
248
- |3507|Brainfuck (bf 20041219)|
249
- |3508|Standard ML (MLton 20100608)|
250
- |3509|PyPy2 (5.6.0)|
251
- |3510|PyPy3 (2.4.0)|
252
- |3511|Crystal (0.20.5)|
253
- |3512|F# (Mono 4.0)|
254
- |3513|Unlambda (0.1.3)|
255
- |3514|Lua (5.3.2)|
256
- |3515|LuaJIT (2.0.4)|
257
- |3516|MoonScript (0.5.0)|
258
- |3517|Ceylon (1.2.1)|
259
- |3518|Julia (0.5.0)|
260
- |3519|Octave (4.0.2)|
261
- |3520|Nim (0.13.0)|
262
- |3521|TypeScript (2.1.6)|
263
- |3522|Perl6 (rakudo-star 2016.01)|
264
- |3523|Kotlin (1.0.0)|
265
- |3524|PHP7 (7.0.15)|
266
- |3525|COBOL - Fixed (OpenCOBOL 1.1.0)|
267
- |3526|COBOL - Free (OpenCOBOL 1.1.0)|
286
+ |4001|C (GCC 9.2.1)|
287
+ |4002|C (Clang 10.0.0)|
288
+ |4003|C++ (GCC 9.2.1)|
289
+ |4004|C++ (Clang 10.0.0)|
290
+ |4005|Java (OpenJDK 11.0.6)|
291
+ |4006|Python (3.8.2)|
292
+ |4007|Bash (5.0.11)|
293
+ |4008|bc (1.07.1)|
294
+ |4009|Awk (GNU Awk 4.1.4)|
295
+ |4010|C# (.NET Core 3.1.201)|
296
+ |4011|C# (Mono-mcs 6.8.0.105)|
297
+ |4012|C# (Mono-csc 3.5.0)|
298
+ |4013|Clojure (1.10.1.536)|
299
+ |4014|Crystal (0.33.0)|
300
+ |4015|D (DMD 2.091.0)|
301
+ |4016|D (GDC 9.2.1)|
302
+ |4017|D (LDC 1.20.1)|
303
+ |4018|Dart (2.7.2)|
304
+ |4019|dc (1.4.1)|
305
+ |4020|Erlang (22.3)|
306
+ |4021|Elixir (1.10.2)|
307
+ |4022|F# (.NET Core 3.1.201)|
308
+ |4023|F# (Mono 10.2.3)|
309
+ |4024|Forth (gforth 0.7.3)|
310
+ |4025|Fortran(GNU Fortran 9.2.1)|
311
+ |4026|Go (1.14.1)|
312
+ |4027|Haskell (GHC 8.8.3)|
313
+ |4028|Haxe (4.0.3); js|
314
+ |4029|Haxe (4.0.3); Java|
315
+ |4030|JavaScript (Node.js 12.16.1)|
316
+ |4031|Julia (1.4.0)|
317
+ |4032|Kotlin (1.3.71)|
318
+ |4033|Lua (Lua 5.3.5)|
319
+ |4034|Lua (LuaJIT 2.1.0)|
320
+ |4035|Dash (0.5.8)|
321
+ |4036|Nim (1.0.6)|
322
+ |4037|Objective-C (Clang 10.0.0)|
323
+ |4038|Common Lisp (SBCL 2.0.3)|
324
+ |4039|OCaml (4.10.0)|
325
+ |4040|Octave (5.2.0)|
326
+ |4041|Pascal (FPC 3.0.4)|
327
+ |4042|Perl (5.26.1)|
328
+ |4043|Raku (Rakudo 2020.02.1)|
329
+ |4044|PHP (7.4.4)|
330
+ |4045|Prolog (SWI-Prolog 8.0.3)|
331
+ |4046|PyPy2 (7.3.0)|
332
+ |4047|PyPy3 (7.3.0)|
333
+ |4048|Racket (7.6)|
334
+ |4049|Ruby (2.7.1)|
335
+ |4050|Rust (1.42.0)|
336
+ |4051|Scala (2.13.1)|
337
+ |4052|Java (OpenJDK 1.8.0)|
338
+ |4053|Scheme (Gauche 0.9.9)|
339
+ |4054|Standard ML (MLton 20130715)|
340
+ |4055|Swift (5.2.1)|
341
+ |4056|Text (cat 8.28)|
342
+ |4057|TypeScript (3.8)|
343
+ |4058|Visual Basic (.NET Core 3.1.101)|
344
+ |4059|Zsh (5.4.2)|
345
+ |4060|COBOL - Fixed (OpenCOBOL 1.1.0)|
346
+ |4061|COBOL - Free (OpenCOBOL 1.1.0)|
347
+ |4062|Brainfuck (bf 20041219)|
348
+ |4063|Ada2012 (GNAT 9.2.1)|
349
+ |4064|Unlambda (2.0.0)|
350
+ |4065|Cython (0.29.16)|
351
+ |4066|Sed (4.4)|
352
+ |4067|Vim (8.2.0460)|
353
+
268
354
 
269
355
  ### Variables in test_cmd string
270
356
 
@@ -318,18 +404,18 @@ test_cmd 文字列中の以下の変数には、
318
404
  test_cmd: ~
319
405
  ```
320
406
 
321
- - Add .pl6(Perl6) settings
322
- .pl6(Perl6)の設定を追加
407
+ - Add .raku(Raku) settings
408
+ .raku(Raku)の設定を追加
323
409
  ```YAML
324
410
  ext_settings:
325
- 'pl6':
326
- submit_lang: '3522' # Perl6
411
+ 'raku':
412
+ submit_lang: '4043' # Raku
327
413
  ```
328
414
 
329
- - Change submission language of .cxx to C++14(Clang)
330
- .cxxの提出言語をC++14(Clang)に変更
415
+ - Change submission language of .cxx to C++(Clang)
416
+ .cxxの提出言語をC++(Clang)に変更
331
417
  ```YAML
332
418
  ext_settings:
333
419
  'cxx':
334
- submit_lang: '3005' # C++14(Clang)
420
+ submit_lang: '4004' # C++(Clang)
335
421
  ```
@@ -4,6 +4,7 @@ require 'at_coder_friends/version'
4
4
  require 'at_coder_friends/errors'
5
5
  require 'at_coder_friends/path_util'
6
6
  require 'at_coder_friends/config_loader'
7
+ require 'at_coder_friends/path_info'
7
8
  require 'at_coder_friends/verifier'
8
9
  require 'at_coder_friends/test_runner/base'
9
10
  require 'at_coder_friends/test_runner/sample'
@@ -117,6 +117,7 @@ module AtCoderFriends
117
117
 
118
118
  ctx.scraping_agent.submit
119
119
  vf.unverify
120
+ open_submission_list
120
121
  end
121
122
 
122
123
  def check_and_go
@@ -125,6 +126,7 @@ module AtCoderFriends
125
126
  # submit automatically
126
127
  ctx.scraping_agent.submit
127
128
  vf.unverify
129
+ open_submission_list
128
130
  else
129
131
  # enable manual submit
130
132
  vf.verify
@@ -142,5 +144,11 @@ module AtCoderFriends
142
144
  def open_contest
143
145
  Launchy.open(ctx.scraping_agent.contest_url)
144
146
  end
147
+
148
+ def open_submission_list
149
+ url = ctx.scraping_agent.contest_url('submissions/me')
150
+ puts "submission status : #{url}"
151
+ Launchy.open(url)
152
+ end
145
153
  end
146
154
  end
@@ -11,20 +11,28 @@ module AtCoderFriends
11
11
  DEFAULT_FILE = File.join(ACF_HOME, 'config', 'default.yml')
12
12
 
13
13
  class << self
14
+ def dotfile
15
+ DOTFILE
16
+ end
17
+
18
+ def default_file
19
+ DEFAULT_FILE
20
+ end
21
+
14
22
  def load_config(ctx)
15
23
  path = config_file_for(ctx.path)
16
24
  config = load_yaml(path)
17
- return config if path == DEFAULT_FILE
25
+ return config if path == default_file
18
26
 
19
27
  merge_with_default(config)
20
28
  end
21
29
 
22
30
  def config_file_for(target_dir)
23
- find_project_dotfile(target_dir) || DEFAULT_FILE
31
+ find_project_dotfile(target_dir) || default_file
24
32
  end
25
33
 
26
34
  def find_project_dotfile(target_dir)
27
- find_file_upwards(DOTFILE, target_dir)
35
+ find_file_upwards(dotfile, target_dir)
28
36
  end
29
37
 
30
38
  def find_file_upwards(filename, start_dir)