at_coder_friends 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 823cf1a72ff19a596f5809ff88bb3d50002a2b8354a12e576d2e830f8f5b8cf3
4
+ data.tar.gz: fbb8e901a32c3475f9cffd8757867aa8f74ff4a7fbab23c76aa9a216287dfa3a
5
+ SHA512:
6
+ metadata.gz: 9b47bf20cbbac1728ab4c85925491c3a5c077e44dc1cec72b588ac8b2898b00ce85d608922002c9b6698a8815335b03fc27acfdb1888999774f0cad6bd9fd1a2
7
+ data.tar.gz: 9dd17a126267d98c986749771835eb47dbcaef2573bae34d826b0d28b75d89342b8e681eaf3f02f142b75337805d1f18372f0eba79990739dc6108b8976f42fb
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,27 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ Exclude:
5
+ - 'spec/fixtures/**/*'
6
+ TargetRubyVersion: 2.3
7
+
8
+ Layout/EndOfLine:
9
+ EnforcedStyle: lf
10
+
11
+ Lint/AmbiguousBlockAssociation:
12
+ Exclude:
13
+ - 'spec/**/*.rb'
14
+
15
+ Metrics/BlockLength:
16
+ Exclude:
17
+ - 'Rakefile'
18
+ - '**/*.rake'
19
+ - 'spec/**/*.rb'
20
+
21
+ Metrics/MethodLength:
22
+ Exclude:
23
+ - 'spec/**/*.rb'
24
+
25
+ Metrics/ModuleLength:
26
+ Exclude:
27
+ - 'spec/**/*.rb'
@@ -0,0 +1,8 @@
1
+ Metrics/AbcSize:
2
+ Max: 20
3
+
4
+ Metrics/ClassLength:
5
+ Max: 142
6
+
7
+ Metrics/MethodLength:
8
+ Max: 15
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.16.1
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at nejiko2006@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in at_coder_friends.gemspec
8
+ gemspec
@@ -0,0 +1,83 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ at_coder_friends (0.3.1)
5
+ mechanize (~> 2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.5.2)
11
+ public_suffix (>= 2.0.2, < 4.0)
12
+ crack (0.4.3)
13
+ safe_yaml (~> 1.0.0)
14
+ diff-lcs (1.3)
15
+ docile (1.1.5)
16
+ domain_name (0.5.20170404)
17
+ unf (>= 0.0.5, < 1.0.0)
18
+ hashdiff (0.3.7)
19
+ http-cookie (1.0.3)
20
+ domain_name (~> 0.5)
21
+ json (2.1.0)
22
+ mechanize (2.7.5)
23
+ domain_name (~> 0.5, >= 0.5.1)
24
+ http-cookie (~> 1.0)
25
+ mime-types (>= 1.17.2)
26
+ net-http-digest_auth (~> 1.1, >= 1.1.1)
27
+ net-http-persistent (~> 2.5, >= 2.5.2)
28
+ nokogiri (~> 1.6)
29
+ ntlm-http (~> 0.1, >= 0.1.1)
30
+ webrobots (>= 0.0.9, < 0.2)
31
+ mime-types (3.1)
32
+ mime-types-data (~> 3.2015)
33
+ mime-types-data (3.2016.0521)
34
+ mini_portile2 (2.3.0)
35
+ net-http-digest_auth (1.4.1)
36
+ net-http-persistent (2.9.4)
37
+ nokogiri (1.8.2)
38
+ mini_portile2 (~> 2.3.0)
39
+ ntlm-http (0.1.1)
40
+ public_suffix (3.0.2)
41
+ rake (10.5.0)
42
+ rspec (3.7.0)
43
+ rspec-core (~> 3.7.0)
44
+ rspec-expectations (~> 3.7.0)
45
+ rspec-mocks (~> 3.7.0)
46
+ rspec-core (3.7.1)
47
+ rspec-support (~> 3.7.0)
48
+ rspec-expectations (3.7.0)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.7.0)
51
+ rspec-mocks (3.7.0)
52
+ diff-lcs (>= 1.2.0, < 2.0)
53
+ rspec-support (~> 3.7.0)
54
+ rspec-support (3.7.1)
55
+ safe_yaml (1.0.4)
56
+ simplecov (0.15.1)
57
+ docile (~> 1.1.0)
58
+ json (>= 1.8, < 3)
59
+ simplecov-html (~> 0.10.0)
60
+ simplecov-html (0.10.2)
61
+ unf (0.1.4)
62
+ unf_ext
63
+ unf_ext (0.0.7.5)
64
+ webmock (3.3.0)
65
+ addressable (>= 2.3.6)
66
+ crack (>= 0.3.2)
67
+ hashdiff
68
+ webrobots (0.1.2)
69
+
70
+ PLATFORMS
71
+ ruby
72
+ x64-mingw32
73
+
74
+ DEPENDENCIES
75
+ at_coder_friends!
76
+ bundler (~> 1.16)
77
+ rake (~> 10.0)
78
+ rspec (~> 3.0)
79
+ simplecov (~> 0.10)
80
+ webmock (~> 3.0)
81
+
82
+ BUNDLED WITH
83
+ 1.16.1
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 nejiko96
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,114 @@
1
+ # AtCoderFriends
2
+
3
+ ## Description
4
+
5
+ AtCoderFriends automates tasks about [AtCoder](https://atcoder.jp/) programming contest such as:
6
+
7
+ - Download example input/output
8
+ - Generate source skeleton
9
+ - Run test cases
10
+ - Submit code
11
+
12
+ ## Dependencies
13
+
14
+ - Ruby 2.3 or newer
15
+ - [Mechanize](https://github.com/sparklemotion/mechanize)
16
+
17
+ ## Installation
18
+
19
+ See [Development](#Develoment).
20
+
21
+ <!--
22
+ Add this line to your application's Gemfile:
23
+
24
+ ```ruby
25
+ gem 'at_coder_friends'
26
+ ```
27
+
28
+ And then execute:
29
+
30
+ $ bundle
31
+
32
+ Or install it yourself as:
33
+
34
+ $ gem install at_coder_friends
35
+ -->
36
+
37
+ ## Configuration
38
+
39
+ Create ```.at_coder_friends.yml``` and place it in the working directory (or parent of working directory).
40
+
41
+ ```yaml
42
+ user: <user>
43
+ password: <password>
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ ### Setup
49
+
50
+ ```
51
+ at_coder_friends setup /path/to/contest
52
+ ```
53
+
54
+ Creates contest folder, and generates example data and source skeletons into the folder.
55
+
56
+
57
+ ### Run first test case
58
+
59
+ ```
60
+ at_coder_friends test-one /path/to/contest/source_file
61
+ ```
62
+
63
+ ### Run all test cases
64
+
65
+ ```
66
+ at_coder_friends test-all /path/to/contest/source_file
67
+ ```
68
+
69
+ ### Submit code
70
+
71
+ ```
72
+ at_coder_friends submit /path/to/contest/source_file
73
+ ```
74
+
75
+ ### Naming Convention
76
+
77
+ - Contest folder name will be used in the contest site URL.
78
+ For example, if ```arc001``` folder is specified, AtCoderFriends will use ```arc001.contest.atcoder.jp```.
79
+ - Source file should be named ```[problem ID].[language specific extension]```(e.g. ```A.rb```),
80
+ in order to let AtCoderFriends find test cases or fill the submission form.
81
+ - Suffixes (start with underscore) may be added to the file name (e.g. ```A_v2.rb```),
82
+ so that you can try multiple codes for one problem.
83
+
84
+ ### Notes
85
+
86
+ - Compilation is not supported.
87
+ - Source generator and test runner supports only ruby and C++.
88
+
89
+ ## For Sublime Text User
90
+
91
+ It is convenient to use AtCoderFriends from Sublime Text plugin.
92
+
93
+ - [sublime_at_coder_friends](https://github.com/nejiko96/sublime_at_coder_friends)
94
+
95
+ ## Development
96
+
97
+ 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
+
99
+ To install this gem onto your local machine, run `bundle exec rake install`.
100
+ <!---
101
+ 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
+ --->
103
+
104
+ ## Contributing
105
+
106
+ Bug reports and pull requests are welcome on GitHub at https://github.com/nejiko96/at_coder_friends. 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.
107
+
108
+ ## License
109
+
110
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
111
+
112
+ ## Code of Conduct
113
+
114
+ Everyone interacting in the AtCoderFriends project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/nejiko96/at_coder_friends/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'at_coder_friends/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'at_coder_friends'
9
+ spec.version = AtCoderFriends::VERSION
10
+ spec.authors = ['nejiko96']
11
+ spec.email = ['nejiko2006@gmail.com']
12
+
13
+ spec.summary = 'AtCoder support tool'
14
+ spec.description = <<-DESCRIPTION
15
+ AtCoder support tool
16
+ - generate source template
17
+ - generate test data from sample input/output
18
+ - run tests
19
+ - submit code
20
+ DESCRIPTION
21
+ spec.homepage = 'https://github.com/nejiko96/at_coder_friends'
22
+ spec.license = 'MIT'
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
+ f.match(%r{^(test|spec|features)/})
26
+ end
27
+ spec.bindir = 'exe'
28
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ['lib']
30
+
31
+ spec.add_dependency 'mechanize', '~> 2.0'
32
+
33
+ spec.add_development_dependency 'bundler', '~> 1.16'
34
+ spec.add_development_dependency 'rake', '~> 10.0'
35
+ spec.add_development_dependency 'rspec', '~> 3.0'
36
+ spec.add_development_dependency 'simplecov', '~> 0.10'
37
+ spec.add_development_dependency 'webmock', '~> 3.0'
38
+ end
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'at_coder_friends'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ IRB.start(__FILE__)
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ # frozen_string_literal: true
3
+
4
+ set -euo pipefail
5
+ IFS=$'\n\t'
6
+ set -vx
7
+
8
+ bundle install
9
+
10
+ # Do any other automated setup that you need to do here