at_coder_friends 0.6.9 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -1
  3. data/.github/workflows/ruby.yml +7 -1
  4. data/.gitignore +3 -0
  5. data/.rubocop.yml +1 -1
  6. data/CHANGELOG.md +21 -4
  7. data/Gemfile.lock +37 -40
  8. data/README.md +10 -91
  9. data/at_coder_friends.gemspec +2 -2
  10. data/config/default.yml +231 -94
  11. data/lib/at_coder_friends/cli.rb +13 -28
  12. data/lib/at_coder_friends/config_loader.rb +1 -2
  13. data/lib/at_coder_friends/generator/any_builtin.rb +22 -0
  14. data/lib/at_coder_friends/generator/base.rb +55 -6
  15. data/lib/at_coder_friends/generator/c_builtin.rb +22 -0
  16. data/lib/at_coder_friends/generator/cxx_builtin.rb +8 -239
  17. data/lib/at_coder_friends/generator/fragment.rb +106 -0
  18. data/lib/at_coder_friends/generator/main.rb +14 -6
  19. data/lib/at_coder_friends/generator/ruby_builtin.rb +13 -165
  20. data/lib/at_coder_friends/parser/binary.rb +9 -3
  21. data/lib/at_coder_friends/parser/constraints.rb +8 -8
  22. data/lib/at_coder_friends/parser/input_format.rb +5 -5
  23. data/lib/at_coder_friends/path_util.rb +1 -1
  24. data/lib/at_coder_friends/problem.rb +4 -4
  25. data/lib/at_coder_friends/scraping/session.rb +1 -1
  26. data/lib/at_coder_friends/scraping/tasks.rb +1 -1
  27. data/lib/at_coder_friends/version.rb +1 -1
  28. data/lib/at_coder_friends.rb +3 -0
  29. data/templates/any_builtin.md.erb +30 -0
  30. data/templates/any_builtin_fragments.yml +5 -0
  31. data/templates/c_builtin.c.erb +36 -0
  32. data/templates/c_builtin_fragments.yml +127 -0
  33. data/templates/csharp_sample.cs.erb +29 -0
  34. data/templates/csharp_sample_fragments.yml +159 -0
  35. data/templates/java_sample.java.erb +25 -0
  36. data/templates/java_sample_fragments.yml +98 -0
  37. data/templates/ruby_builtin_fragments.yml +93 -0
  38. metadata +22 -6
  39. data/.travis.yml +0 -16
  40. data/docs/CONFIGURATION.md +0 -421
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc8c9e5d2e8f2f243d7e520c88186cc62b46296a3e1b5d7a60673d8a208dd7ec
4
- data.tar.gz: 732ab4cbadae2e8e8a1a51e3928fc0bb7f58da4738c770c93d82f5b6262f76b4
3
+ metadata.gz: 96e7e206c26f9c6c895384ae2d22f367ec0ac6523cf5328b603938990e041e8d
4
+ data.tar.gz: b7a47057177f6830b9e8b0a4eb8a81cc15ef3eb8b21bbf2d9dfc813d751db45e
5
5
  SHA512:
6
- metadata.gz: df86a0c84321098080ba9ad9ef32b6b8f413621ecd90c297fc27d65f36d8d159e7cbfe03c54cce0aa9560ce2b33841c9afa46eb5fbff33bb977d3c0dcfb186bb
7
- data.tar.gz: fbc249260ea37187c833ff102002feee9781dc6eecdfd175d4fd06ccf3f33d7a706431353c39a4126d9761825f50b3050b695b02353558594ef93ab07a4dede0
6
+ metadata.gz: 54a3388b4bd4af1d41053ce4afbdf207b0c371ddbf5f3bbd63bdf34733a3094dd583d6504be6e725bbc589751560ae1f3c468bbeacf0d7874d537add4df4e692
7
+ data.tar.gz: 3f826939eb83d7b24346ad6b21d6d968e7d3eea8b1bb252ecb4c78fec24f45b9ab60b3ca4d9e0e2517b688e6362b98aea82da808af5b7f22f45eeaf3b096ab4f
data/.gitattributes CHANGED
@@ -1 +1 @@
1
- spec/mocks/* linguist-vendored
1
+ spec/mocks/** linguist-vendored
@@ -19,7 +19,7 @@ jobs:
19
19
  runs-on: ubuntu-latest
20
20
  strategy:
21
21
  matrix:
22
- ruby-version: ['2.5', '2.7']
22
+ ruby-version: ['2.7', '3.0', '3.2']
23
23
 
24
24
  steps:
25
25
  - uses: actions/checkout@v2
@@ -30,3 +30,9 @@ jobs:
30
30
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
31
31
  - name: Run tests
32
32
  run: script -e -c "bundle exec rspec"
33
+ env:
34
+ COVERAGE: true
35
+ - name: publish code coverage
36
+ uses: paambaati/codeclimate-action@v3.0.0
37
+ env:
38
+ CC_TEST_REPORTER_ID: cb942bcc168feb78c43c506364d5344c5ec9a46a0b68dc66acb581e77c981ff1
data/.gitignore CHANGED
@@ -19,3 +19,6 @@
19
19
 
20
20
  # regression environment
21
21
  /regression
22
+
23
+ # Visual Studio Code local settings
24
+ .vscode/
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.5
4
+ TargetRubyVersion: 2.7
5
5
  Exclude:
6
6
  - 'templates/**/*'
7
7
  - 'spec/fixtures/**/*'
data/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.7.1 (2023-07-25)
6
+ ### Added
7
+ - language update(2023-07-21) support
8
+
9
+ ## 0.7.0 (2023-05-12)
10
+ ### Added
11
+ - add AnyBuiltin Generator
12
+ - add file extension to generator settings
13
+ - enable multiple configuration for one generator
14
+ - add CBuiltin Generator
15
+ - add Ruby3.2 to target version.
16
+ - add C# and Java templates for AnyBuiltin Generator
17
+ ### Deleted
18
+ - drop Ruby2.6 from target version.
19
+ ### Changed
20
+ - generators : externalize code fragments to YAML
21
+
5
22
  ## 0.6.9 (2021-12-25)
6
23
  ### Added
7
24
  - input_format.rb : \hspace{...}, \text{...} support
@@ -67,7 +84,7 @@
67
84
 
68
85
  ## 0.6.2 (2019-11-18)
69
86
  ### Added
70
- - add ```check-and-go``` command.
87
+ - add `check-and-go` command.
71
88
 
72
89
  ### Changed
73
90
  - Enhancement in input format parser.
@@ -87,7 +104,7 @@
87
104
  - Add settings about source generation.
88
105
 
89
106
  ### Changed
90
- - Treat all ```A_*.in``` format files as sample input data
107
+ - Treat all `A_*.in` format files as sample input data
91
108
 
92
109
  ## 0.5.2 (2019-10-14)
93
110
  ### Fixed
@@ -103,7 +120,7 @@
103
120
 
104
121
  ## 0.5.0 (2019-10-04)
105
122
  ### Added
106
- - User/password setting in ```.at_coder_friends.yml``` is no longer required.
123
+ - User/password setting in `.at_coder_friends.yml` is no longer required.
107
124
  - Saving and restoring session feature.
108
125
 
109
126
  ## 0.4.0 (2019-09-16)
@@ -112,4 +129,4 @@
112
129
 
113
130
  ## 0.3.3 (2019-09-01)
114
131
  ### Added
115
- - Add ```open-contest-page``` command.
132
+ - Add `open-contest-page` command.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- at_coder_friends (0.6.9)
4
+ at_coder_friends (0.7.1)
5
5
  colorize (~> 0.8.1)
6
6
  launchy (>= 2.4.3)
7
7
  mechanize (~> 2.0)
@@ -9,10 +9,10 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- addressable (2.8.0)
13
- public_suffix (>= 2.0.2, < 5.0)
12
+ addressable (2.8.4)
13
+ public_suffix (>= 2.0.2, < 6.0)
14
14
  colorize (0.8.1)
15
- connection_pool (2.2.5)
15
+ connection_pool (2.4.1)
16
16
  crack (0.4.5)
17
17
  rexml
18
18
  diff-lcs (1.5.0)
@@ -20,11 +20,12 @@ GEM
20
20
  domain_name (0.5.20190701)
21
21
  unf (>= 0.0.5, < 1.0.0)
22
22
  hashdiff (1.0.1)
23
- http-cookie (1.0.4)
23
+ http-cookie (1.0.5)
24
24
  domain_name (~> 0.5)
25
- launchy (2.5.0)
26
- addressable (~> 2.7)
27
- mechanize (2.8.3)
25
+ json (2.6.3)
26
+ launchy (2.5.2)
27
+ addressable (~> 2.8)
28
+ mechanize (2.9.1)
28
29
  addressable (~> 2.8)
29
30
  domain_name (~> 0.5, >= 0.5.20190701)
30
31
  http-cookie (~> 1.0, >= 1.0.3)
@@ -37,62 +38,58 @@ GEM
37
38
  webrobots (~> 0.1.2)
38
39
  mime-types (3.4.1)
39
40
  mime-types-data (~> 3.2015)
40
- mime-types-data (3.2021.1115)
41
- mini_portile2 (2.6.1)
41
+ mime-types-data (3.2023.0218.1)
42
42
  net-http-digest_auth (1.4.1)
43
- net-http-persistent (4.0.1)
43
+ net-http-persistent (4.0.2)
44
44
  connection_pool (~> 2.2)
45
- nokogiri (1.12.5)
46
- mini_portile2 (~> 2.6.1)
45
+ nokogiri (1.15.3-arm64-darwin)
47
46
  racc (~> 1.4)
48
- nokogiri (1.12.5-x64-mingw32)
47
+ nokogiri (1.15.3-x86_64-linux)
49
48
  racc (~> 1.4)
50
- public_suffix (4.0.6)
51
- racc (1.6.0)
49
+ public_suffix (5.0.3)
50
+ racc (1.7.1)
52
51
  rake (13.0.6)
53
52
  rexml (3.2.5)
54
- rspec (3.10.0)
55
- rspec-core (~> 3.10.0)
56
- rspec-expectations (~> 3.10.0)
57
- rspec-mocks (~> 3.10.0)
58
- rspec-core (3.10.1)
59
- rspec-support (~> 3.10.0)
60
- rspec-expectations (3.10.1)
53
+ rspec (3.12.0)
54
+ rspec-core (~> 3.12.0)
55
+ rspec-expectations (~> 3.12.0)
56
+ rspec-mocks (~> 3.12.0)
57
+ rspec-core (3.12.2)
58
+ rspec-support (~> 3.12.0)
59
+ rspec-expectations (3.12.3)
61
60
  diff-lcs (>= 1.2.0, < 2.0)
62
- rspec-support (~> 3.10.0)
63
- rspec-mocks (3.10.2)
61
+ rspec-support (~> 3.12.0)
62
+ rspec-mocks (3.12.6)
64
63
  diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.10.0)
66
- rspec-support (3.10.3)
64
+ rspec-support (~> 3.12.0)
65
+ rspec-support (3.12.1)
67
66
  rubyntlm (0.6.3)
68
- simplecov (0.21.2)
67
+ simplecov (0.17.1)
69
68
  docile (~> 1.1)
70
- simplecov-html (~> 0.11)
71
- simplecov_json_formatter (~> 0.1)
72
- simplecov-html (0.12.3)
73
- simplecov_json_formatter (0.1.3)
69
+ json (>= 1.8, < 3)
70
+ simplecov-html (~> 0.10.0)
71
+ simplecov-html (0.10.2)
74
72
  unf (0.1.4)
75
73
  unf_ext
76
- unf_ext (0.0.8)
77
- unf_ext (0.0.8-x64-mingw32)
78
- webmock (3.14.0)
74
+ unf_ext (0.0.8.2)
75
+ webmock (3.18.1)
79
76
  addressable (>= 2.8.0)
80
77
  crack (>= 0.3.2)
81
78
  hashdiff (>= 0.4.0, < 2.0.0)
82
- webrick (1.7.0)
79
+ webrick (1.8.1)
83
80
  webrobots (0.1.2)
84
81
 
85
82
  PLATFORMS
86
- ruby
87
- x64-mingw32
83
+ arm64-darwin-20
84
+ x86_64-linux
88
85
 
89
86
  DEPENDENCIES
90
87
  at_coder_friends!
91
88
  bundler (~> 2.0)
92
89
  rake (~> 13.0)
93
90
  rspec (~> 3.0)
94
- simplecov (~> 0.10)
91
+ simplecov (~> 0.10, < 0.18)
95
92
  webmock (~> 3.0)
96
93
 
97
94
  BUNDLED WITH
98
- 2.2.32
95
+ 2.4.17
data/README.md CHANGED
@@ -20,7 +20,7 @@ AtCoderFriends automates tasks about [AtCoder](https://atcoder.jp/) programming
20
20
 
21
21
  ## Dependencies
22
22
 
23
- - Ruby 2.5 or newer
23
+ - Ruby 2.7 or newer
24
24
  - [Mechanize](https://github.com/sparklemotion/mechanize)
25
25
 
26
26
  ## Installation
@@ -84,107 +84,26 @@ at_coder_friends check-and-go /path/to/contest/source_file
84
84
  ### Naming convention
85
85
 
86
86
  - Contest folder name will be used in the contest site URL.
87
- For example, if ```arc001``` folder is specified, AtCoderFriends will use ```https://atcoder.jp/contests/arc001/```.
88
- - Source file should be named ```[problem ID].[language specific extension]```(e.g. ```A.rb```),
87
+ For example, if `arc001` folder is specified, AtCoderFriends will use `https://atcoder.jp/contests/arc001/`.
88
+ - Source file should be named `[problem ID].[language specific extension]`(e.g. `A.rb`),
89
89
  in order to let AtCoderFriends find test cases or fill the submission form.
90
- - Suffixes (start with underscore) may be added to the file name (e.g. ```A_v2.rb```),
90
+ - Suffixes (start with underscore) may be added to the file name (e.g. `A_v2.rb`),
91
91
  so that you can try multiple codes for one problem.
92
92
 
93
93
  ## Notes
94
94
 
95
95
  - Compilation is not supported.
96
- - Source generator supports Ruby and C++ in default, and can be added by plugin.
96
+ - Source generator supports Ruby, C/C++, C# and Java, and can be added by plugin or template.
97
97
  - Test runner and code submission are supported in 36 languages.
98
98
 
99
99
 
100
100
  ## Configuration
101
101
 
102
- See [CONFIGURATION.md](docs/CONFIGURATION.md) for details.
103
-
104
- ## For Sublime Text user
105
-
106
- It is convenient to use AtCoderFriends from Sublime Text plugin.
107
-
108
- - [sublime_at_coder_friends](https://github.com/nejiko96/sublime_at_coder_friends)
109
-
110
- ## For Visual Studio Code user
111
-
112
- - Run **Configure Tasks** from the global Terminal menu.
113
- - Select the **Create tasks.json file from template** entry.
114
- - Select **Others** from the list.
115
- - Add following settings to ```tasks.json```.
116
-
117
- ```JSON
118
- {
119
- "version": "2.0.0",
120
- "tasks": [
121
- {
122
- "label": "AtCoderFriends:New Contest",
123
- "type": "shell",
124
- "command": "at_coder_friends",
125
- "args": [
126
- "setup",
127
- "${input:contestName}"
128
- ],
129
- "problemMatcher": [],
130
- "group": "none"
131
- },
132
- {
133
- "label": "AtCoderFriends:Test One",
134
- "type": "shell",
135
- "command": "at_coder_friends",
136
- "args": [
137
- "test-one",
138
- "${file}"
139
- ],
140
- "problemMatcher": [],
141
- "group": "none"
142
- },
143
- {
144
- "label": "AtCoderFriends:Test All",
145
- "type": "shell",
146
- "command": "at_coder_friends",
147
- "args": [
148
- "test-all",
149
- "${file}"
150
- ],
151
- "problemMatcher": [],
152
- "group": "none"
153
- },
154
- {
155
- "label": "AtCoderFriends:Submit",
156
- "type": "shell",
157
- "command": "at_coder_friends",
158
- "args": [
159
- "submit",
160
- "${file}"
161
- ],
162
- "problemMatcher": [],
163
- "group": "none",
164
- },
165
- {
166
- "label": "AtCoderFriends:Check & Go",
167
- "type": "shell",
168
- "command": "at_coder_friends",
169
- "args": [
170
- "check-and-go",
171
- "${file}"
172
- ],
173
- "problemMatcher": [],
174
- "group": "none",
175
- },
176
- ...
177
- ],
178
- "inputs": [
179
- {
180
- "id": "contestName",
181
- "type": "promptString",
182
- "default": "",
183
- "description": "Contest Name"
184
- }
185
- ]
186
- }
187
- ```
102
+ See [Wiki](https://github.com/nejiko96/at_coder_friends/wiki/Configuration-details) for details.
103
+
104
+ ## Customizing editor
105
+
106
+ See [Wiki](https://github.com/nejiko96/at_coder_friends/wiki/Customizing-editor) for details.
188
107
 
189
108
  ## Development
190
109
 
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ['lib']
30
30
 
31
- spec.required_ruby_version = '>= 2.5.0'
31
+ spec.required_ruby_version = '>= 2.7.0'
32
32
 
33
33
  spec.metadata = {
34
34
  'homepage_uri' => spec.homepage,
@@ -44,6 +44,6 @@ Gem::Specification.new do |spec|
44
44
  spec.add_development_dependency 'bundler', '~> 2.0'
45
45
  spec.add_development_dependency 'rake', '~> 13.0'
46
46
  spec.add_development_dependency 'rspec', '~> 3.0'
47
- spec.add_development_dependency 'simplecov', '~> 0.10'
47
+ spec.add_development_dependency 'simplecov', '~> 0.10', '< 0.18'
48
48
  spec.add_development_dependency 'webmock', '~> 3.0'
49
49
  end