at_coder_friends 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile.lock +10 -7
- data/README.md +12 -8
- data/at_coder_friends.gemspec +1 -0
- data/lib/at_coder_friends/cli.rb +11 -4
- data/lib/at_coder_friends/scraping_agent.rb +5 -0
- data/lib/at_coder_friends/version.rb +1 -1
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c01f28420d768fccb30960702213d768caeaefd54cb9686cb0bafb3591ba44d
|
4
|
+
data.tar.gz: 35acd1fb67232149a831394b4afa34f5eb1ade9e2ea3658d03d0ec191566975b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6015841608385002fea3d1ff31f738f92719ce7fca2d9331e68c44aef8605ba31047194a6e4a53229062110dd2cd55067932baa0c1e44e2628041e5bc72468e4
|
7
|
+
data.tar.gz: 8a96a65f43b823666914b86eeba623bf0ae15074406c1ad432d55163c9e8b5d88625e7d08046a1db5d8b0698738bb0fcb5c9b7060a9b5a7232202242f2774ea1
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
at_coder_friends (0.3.
|
4
|
+
at_coder_friends (0.3.3)
|
5
|
+
launchy (~> 2.4.3)
|
5
6
|
mechanize (~> 2.0)
|
6
7
|
|
7
8
|
GEM
|
@@ -14,12 +15,14 @@ GEM
|
|
14
15
|
safe_yaml (~> 1.0.0)
|
15
16
|
diff-lcs (1.3)
|
16
17
|
docile (1.3.1)
|
17
|
-
domain_name (0.5.
|
18
|
+
domain_name (0.5.20190701)
|
18
19
|
unf (>= 0.0.5, < 1.0.0)
|
19
20
|
hashdiff (0.3.8)
|
20
21
|
http-cookie (1.0.3)
|
21
22
|
domain_name (~> 0.5)
|
22
23
|
json (2.1.0)
|
24
|
+
launchy (2.4.3)
|
25
|
+
addressable (~> 2.3)
|
23
26
|
mechanize (2.7.6)
|
24
27
|
domain_name (~> 0.5, >= 0.5.1)
|
25
28
|
http-cookie (~> 1.0)
|
@@ -31,12 +34,12 @@ GEM
|
|
31
34
|
webrobots (>= 0.0.9, < 0.2)
|
32
35
|
mime-types (3.2.2)
|
33
36
|
mime-types-data (~> 3.2015)
|
34
|
-
mime-types-data (3.
|
37
|
+
mime-types-data (3.2019.0331)
|
35
38
|
mini_portile2 (2.4.0)
|
36
39
|
net-http-digest_auth (1.4.1)
|
37
|
-
net-http-persistent (3.
|
40
|
+
net-http-persistent (3.1.0)
|
38
41
|
connection_pool (~> 2.2)
|
39
|
-
nokogiri (1.10.
|
42
|
+
nokogiri (1.10.4)
|
40
43
|
mini_portile2 (~> 2.4.0)
|
41
44
|
ntlm-http (0.1.1)
|
42
45
|
public_suffix (3.0.3)
|
@@ -62,7 +65,7 @@ GEM
|
|
62
65
|
simplecov-html (0.10.2)
|
63
66
|
unf (0.1.4)
|
64
67
|
unf_ext
|
65
|
-
unf_ext (0.0.7.
|
68
|
+
unf_ext (0.0.7.6)
|
66
69
|
webmock (3.5.1)
|
67
70
|
addressable (>= 2.3.6)
|
68
71
|
crack (>= 0.3.2)
|
@@ -82,4 +85,4 @@ DEPENDENCIES
|
|
82
85
|
webmock (~> 3.0)
|
83
86
|
|
84
87
|
BUNDLED WITH
|
85
|
-
1.
|
88
|
+
1.17.3
|
data/README.md
CHANGED
@@ -16,10 +16,6 @@ AtCoderFriends automates tasks about [AtCoder](https://atcoder.jp/) programming
|
|
16
16
|
|
17
17
|
## Installation
|
18
18
|
|
19
|
-
<!--
|
20
|
-
See [Development](#Develoment).
|
21
|
-
-->
|
22
|
-
|
23
19
|
Add this line to your application's Gemfile:
|
24
20
|
|
25
21
|
```ruby
|
@@ -32,7 +28,7 @@ And then execute:
|
|
32
28
|
|
33
29
|
Or install it yourself as:
|
34
30
|
|
35
|
-
$ gem install at_coder_friends
|
31
|
+
$ gem install at_coder_friends
|
36
32
|
|
37
33
|
## Configuration
|
38
34
|
|
@@ -53,6 +49,13 @@ at_coder_friends setup /path/to/contest
|
|
53
49
|
|
54
50
|
Creates contest folder, and generates example data and source skeletons into the folder.
|
55
51
|
|
52
|
+
### Open Contest Page
|
53
|
+
|
54
|
+
```
|
55
|
+
at_coder_friends open-contest /path/to/contest/source_file
|
56
|
+
```
|
57
|
+
|
58
|
+
Opens the contet page which the contest folder linked to.
|
56
59
|
|
57
60
|
### Run first test case
|
58
61
|
|
@@ -75,7 +78,7 @@ at_coder_friends submit /path/to/contest/source_file
|
|
75
78
|
### Naming Convention
|
76
79
|
|
77
80
|
- Contest folder name will be used in the contest site URL.
|
78
|
-
For example, if ```arc001``` folder is specified, AtCoderFriends will use ```
|
81
|
+
For example, if ```arc001``` folder is specified, AtCoderFriends will use ```https://atcoder.jp/contests/arc001/```.
|
79
82
|
- Source file should be named ```[problem ID].[language specific extension]```(e.g. ```A.rb```),
|
80
83
|
in order to let AtCoderFriends find test cases or fill the submission form.
|
81
84
|
- Suffixes (start with underscore) may be added to the file name (e.g. ```A_v2.rb```),
|
@@ -97,9 +100,10 @@ It is convenient to use AtCoderFriends from Sublime Text plugin.
|
|
97
100
|
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.
|
98
101
|
|
99
102
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
100
|
-
|
103
|
+
|
104
|
+
<!--
|
101
105
|
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).
|
102
|
-
|
106
|
+
-->
|
103
107
|
|
104
108
|
## Contributing
|
105
109
|
|
data/at_coder_friends.gemspec
CHANGED
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.required_ruby_version = '>= 2.3.0'
|
32
32
|
|
33
33
|
spec.add_dependency 'mechanize', '~> 2.0'
|
34
|
+
spec.add_dependency 'launchy', '~> 2.4.3'
|
34
35
|
|
35
36
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
36
37
|
spec.add_development_dependency 'rake', '~> 10.0'
|
data/lib/at_coder_friends/cli.rb
CHANGED
@@ -11,10 +11,11 @@ module AtCoderFriends
|
|
11
11
|
OPTION_BANNER =
|
12
12
|
<<~TEXT
|
13
13
|
Usage:
|
14
|
-
at_coder_friends setup
|
15
|
-
at_coder_friends test-one
|
16
|
-
at_coder_friends test-all
|
17
|
-
at_coder_friends submit
|
14
|
+
at_coder_friends setup path/contest # setup contest folder
|
15
|
+
at_coder_friends test-one path/contest/src # run 1st test case
|
16
|
+
at_coder_friends test-all path/contest/src # run all test cases
|
17
|
+
at_coder_friends submit path/contest/src # submit source code
|
18
|
+
at_coder_friends open-contest path/contest/src # open contest page
|
18
19
|
Options:
|
19
20
|
TEXT
|
20
21
|
STATUS_SUCCESS = 0
|
@@ -72,6 +73,8 @@ module AtCoderFriends
|
|
72
73
|
judge_one(path, id)
|
73
74
|
when 'judge-all'
|
74
75
|
judge_all(path)
|
76
|
+
when 'open-contest'
|
77
|
+
open_contest(path)
|
75
78
|
else
|
76
79
|
raise ParamError, "unknown command: #{command}"
|
77
80
|
end
|
@@ -118,5 +121,9 @@ module AtCoderFriends
|
|
118
121
|
def judge_all(path)
|
119
122
|
JudgeTestRunner.new(path).judge_all
|
120
123
|
end
|
124
|
+
|
125
|
+
def open_contest(path)
|
126
|
+
ScrapingAgent.new(contest_name(path), @config).open_contest
|
127
|
+
end
|
121
128
|
end
|
122
129
|
end
|
@@ -4,6 +4,7 @@ require 'uri'
|
|
4
4
|
require 'mechanize'
|
5
5
|
require 'logger'
|
6
6
|
require 'English'
|
7
|
+
require 'launchy'
|
7
8
|
|
8
9
|
module AtCoderFriends
|
9
10
|
# scrapes AtCoder contest site and
|
@@ -143,5 +144,9 @@ module AtCoderFriends
|
|
143
144
|
form.field_with(name: 'sourceCode').value = src
|
144
145
|
form.submit
|
145
146
|
end
|
147
|
+
|
148
|
+
def open_contest
|
149
|
+
Launchy.open(contest_url(''))
|
150
|
+
end
|
146
151
|
end
|
147
152
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: at_coder_friends
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nejiko96
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01
|
11
|
+
date: 2019-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: launchy
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.4.3
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.4.3
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,8 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
172
|
- !ruby/object:Gem::Version
|
159
173
|
version: '0'
|
160
174
|
requirements: []
|
161
|
-
|
162
|
-
rubygems_version: 2.7.5
|
175
|
+
rubygems_version: 3.0.6
|
163
176
|
signing_key:
|
164
177
|
specification_version: 4
|
165
178
|
summary: AtCoder support tool
|