green_day 0.3.0 → 0.5.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/publish_to_rubygems.yml +31 -0
- data/.github/workflows/ruby.yml +25 -10
- data/.gitignore +0 -1
- data/.rubocop.yml +12 -1
- data/README.md +2 -6
- data/green_day.gemspec +8 -2
- data/lib/green_day/atcoder_client.rb +8 -31
- data/lib/green_day/cli.rb +17 -22
- data/lib/green_day/contest.rb +23 -6
- data/lib/green_day/task.rb +23 -12
- data/lib/green_day/test_builder.rb +0 -2
- data/lib/green_day/version.rb +1 -1
- data/lib/green_day.rb +1 -0
- metadata +72 -16
- data/.env.sample +0 -3
- data/lib/green_day/snippet_builder.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6db900740eb86bf00384ad3f97895ecd146d5f112f96db362c28a28cbfb391f
|
4
|
+
data.tar.gz: c4f4a09dd97c634b671434735896294c13f5ad3992d97378db3cde64e804efae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15d1dfd04be33f629ec7f6f74ff7666175e39bd62e3dcb80f2d5ae936c86001ba479db6fe2a084839d7e12fedaede50b3d85c9c65d4ae9c88700127204c4a33e
|
7
|
+
data.tar.gz: c5e5b31671f907460705f3baac9e9ebc6a0142fb3d2678e1783b3b8a382e266cb06cf4e793a096768632b8451f2925d6968550c32ae5ef355738f3ee23e8153c
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: Publish to RubyGems
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
name: Build + Publish
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
permissions:
|
11
|
+
packages: write
|
12
|
+
contents: read
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v3
|
16
|
+
- name: Set up Ruby 3.1
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: 3.1
|
20
|
+
- run: bundle install
|
21
|
+
|
22
|
+
- name: Publish to RubyGems
|
23
|
+
run: |
|
24
|
+
mkdir -p $HOME/.gem
|
25
|
+
touch $HOME/.gem/credentials
|
26
|
+
chmod 0600 $HOME/.gem/credentials
|
27
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
28
|
+
gem build *.gemspec
|
29
|
+
gem push *.gem
|
30
|
+
env:
|
31
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
data/.github/workflows/ruby.yml
CHANGED
@@ -10,19 +10,34 @@ jobs:
|
|
10
10
|
runs-on: ubuntu-latest
|
11
11
|
strategy:
|
12
12
|
matrix:
|
13
|
-
ruby:
|
14
|
-
- 2.7.1
|
13
|
+
ruby-version:
|
14
|
+
- 2.7.1 # AtCoder公式が使用しているrubyは2.7.1
|
15
|
+
- 3.1
|
15
16
|
steps:
|
16
|
-
- uses: actions/checkout@
|
17
|
-
- name: Set up Ruby ${{ matrix.ruby }}
|
18
|
-
uses:
|
17
|
+
- uses: actions/checkout@v3
|
18
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
19
|
+
uses: ruby/setup-ruby@v1
|
19
20
|
with:
|
20
|
-
ruby-version: ${{ matrix.ruby }}
|
21
|
-
- name:
|
21
|
+
ruby-version: ${{ matrix.ruby-version }}
|
22
|
+
- name: Bundle install
|
23
|
+
run: bundle install
|
24
|
+
- name: Run Rspec
|
22
25
|
env:
|
23
26
|
USER_NAME: ${{ secrets.USER_NAME }}
|
24
27
|
PASSWORD: ${{ secrets.PASSWORD }}
|
25
28
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
26
|
-
run:
|
27
|
-
|
28
|
-
|
29
|
+
run: script -e -c "rake spec"
|
30
|
+
rubocop:
|
31
|
+
runs-on: ubuntu-latest
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@v3
|
34
|
+
- uses: ruby/setup-ruby@v1
|
35
|
+
with:
|
36
|
+
ruby-version: 3.1
|
37
|
+
- name: Bundle install
|
38
|
+
run: bundle install
|
39
|
+
- name: Run rubocop
|
40
|
+
run: bundle exec rubocop
|
41
|
+
|
42
|
+
|
43
|
+
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rake
|
3
|
+
- rubocop-rspec
|
4
|
+
|
1
5
|
AllCops:
|
6
|
+
NewCops: enable
|
2
7
|
Exclude:
|
3
8
|
- 'spec/spec_helper.rb'
|
4
9
|
Style/Documentation:
|
@@ -9,5 +14,11 @@ Layout/LineLength:
|
|
9
14
|
Max: 90
|
10
15
|
Metrics/BlockLength:
|
11
16
|
Exclude:
|
12
|
-
- 'spec
|
17
|
+
- 'spec/*/**'
|
13
18
|
- 'green_day.gemspec'
|
19
|
+
RSpec/NamedSubject:
|
20
|
+
Enabled: false
|
21
|
+
RSpec/NestedGroups:
|
22
|
+
Max: 7
|
23
|
+
RSpec/ExampleLength:
|
24
|
+
Enabled: false
|
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
|
|
@@ -52,8 +52,6 @@ For example
|
|
52
52
|
Example of output spec
|
53
53
|
|
54
54
|
```ruby
|
55
|
-
require 'rspec'
|
56
|
-
|
57
55
|
RSpec.describe 'test' do
|
58
56
|
it 'test with "2 900\\n"' do
|
59
57
|
io = IO.popen("ruby abc150/A.rb", "w+")
|
@@ -86,8 +84,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
86
84
|
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
85
|
|
88
86
|
## 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
87
|
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
88
|
|
93
89
|
## License
|
@@ -96,4 +92,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
96
92
|
|
97
93
|
## Code of Conduct
|
98
94
|
|
99
|
-
Everyone interacting in the GreenDay project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
95
|
+
Everyone interacting in the GreenDay project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/QWYNG/green_day/blob/master/CODE_OF_CONDUCT.md).
|
data/green_day.gemspec
CHANGED
@@ -5,6 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require 'green_day/version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
+
spec.required_ruby_version = '>= 2.7.1'
|
8
9
|
spec.name = 'green_day'
|
9
10
|
spec.executables = ['green_day']
|
10
11
|
spec.version = GreenDay::VERSION
|
@@ -26,15 +27,20 @@ Gem::Specification.new do |spec|
|
|
26
27
|
spec.require_paths = ['lib']
|
27
28
|
|
28
29
|
spec.add_dependency 'colorize'
|
29
|
-
spec.add_dependency 'faraday'
|
30
|
+
spec.add_dependency 'faraday'
|
30
31
|
spec.add_dependency 'faraday-cookie_jar'
|
31
32
|
spec.add_dependency 'nokogiri'
|
32
33
|
spec.add_dependency 'parallel'
|
33
|
-
spec.add_dependency 'rspec', '~> 3.0'
|
34
34
|
spec.add_dependency 'thor'
|
35
|
+
spec.add_dependency 'webrick'
|
35
36
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
36
37
|
spec.add_development_dependency 'codecov'
|
37
38
|
spec.add_development_dependency 'dotenv'
|
38
39
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
40
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
39
41
|
spec.add_development_dependency 'rubocop'
|
42
|
+
spec.add_development_dependency 'rubocop-rake'
|
43
|
+
spec.add_development_dependency 'rubocop-rspec'
|
44
|
+
spec.add_development_dependency 'vcr'
|
45
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
40
46
|
end
|
@@ -20,28 +20,9 @@ module GreenDay
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
24
|
-
res = client.get(
|
25
|
-
res.
|
26
|
-
end
|
27
|
-
|
28
|
-
def fetch_task_codes(contest)
|
29
|
-
body = get_parsed_body("contests/#{contest.name}/tasks")
|
30
|
-
|
31
|
-
# 3問だったら<tbody>の中に<tr>が3 * 2個 </tbody> が1mh個
|
32
|
-
tasks_size = ((body.at('tbody').children.size - 1) / 2.0).ceil
|
33
|
-
('A'..'Z').to_a.shift(tasks_size)
|
34
|
-
end
|
35
|
-
|
36
|
-
def fetch_inputs_and_outputs(contest, task)
|
37
|
-
contest_name = contest.name
|
38
|
-
path = "contests/#{contest_name}/tasks/#{contest_name}_#{task.code.downcase}"
|
39
|
-
body = get_parsed_body(path)
|
40
|
-
samples = body.css('.lang-ja > .part > section > pre').map { |e| e.children.text }
|
41
|
-
|
42
|
-
inputs, outputs = samples.partition.with_index { |_sample, i| i.even? }
|
43
|
-
|
44
|
-
[inputs, outputs]
|
23
|
+
def get_parsed_body(path)
|
24
|
+
res = client.get(path)
|
25
|
+
Nokogiri::HTML.parse(res.body)
|
45
26
|
end
|
46
27
|
|
47
28
|
def login(username, password)
|
@@ -54,7 +35,7 @@ module GreenDay
|
|
54
35
|
|
55
36
|
unless login_succeed?
|
56
37
|
## ex error:Username or Password is incorrect
|
57
|
-
raise Error, CGI.unescape(
|
38
|
+
raise Error, CGI.unescape(flash_cookie.value).split('.').shift
|
58
39
|
end
|
59
40
|
|
60
41
|
cookie_jar.save(COOKIE_FILE_NAME)
|
@@ -83,17 +64,13 @@ module GreenDay
|
|
83
64
|
end
|
84
65
|
|
85
66
|
def login_succeed?
|
86
|
-
flash_cookie = select_flash_cookie
|
87
67
|
flash_cookie.value.include?('Welcome')
|
88
68
|
end
|
89
69
|
|
90
|
-
def
|
91
|
-
cookie_jar.
|
92
|
-
|
93
|
-
|
94
|
-
def get_parsed_body(path)
|
95
|
-
res = client.get(path)
|
96
|
-
Nokogiri::HTML.parse(res.body)
|
70
|
+
def flash_cookie
|
71
|
+
@flash_cookie ||= cookie_jar.cookies("#{ATCODER_ENDPOINT}/login").find do |cookie|
|
72
|
+
cookie.name == 'REVEL_FLASH'
|
73
|
+
end
|
97
74
|
end
|
98
75
|
end
|
99
76
|
end
|
data/lib/green_day/cli.rb
CHANGED
@@ -7,16 +7,15 @@ require 'io/console'
|
|
7
7
|
require_relative 'atcoder_client'
|
8
8
|
require_relative 'contest'
|
9
9
|
require_relative 'test_builder'
|
10
|
-
require_relative 'snippet_builder'
|
11
10
|
|
12
11
|
module GreenDay
|
13
12
|
class Cli < Thor
|
14
13
|
desc 'login Atcoder', 'login Atcoder and save session'
|
15
14
|
def login
|
16
15
|
print 'username:'
|
17
|
-
username =
|
16
|
+
username = $stdin.gets(chomp: true)
|
18
17
|
print 'password:'
|
19
|
-
password =
|
18
|
+
password = $stdin.noecho { |stdin| stdin.gets(chomp: true) }.tap { puts }
|
20
19
|
|
21
20
|
AtcoderClient.new.login(username, password)
|
22
21
|
puts(
|
@@ -28,41 +27,37 @@ module GreenDay
|
|
28
27
|
desc 'new [contest name]', 'create contest workspace and spec'
|
29
28
|
def new(contest_name)
|
30
29
|
contest = Contest.new(contest_name, AtcoderClient.new)
|
31
|
-
FileUtils.makedirs("#{
|
30
|
+
FileUtils.makedirs("#{contest.name}/spec")
|
32
31
|
|
33
|
-
Parallel.each(contest.tasks) do |task|
|
34
|
-
create_submit_file
|
35
|
-
create_spec_file
|
32
|
+
Parallel.each(contest.tasks, in_threads: THREAD_COUNT) do |task|
|
33
|
+
create_submit_file(task)
|
34
|
+
create_spec_file(task)
|
36
35
|
end
|
37
36
|
|
38
|
-
puts "Successfully created #{
|
37
|
+
puts "Successfully created #{contest.name} directory".colorize(:green)
|
39
38
|
end
|
40
39
|
|
41
40
|
private
|
42
41
|
|
43
|
-
def create_submit_file
|
44
|
-
File.open(submit_file_path(
|
45
|
-
f.write(SnippetBuilder.build)
|
46
|
-
end
|
42
|
+
def create_submit_file(task)
|
43
|
+
File.open(submit_file_path(task), 'w')
|
47
44
|
end
|
48
45
|
|
49
|
-
def create_spec_file
|
46
|
+
def create_spec_file(task)
|
50
47
|
test =
|
51
48
|
TestBuilder.build_test(
|
52
|
-
submit_file_path(
|
53
|
-
task.
|
49
|
+
submit_file_path(task),
|
50
|
+
task.sample_answers
|
54
51
|
)
|
55
|
-
File.
|
56
|
-
f.write(test)
|
57
|
-
end
|
52
|
+
File.write(spec_file_path(task), test)
|
58
53
|
end
|
59
54
|
|
60
|
-
def submit_file_path(
|
61
|
-
"#{
|
55
|
+
def submit_file_path(task)
|
56
|
+
"#{task.contest.name}/#{task.name}.rb"
|
62
57
|
end
|
63
58
|
|
64
|
-
def spec_file_path(
|
65
|
-
"#{
|
59
|
+
def spec_file_path(task)
|
60
|
+
"#{task.contest.name}/spec/#{task.name}_spec.rb"
|
66
61
|
end
|
67
62
|
end
|
68
63
|
end
|
data/lib/green_day/contest.rb
CHANGED
@@ -1,18 +1,35 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require 'forwardable'
|
4
4
|
require_relative 'task'
|
5
5
|
|
6
6
|
module GreenDay
|
7
7
|
class Contest
|
8
|
-
|
8
|
+
extend Forwardable
|
9
|
+
delegate get_parsed_body: :@client
|
9
10
|
|
10
|
-
|
11
|
-
raise GreenDay::Error 'cant find contest' unless client.contest_exist?(contest_name)
|
11
|
+
attr_reader :name, :tasks
|
12
12
|
|
13
|
+
def initialize(contest_name, client)
|
14
|
+
@client = client
|
13
15
|
@name = contest_name
|
14
|
-
|
15
|
-
|
16
|
+
|
17
|
+
task_names_and_paths = fetch_task_names_and_paths
|
18
|
+
@tasks =
|
19
|
+
Parallel.map(task_names_and_paths,
|
20
|
+
in_threads: THREAD_COUNT) do |task_name, task_path|
|
21
|
+
Task.new(self, task_name, task_path, @client)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def fetch_task_names_and_paths
|
28
|
+
body = get_parsed_body("contests/#{name}/tasks")
|
29
|
+
task_elements = body.search('tbody tr td:first a')
|
30
|
+
|
31
|
+
task_elements.to_h do |element|
|
32
|
+
[element.text, element[:href]]
|
16
33
|
end
|
17
34
|
end
|
18
35
|
end
|
data/lib/green_day/task.rb
CHANGED
@@ -1,26 +1,37 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'forwardable'
|
4
|
+
|
3
5
|
module GreenDay
|
4
6
|
class Task
|
5
|
-
|
6
|
-
|
7
|
+
extend Forwardable
|
8
|
+
delegate get_parsed_body: :@client
|
9
|
+
|
10
|
+
attr_reader :contest, :name, :path, :sample_answers
|
11
|
+
|
12
|
+
def initialize(contest, name, path, client)
|
13
|
+
@client = client
|
7
14
|
@contest = contest
|
8
|
-
@
|
9
|
-
@
|
15
|
+
@name = name
|
16
|
+
@path = path
|
17
|
+
@sample_answers = create_sample_answers_hash
|
10
18
|
end
|
11
19
|
|
12
20
|
private
|
13
21
|
|
14
|
-
def
|
15
|
-
input_samples, output_samples =
|
16
|
-
|
22
|
+
def create_sample_answers_hash
|
23
|
+
input_samples, output_samples = fetch_inputs_and_outputs
|
24
|
+
|
25
|
+
input_samples.zip(output_samples).to_h
|
26
|
+
end
|
27
|
+
|
28
|
+
def fetch_inputs_and_outputs
|
29
|
+
body = get_parsed_body(path)
|
30
|
+
samples = body.css('.lang-ja > .part > section > pre').map { |e| e.children.text }
|
17
31
|
|
18
|
-
|
19
|
-
input_samples.zip(output_samples).each do |input, output|
|
20
|
-
hash[input] = output
|
21
|
-
end
|
32
|
+
inputs, outputs = samples.partition.with_index { |_sample, i| i.even? }
|
22
33
|
|
23
|
-
|
34
|
+
[inputs, outputs]
|
24
35
|
end
|
25
36
|
end
|
26
37
|
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.5.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-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: faraday
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: faraday-cookie_jar
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,21 +81,21 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: thor
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: webrick
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: 12.3.3
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rspec
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '3.0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '3.0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: rubocop
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,6 +192,48 @@ dependencies:
|
|
178
192
|
- - ">="
|
179
193
|
- !ruby/object:Gem::Version
|
180
194
|
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: rubocop-rake
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: rubocop-rspec
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
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'
|
181
237
|
description: CLI tool for AtCoder and Ruby
|
182
238
|
email:
|
183
239
|
- ikusawasi@gmail.com
|
@@ -186,7 +242,7 @@ executables:
|
|
186
242
|
extensions: []
|
187
243
|
extra_rdoc_files: []
|
188
244
|
files:
|
189
|
-
- ".
|
245
|
+
- ".github/workflows/publish_to_rubygems.yml"
|
190
246
|
- ".github/workflows/ruby.yml"
|
191
247
|
- ".gitignore"
|
192
248
|
- ".rspec"
|
@@ -204,7 +260,6 @@ files:
|
|
204
260
|
- lib/green_day/atcoder_client.rb
|
205
261
|
- lib/green_day/cli.rb
|
206
262
|
- lib/green_day/contest.rb
|
207
|
-
- lib/green_day/snippet_builder.rb
|
208
263
|
- lib/green_day/task.rb
|
209
264
|
- lib/green_day/test_builder.rb
|
210
265
|
- lib/green_day/version.rb
|
@@ -214,6 +269,7 @@ licenses:
|
|
214
269
|
metadata:
|
215
270
|
homepage_uri: https://github.com/QWYNG/green_day
|
216
271
|
source_code_uri: https://github.com/QWYNG/green_day
|
272
|
+
rubygems_mfa_required: 'true'
|
217
273
|
post_install_message:
|
218
274
|
rdoc_options: []
|
219
275
|
require_paths:
|
@@ -222,14 +278,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
222
278
|
requirements:
|
223
279
|
- - ">="
|
224
280
|
- !ruby/object:Gem::Version
|
225
|
-
version:
|
281
|
+
version: 2.7.1
|
226
282
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
227
283
|
requirements:
|
228
284
|
- - ">="
|
229
285
|
- !ruby/object:Gem::Version
|
230
286
|
version: '0'
|
231
287
|
requirements: []
|
232
|
-
rubygems_version: 3.
|
288
|
+
rubygems_version: 3.3.7
|
233
289
|
signing_key:
|
234
290
|
specification_version: 4
|
235
291
|
summary: CLI tool for AtCoder and Ruby
|
data/.env.sample
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module GreenDay
|
4
|
-
module SnippetBuilder
|
5
|
-
ARRAY_INPUT_SNIPPET = 'gets.split.map(&:to_i)'
|
6
|
-
MULTIPLE_LINE_INPUT_SNIPPET =
|
7
|
-
'readlines.map(&:chomp!).map { |e| e.split.map(&:to_i) }'
|
8
|
-
|
9
|
-
module_function
|
10
|
-
|
11
|
-
def build
|
12
|
-
[ARRAY_INPUT_SNIPPET, MULTIPLE_LINE_INPUT_SNIPPET]
|
13
|
-
.map { |snippet| '# ' + snippet }
|
14
|
-
.join("\n") + "\n"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|