atcoder_tools 0.2.0 → 1.0.3

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: e5d0c7a03c8491024c16d6ae87c288f04954180fe6bd3e189db5e3d8118faebf
4
- data.tar.gz: 4967f7572872f9e90d1a30753a6c9c2c810392a5a78ee4936580de2b2016fe02
3
+ metadata.gz: 6f865c445638ab40097c740ebab07687f10fcb7a1e901397db8e37b1c17a6094
4
+ data.tar.gz: 805f68df5b5901dd3ed967cac5d7454b077691e75d5ec28e8ffda9beb0aec851
5
5
  SHA512:
6
- metadata.gz: b36e09e331d51158b46712cfa49e585b18e1be0e72385463b49fcc4bb0cc86060ffed4968469e9be0fd9dc48d8e1f4bae559ab98e526a0938e9b343c47510282
7
- data.tar.gz: d758c5a868d0df29e73e9be659f6499eb383301dfca75835ccdcd210e34634d7307df61e7a5ac525a5f560a119dff2ebefa18858871aab27f5ca999c8ba8ccec
6
+ metadata.gz: 1bfe15eddb7ed4d59e129ab120ca609625ecec5b88c077277eded6bdf320d16f415fa6765e9aa0096837c4013b5233a8411df47eff27de72e2601dc9859489da
7
+ data.tar.gz: d78fbeebaa01999231a883e167055350ac3485da5fbc8957d1dfa02eb8fa297c6b00818fcb746d48bb57cf21fa10d136ff7883c45bcbf49c8d493dc2eb96355b
@@ -2,8 +2,8 @@ name: Publish Gem
2
2
 
3
3
  on:
4
4
  push:
5
- tags:
6
- - v*
5
+ branch:
6
+ - master
7
7
  jobs:
8
8
  build:
9
9
  runs-on: ubuntu-latest
@@ -19,36 +19,26 @@ jobs:
19
19
 
20
20
  - name: Build Gem
21
21
  run: rake build
22
-
23
- - name: Publish gem
24
- uses: dawidd6/action-publish-gem@v1
25
- with:
26
- api_key: ${{secrets.RUBYGEMS_API_KEY}}
27
-
28
- # - name: mkdir gem
29
- # run: mkdir ~/.gem
30
22
 
31
- # - name: Add api key
32
- # run: "echo :rubygems_api_key: $RUBYGEMS_API_KEY > ~/.gem/credentials"
33
- # env:
34
- # RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
23
+ - name: mkdir gem
24
+ run: mkdir ~/.gem
35
25
 
36
- # - name: test
37
- # run: cat ~/.gem/credentials
26
+ - name: Add api key
27
+ run: "echo :rubygems_api_key: $RUBYGEMS_API_KEY > ~/.gem/credentials"
28
+ env:
29
+ RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
38
30
 
39
- # - name: test2
40
- # run: git status
31
+ - name: change chmod
32
+ run: chmod 0600 ~/.gem/credentials
41
33
 
42
- # - name: test3
43
- # run: "echo $RUBYGEMS_API_KEY"
44
- # env:
45
- # RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
46
-
47
- # - name: set git username
48
- # run: git config user.name "Aitaro Chaya"
34
+ - name: set git username
35
+ run: git config user.name "Aitaro Chaya"
49
36
 
50
- # - name: set git email
51
- # run: git config user.email "aitaro.chaya@gmail.com"
37
+ - name: set git email
38
+ run: git config user.email "aitaro.chaya@gmail.com"
39
+
40
+ - name: checkout
41
+ run: git checkout master
52
42
 
53
- # - name: Release Gem
54
- # run: rake release
43
+ - name: Release Gem
44
+ run: rake release
data/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # AtcoderTools
2
+ [![Publish Gem](https://github.com/aitaro/atcoder_tools/workflows/Publish%20Gem/badge.svg)](https://github.com/aitaro/atcoder_tools/actions?query=workflow%3A%22Publish+Gem%22)
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![Gem Version](https://badge.fury.io/rb/atcoder_tools.svg)](https://badge.fury.io/rb/atcoder_tools)
5
+ [![Code Climate](https://codeclimate.com/github/aitaro/atcoder_tools.png)](https://codeclimate.com/github/aitaro/atcoder_tools)
6
+
2
7
  Atcoderの競技環境を簡単にsetupするためのツールです。
8
+ 現在 rubyとc++に対応しています。
3
9
 
4
10
  ## インストール
5
11
  ```bash
@@ -7,10 +13,16 @@ $ gem install atcoder_tools
7
13
  ```
8
14
 
9
15
  ## 使い方
16
+ ### 言語の変更
17
+ ```
18
+ $ atcoder_tools language
19
+ ```
20
+
10
21
  ### atcoderにログイン
11
22
  ```
12
23
  $ atcoder_tools login
13
24
  ```
25
+ コマンドを実行すると、user_nameとpasswordの入力画面になります。
14
26
 
15
27
  ### コンテスト用ファイルの作成
16
28
  ```
@@ -24,18 +36,18 @@ $ atcoder_tools start
24
36
 
25
37
  ### コンテストの提出
26
38
  ```
27
- $ atcoder_tools submit abc170
39
+ $ atcoder_tools submit
28
40
  ```
29
41
 
30
42
  ### コンテストの削除
31
43
  ```
32
- $ atcoder_tools delete abc170
44
+ $ atcoder_tools delete
33
45
  ```
34
46
 
35
47
  ### MODEについて
36
48
  - NONE: なにもおこらない
37
49
  - DEBUG: 標準入力で、testcaseが渡されたら状態で実行される。
38
- - RUN: 単純にファイルを実行。標準入力は自分で渡す。
50
+ - RUN: ファイルを実行。標準入力は自分で渡す。
39
51
  - TEST: rspecを用いたテスト自動実行。どれが通っていてどれが通っていないかわかる。
40
52
 
41
53
  ## Development
@@ -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 = "0.2.0"
2
+ VERSION = "1.0.3"
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: 0.2.0
4
+ version: 1.0.3
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: []