Skip to content

Commit e34c06f

Browse files
committed
Sync development files.
1 parent ff19319 commit e34c06f

17 files changed

+495
-77
lines changed

.codeclimate.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: "2"
2+
plugins:
3+
rubocop:
4+
enabled: false
5+
ratings:
6+
paths:
7+
- "spec/tests/**.rb"
8+
- "lib/**.rb"

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
end_of_line = lf
9+
indent_size = 2

.github/codeowners

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @envygeeks

.github/issue_template.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!--
2+
If this is a security related bug, please email the maintainer of this
3+
repository (found via `CODEOWNERS`) and let them know in private... all
4+
security issues are handled promptly, and quickly, however an early
5+
release could severely impact people.
6+
-->
7+
8+
- [ ] I tried updating to the latest version
9+
- [ ] I can't, there is an issue
10+
- [ ] This is about an < latest
11+
- [ ] I understand older versions may be unsupported
12+
- [ ] I Am on Windows
13+
- [ ] Ubuntu Bash on Windows
14+
- [ ] Fedora Bash on Windows
15+
- [ ] Other Bash on Windows
16+
- [ ] I Am on Linux
17+
- [ ] Ubuntu
18+
- [ ] Fedora
19+
- [ ] CentOS
20+
- [ ] Redhat
21+
- [ ] Debian
22+
- [ ] I am on macOS 10.13
23+
- [ ] I am on macOS 10.14
24+
- [ ] I'm on Docker
25+
- [ ] I understand Docker may be unsupported
26+
27+
## Description
28+
29+
<!--
30+
Replace this with a description of your issue. Try to be as
31+
detailed as you can, because the lack of a detailed description
32+
will not help us reproduce it, and if we cannot reproduce and
33+
you do not answer, your ticket could be closed.
34+
-->
35+
36+
## Steps
37+
38+
- Step 1
39+
- Step 2
40+
- Step 3
41+
42+
## Output
43+
44+
```sh
45+
# Doing stuff.
46+
# Doing more stuff.
47+
# Oh no error.
48+
```
49+
50+
## Expected
51+
52+
<!--
53+
Replace this with what you expected to happen.
54+
Sometimes there are bugs, sometimes it's just a feature,
55+
but it's always nice to know what you wanted.
56+
-->

.github/pull_request_template.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- [ ] I have added or updated the specs/tests.
2+
- [ ] I have verified that the specs/tests pass on my computer.
3+
- [ ] I have not attempted to bump, or alter versions.
4+
- [ ] This is a documentation change.
5+
- [ ] This is a source change.
6+
7+
## Description
8+
9+
<!--
10+
What issue are you trying to resolve?
11+
It's always nice to get a brief description.
12+
Note: you should provide the same in your commit message.
13+
not everybody uses Github's Web UI.
14+
-->

CODE_OF_CONDUCT.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Contributor Covenant Code of Conduct
2+
## Our Pledge
3+
4+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
5+
6+
## Our Standards
7+
8+
Examples of behavior that contributes to creating a positive environment include:
9+
10+
* Gracefully accepting constructive criticism
11+
* Being respectful of differing viewpoints and experiences
12+
* Showing empathy towards other community members
13+
* Focusing on what is best for the community
14+
* Using welcoming and inclusive language
15+
16+
Examples of unacceptable behavior by participants include:
17+
18+
* Trolling, insulting/derogatory comments, and personal or political attacks
19+
* Publishing private info, such as a physical, or electronic address, without explicit permission
20+
* Other conduct which could reasonably be considered inappropriate in a professional setting
21+
* Sexualized language, or imagery, and unwelcome sexual attention or advances
22+
* Public, or private harassment
23+
24+
## Our Responsibilities
25+
26+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
27+
28+
## Scope
29+
30+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
31+
32+
## Enforcement
33+
34+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at `[email protected]`. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
35+
36+
## Attribution
37+
38+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4<br>
39+
Available at [http://contributor-covenant.org/version/1/4][version]
40+
41+
[homepage]: http://contributor-covenant.org
42+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
[@envygeeks]: https://github.com/envygeeks
2+
3+
# Contributing
4+
5+
**Hi!** *Thanks for considering a contribution to this project*. Below you will find a short set of guidelines to help you with your contribution. Be it a bug report, a pull request, or even a question. Let me also let you know that you don't have to file a pull-request, or contribute "raw code" to this project. I would never ask you to do that if you do not wish to, or currently are unable to. All I ask is that you file bug reports, and be respectful of the fact that this software is provided for free, on a donation basis, and at mostly [@envygeeks] expense via time (and sometimes cash.)
6+
7+
## Dependencies
8+
9+
This project has an almost strict policy on dependencies. I do not do major updates (major version updates) of our current dependencies in anything but major releases, regardless of backwards compatibility. Dependencies are locked until the next major version. If there is a security reason for a major update, I ask that you file a bug with the upstream library and ask them to cut a minor release of the last release, which is proper.
10+
11+
***If they cannot provide a security update for the latest version, I will consider adding the major version as an optional version, but not restricting it as the only acceptable starting version, but I will complain about having to do so, because that's not cool.***
12+
13+
### Languages
14+
15+
When it comes to the language versions I support, if a language version becomes EOL (end-of-life) before a major release can be made, I will remove all official support for it before a major release, and update the list of supported versions inside of the testing. This is done to encourage users to keep updating quickly, rather than remaining on old, unstable, and unsupported versions of the language.
16+
17+
#### Policies
18+
19+
I tend to test on more than one version, and more than one back version of any given language if a major update hasn't been done in a while, and continue to support them as long as they are not end-of-life. For example, if my software starts with Ruby `2.2`, and the version is currently `2.5`, and I have no plans for a major update you can add `2.5` to the list of supported Rubies, however, the next major update will drop it to `2.4`, and `2.5`. If `2.2` becomes end-of-life, I will also drop it from the list.
20+
21+
* **Ruby:** Latest + 1 Back
22+
* **JRuby:** Latest Release ***only***
23+
* **Rubinius:** We do not support Rubinius at all.
24+
* **Node.js:** Latest LTS + Latest Release + 1 Back
25+
* **Go:** Latest + 1 Back
26+
27+
***It should be noted that if I wish to have a feature of a language before I can make a major release, I may, or may not go ahead and enforce a newer version of a language in a point release (exp: 3.x) so that I can update my code and clean it up.***
28+
29+
30+
## Bugs/Features
31+
32+
***If you do not wish to (or are unable to) file a pull-request, you can file a bug report for any issue you have...*** as long as it is not a question. Issues include *random results*, *random errors*, *segfaults*, or anything of that nature. When you do, please make sure to include the system you are working from, the version of the language or compiler you are working with, and any relevant information that can be used to replicate the issue. ***Unreplicable issues will be closed.*** ***You can (and are encouraged to) ask questions if they are about something not documented, or if there is a question about an ambiguity in the documentation, this will prompt me to update the documentation to fix the problem.***
33+
34+
### What to not do
35+
36+
* Ask me to put an urgency on your issue.
37+
* Be disrespectful: **I will block your comments**.
38+
* ":+1:" comments, I will lock issues; preventing further comments.
39+
* If you wish to "👍", "👎", or otherwise, please us the emoji-voting.
40+
* Ask if there are "any updates"
41+
42+
**I do accept donations for fixing issues on a case-by-case urgency basis, as well as for creating features, if you need an issue addressed quickly. If you wish to do this you should contact [@envygeeks]. Otherwise issues are fixed based on complexity, time, and importance. All my projects get equal love, and sometimes it takes a minute to get back around.**
43+
44+
### Policies
45+
#### Closing
46+
* **Immediately:** `wontfix`, `stale`, `not-a-bug`
47+
* **Closed on Next Release:** `close-on-next-release`
48+
* **1 Week (7 Days)**: `pending-feedback`
49+
50+
#### Fixing
51+
* **Bugfix x.x.X:** `bug`, `blocker`
52+
* **Minor x.X.x:** `non-blocker`, `bug`, `feature`
53+
* **Immediately:** `documentation`
54+
55+
## Pull Requests
56+
### Tests
57+
58+
If you change a method in any way, your tests ***must*** pass, and if there is an additional surface added, then you ***must add tests***, in Ruby I generally prefer to use RSpec, you should refer to RSpec's documentation for information on how it works, in Go, I prefer to use Go's native testing.
59+
60+
* ***Ruby:*** `rake spec`
61+
* ***Go:*** `go test -cover -v`
62+
* `script/test`
63+
64+
### Code
65+
66+
Code updates should follow the formatting of the given repository, formatting in Ruby is generally done via `rubocop` and is generally tied into `rake` and `rake spec`. Changes that are unrelated will be rejected and asked to be removed, regardless of your personal preference. You can always port those unrelated changes into another pull-request, unless they are arbitrary.
67+
68+
#### Basics
69+
70+
* Write your code in a clean and readable format.
71+
* Comment your code, at the high level, not lots of inline comments.
72+
* Stay at 80 lines if you can.
73+
74+
##### Good
75+
76+
```ruby
77+
# --
78+
# @param hello [String] your greeting
79+
# Allows you to send a greeting back to the user
80+
# @raise if the given object is not a string
81+
# @return [String] the greeting
82+
# --
83+
def greet(hello)
84+
raise ArgumentError, "needs string" unless hello.is_a?(String)
85+
alert hello, {
86+
class: ".greeting"
87+
}
88+
end
89+
```
90+
91+
##### Bad
92+
93+
```ruby
94+
# --
95+
# @param hello [String] your greeting
96+
# Allows you to send a greeting back to the user
97+
# @return [String] the greeting
98+
# --
99+
def greet(hello)
100+
# @raise if the given object is not a string
101+
raise ArgumentError, "needs string" unless hello.is_a?(String)
102+
# Ship it to the user
103+
alert hello, {
104+
class: ".greeting"
105+
}
106+
end
107+
```
108+
109+
#### Commits
110+
111+
Your pull-request should not add additional information outside of the Git-Commit. I understand this is Github, but explanitory data should remain in Git itself, not within Github (for the most part.) You should put the comment body of your pull request inside of your commit.
112+
113+
```
114+
Message
115+
116+
This pull-request solves X issue because it was really buggy.
117+
Please do not add extra `\n\n` here because Github displays it
118+
badly, so just let it flow, besides, this is what was intended for
119+
Git anyways, you only keep your message at 80c.
120+
```
121+
122+
123+
### Documentation
124+
125+
Documentation updates should follow the formatting of the given repository. You will be required to go through an approval process and even a comment processes. This process is mostly simple and should not impede a quick resolution. You should be prepared for the following:
126+
127+
* Requests for unrelated changes to be removed.
128+
* Requests for language changes if the author feels it's ambiguous.
129+
* Requests for formatting changes.
130+
* Requests for `git squash`

Rakefile

Lines changed: 8 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,12 @@
11
# Frozen-string-literal: true
2-
# Copyright: 2015 - 2017 Jordon Bedwell - MIT License
2+
# Copyright: 2017 - 2018 - MIT License
3+
# Source: https://github.com/envygeeks/devfiles
4+
# Author: Jordon Bedwell
35
# Encoding: utf-8
46

5-
require "open3"
6-
require "rspec/core/rake_task"
7-
require_relative "benchmark/support/task"
8-
require "rubocop/rake_task"
9-
require "simple/ansi"
10-
require "pathutil"
11-
require "json"
12-
13-
# --
14-
15-
task :default => [
16-
ENV["BENCHMARK"] ? :benchmark : :spec
17-
]
18-
19-
# --
20-
21-
BenchmarkTask.new :benchmark
22-
RSpec::Core::RakeTask.new :spec
23-
task :test => :spec
24-
25-
# --
26-
27-
namespace :diff do
28-
desc "List methods we have that Pathname doesn't."
29-
task :methods do
30-
methods = Pathutil.instance_methods - Pathname.instance_methods - Object.instance_methods
31-
methods.each do |method|
32-
$stdout.print "- ", "`", method, "`", "\n"
33-
end
34-
end
35-
end
36-
37-
# --
38-
39-
namespace :missing do
40-
desc "List methods we are missing."
41-
task :methods do
42-
methods = Pathname.instance_methods - Pathutil.instance_methods - Object.instance_methods
43-
methods-= [
44-
:cleanpath
45-
]
46-
47-
methods.each do |method|
48-
$stdout.puts method
49-
end
50-
end
51-
end
52-
53-
# --
54-
55-
namespace :pathname do
56-
desc "List all of Pathnames methods."
57-
task :methods do
58-
methods = Pathname.instance_methods - Object.instance_methods
59-
methods.each_with_index do |method, index|
60-
$stdout.print method
61-
unless index == methods.size - 1
62-
$stdout.print ", "
63-
end
64-
end
65-
66-
$stdout.puts
67-
end
68-
end
69-
70-
# --
71-
72-
desc "List all of Pathutils methods."
73-
task :methods do
74-
methods = Pathutil.instance_methods - Object.instance_methods
75-
methods.each_with_index do |method, index|
76-
$stdout.print "`", method, "`"
77-
$stdout.print ", " unless index == methods.size - 1
78-
end
79-
80-
$stdout.puts
7+
task default: [:spec]
8+
task(:spec) { exec "script/test" }
9+
task(:test) { exec "script/test" }
10+
Dir.glob("script/rake.d/*.rake").each do |v|
11+
load v
8112
end

script/install

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
# Copyright: 2017 - 2018 - MIT License
3+
# Source: https://github.com/envygeeks/devfiles
4+
# Author: Jordon Bedwell
5+
[ "$DEBUG" = "true" ] && set -x
6+
set -e
7+
8+
f=script/script.d/install
9+
[ "$SKIP_SCRIPTD" != "true" ] && [ -x $f ] && exec $f "$@"
10+
if bundle check 1>/dev/null 2>&1; then
11+
bundle update
12+
else
13+
bundle install --path \
14+
vendor/bundle
15+
fi
16+
17+
bundle clean
18+
if [ -f package.json ]; then
19+
yarn
20+
fi

script/rake.d/default.rake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require "bundler/setup"
2+
3+
require "open3"
4+
require "rspec/core/rake_task"
5+
require_relative "../../benchmark/support/task"
6+
require "rubocop/rake_task"
7+
require "simple/ansi"
8+
require "pathutil"
9+
require "json"
10+
11+
# --
12+
13+
task :default => [
14+
ENV["BENCHMARK"] ? :benchmark : :spec
15+
]
16+
17+
# --
18+
19+
BenchmarkTask.new :benchmark
20+
RSpec::Core::RakeTask.new :spec
21+
task :test => :spec

0 commit comments

Comments
 (0)