green_day 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +2 -2
- data/.gitignore +0 -1
- data/README.md +1 -3
- data/green_day.gemspec +2 -0
- data/lib/green_day/atcoder_client.rb +1 -1
- data/lib/green_day/cli.rb +2 -4
- data/lib/green_day/contest.rb +6 -3
- data/lib/green_day/version.rb +1 -1
- data/lib/green_day.rb +1 -0
- metadata +18 -4
- data/.env.sample +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06bcfc1dc4b42165710a01e2d1d4836e0ad829a4b33040d5f35613b836ce15af
|
4
|
+
data.tar.gz: 39899f57ae69c44e702b7a9a0990e332d8842867584fe97462f01d89edcae461
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54eacd28a4a76464d6a740bc6b670ecf33c8f264cc33b3e32cd8943d6df3f5e85d822c21f09712cf339e0c5d8e2f43626a9d845c8f84c31e0d8b1e818aecfc8a
|
7
|
+
data.tar.gz: 16e9b1390526d3d55ea2eeaef27f964844aaf23997236f108efecbc8bd2f781c04e04bef3b3a100248072205b075425eb09d7eb016cdbab7ddade4c3598cda2f
|
data/.github/workflows/ruby.yml
CHANGED
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# GreenDay
|
2
|
-
|
2
|
+
Green Day creates workspaces and tests for Atcoder contests
|
3
3
|
(日本語で解説した記事は[こちら](https://qiita.com/QWYNG/items/0e2e6b72bd1969d0d751))
|
4
4
|
## Installation
|
5
5
|
|
@@ -86,8 +86,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
86
86
|
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).
|
87
87
|
|
88
88
|
## Contributing
|
89
|
-
You need create `.env` and set `USER_NAME` and `PASSWORD` for spec. see `env.sample`
|
90
|
-
Those env is already set as secret on CI.
|
91
89
|
Bug reports and pull requests are welcome on GitHub at https://github.com/QWYNG/green_day. 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.
|
92
90
|
|
93
91
|
## License
|
data/green_day.gemspec
CHANGED
@@ -41,4 +41,6 @@ Gem::Specification.new do |spec|
|
|
41
41
|
spec.add_development_dependency 'rubocop'
|
42
42
|
spec.add_development_dependency 'rubocop-rake'
|
43
43
|
spec.add_development_dependency 'rubocop-rspec'
|
44
|
+
spec.add_development_dependency 'vcr'
|
45
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
44
46
|
end
|
@@ -30,7 +30,7 @@ module GreenDay
|
|
30
30
|
|
31
31
|
# 3問だったら<tbody>の中に<tr>が3 * 2個 </tbody> が1mh個
|
32
32
|
tasks_size = ((body.at('tbody').children.size - 1) / 2.0).ceil
|
33
|
-
('A'..'
|
33
|
+
('A'..'ZZ').to_a.shift(tasks_size)
|
34
34
|
end
|
35
35
|
|
36
36
|
def fetch_inputs_and_outputs(contest, task)
|
data/lib/green_day/cli.rb
CHANGED
@@ -29,7 +29,7 @@ module GreenDay
|
|
29
29
|
contest = Contest.new(contest_name, AtcoderClient.new)
|
30
30
|
FileUtils.makedirs("#{contest.name}/spec")
|
31
31
|
|
32
|
-
Parallel.each(contest.tasks) do |task|
|
32
|
+
Parallel.each(contest.tasks, in_threads: THREAD_COUNT) do |task|
|
33
33
|
create_submit_file(task)
|
34
34
|
create_spec_file(task)
|
35
35
|
end
|
@@ -49,9 +49,7 @@ module GreenDay
|
|
49
49
|
submit_file_path(task),
|
50
50
|
task.sample_answers
|
51
51
|
)
|
52
|
-
File.
|
53
|
-
f.write(test)
|
54
|
-
end
|
52
|
+
File.write(spec_file_path(task), test)
|
55
53
|
end
|
56
54
|
|
57
55
|
def submit_file_path(task)
|
data/lib/green_day/contest.rb
CHANGED
@@ -11,9 +11,12 @@ module GreenDay
|
|
11
11
|
raise GreenDay::Error 'cant find contest' unless client.contest_exist?(contest_name)
|
12
12
|
|
13
13
|
@name = contest_name
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
|
15
|
+
task_codes = client.fetch_task_codes(self)
|
16
|
+
@tasks =
|
17
|
+
Parallel.map(task_codes, in_threads: THREAD_COUNT) do |task_code|
|
18
|
+
Task.new(self, task_code, client)
|
19
|
+
end
|
17
20
|
end
|
18
21
|
end
|
19
22
|
end
|
data/lib/green_day/version.rb
CHANGED
data/lib/green_day.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: green_day
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- qwyng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -220,6 +220,20 @@ dependencies:
|
|
220
220
|
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: vcr
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
223
237
|
description: CLI tool for AtCoder and Ruby
|
224
238
|
email:
|
225
239
|
- ikusawasi@gmail.com
|
@@ -228,7 +242,6 @@ executables:
|
|
228
242
|
extensions: []
|
229
243
|
extra_rdoc_files: []
|
230
244
|
files:
|
231
|
-
- ".env.sample"
|
232
245
|
- ".github/workflows/ruby.yml"
|
233
246
|
- ".gitignore"
|
234
247
|
- ".rspec"
|
@@ -255,6 +268,7 @@ licenses:
|
|
255
268
|
metadata:
|
256
269
|
homepage_uri: https://github.com/QWYNG/green_day
|
257
270
|
source_code_uri: https://github.com/QWYNG/green_day
|
271
|
+
rubygems_mfa_required: 'true'
|
258
272
|
post_install_message:
|
259
273
|
rdoc_options: []
|
260
274
|
require_paths:
|
@@ -270,7 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
284
|
- !ruby/object:Gem::Version
|
271
285
|
version: '0'
|
272
286
|
requirements: []
|
273
|
-
rubygems_version: 3.
|
287
|
+
rubygems_version: 3.1.6
|
274
288
|
signing_key:
|
275
289
|
specification_version: 4
|
276
290
|
summary: CLI tool for AtCoder and Ruby
|
data/.env.sample
DELETED