atcoder_tools 1.0.0 → 1.0.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: 6c99cc2550cdaa96a0ae361402447c9317bfdbe860f278bc5c416a2449360226
4
- data.tar.gz: 741a58416defdc94c2ebe74aa1a3a30e7ef3dbf273911ef099b25ffd190876ae
3
+ metadata.gz: dc1c07215bb4880e76dd70394d7ac26020daf293b89dd25675ed67c2f147bd4d
4
+ data.tar.gz: db4e92d6afd77f138f48d78b295362bac5abdc9c99c9c96a9b155175ae08e8c2
5
5
  SHA512:
6
- metadata.gz: b9a9fc9718ab94f8bc2908d7dcfd38f51abeea226798419e9bdcb2c19d77f07dc733adfcf570c94705cec3541c55b88bafd7d422322cf1b9b875e8fa68a07b59
7
- data.tar.gz: bd783c5e8413b0fb6197c61c182822db5fcfcf3944d274478f331f9597582a6a00f050e1d3789203753f557968a0de092356c8e07e694adb514bdf3e551a4c40
6
+ metadata.gz: 83aec8098241019a4d6e9e194e4ed0e926bf18a646cb282a4554cf4af1c830b13a25c5cfb1624dd9802a1555c0a1dbe2cb79cfe5ab3893ce7283678c33dd55d6
7
+ data.tar.gz: b1926f88b7a7c7aa1e1be7663f9c38482d53ddb44d3c3c13ea8a2d20c3a92715fcacad8b92643fbdd55d107eba146ae638edca6c2bf972446cb11d649bc6f794
@@ -6,9 +6,9 @@ Gem::Specification.new do |spec|
6
6
  spec.authors = ["Aitaro Chaya"]
7
7
  spec.email = ["aitaro.chaya@gmail.com"]
8
8
 
9
- spec.summary = %q{Write a short summary, because RubyGems requires one.}
10
- spec.description = %q{Write a longer description or delete this line.}
11
- spec.homepage = "https://github.com/aitaro"
9
+ spec.summary = %q{usefull toolkit for atcoder}
10
+ spec.description = %q{This gem enables download test cases, test automatically and submit code.}
11
+ spec.homepage = "https://github.com/aitaro/atcoder_tools"
12
12
  spec.license = "MIT"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
14
 
@@ -29,11 +29,19 @@ class Atcoder
29
29
  # 引数はcontest, taskクラス
30
30
  def submit(task)
31
31
  response = nil
32
- @agent.get(task_url(task)) do |page|
32
+ language_id = nil
33
+ case task.contest.language
34
+ when "ruby"
35
+ language_id = "4049"
36
+ when "c++(gcc)"
37
+ language_id = "4003"
38
+ end
39
+
40
+ @agent.get(task_url(task)) do |page|
33
41
  # 1つ目のフォームはログアウト用なので2つ目を使用
34
42
  form = page.forms.last
35
- form.field_with(name: 'data.LanguageId').value = "4049"
36
- form.field_with(name: 'sourceCode').value = task.code
43
+ form.field_with(name: 'data.LanguageId').value = language_id
44
+ form.field_with(name: 'sourceCode').value = task.code
37
45
  response = @agent.submit(form)
38
46
  end
39
47
 
@@ -1,3 +1,3 @@
1
1
  module AtcoderTools
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atcoder_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aitaro Chaya
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description: Write a longer description or delete this line.
97
+ description: This gem enables download test cases, test automatically and submit code.
98
98
  email:
99
99
  - aitaro.chaya@gmail.com
100
100
  executables:
@@ -126,7 +126,7 @@ files:
126
126
  - lib/atcoder_tools/sources/task.rb.erb
127
127
  - lib/atcoder_tools/task.rb
128
128
  - lib/atcoder_tools/version.rb
129
- homepage: https://github.com/aitaro
129
+ homepage: https://github.com/aitaro/atcoder_tools
130
130
  licenses:
131
131
  - MIT
132
132
  metadata: {}
@@ -148,5 +148,5 @@ requirements: []
148
148
  rubygems_version: 3.1.2
149
149
  signing_key:
150
150
  specification_version: 4
151
- summary: Write a short summary, because RubyGems requires one.
151
+ summary: usefull toolkit for atcoder
152
152
  test_files: []