Skip to content

Commit

Permalink
Update to Standard Ruby formatting (mostly)
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Jun 2, 2021
1 parent 18bd7f6 commit 44f4023
Show file tree
Hide file tree
Showing 16 changed files with 235 additions and 345 deletions.
52 changes: 37 additions & 15 deletions .hoerc
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
---
exclude: !ruby/regexp '/
\.(tmp|swp)$
|
\.(?:autotest|gemtest|gitignore|hoerc|minitest.rb|simplecov-prelude.rb)
|
^(?i:TAGS)
\.(?:
tmp
| swp
)$
|
\.(?:
DS_Store|
bundle|
git|
hg|
idea|
svn|
vagrant
bundle
| git
| github
| hg
| idea
| svn
| vagrant
)\/
|
[gG]emfile(?:\.lock)?
|
support\/
(?:
support
)\/
|
\.(?:coveralls|pullreview|travis|rubocop.*)\.yml
\.(?:
appveyor
| coveralls
| fasterer
| pullreview
| rubocop.*
| standard.*
| travis
| unused
)\.yml$
|
(?i:TAGS)$
|
.byebug_history
\.(?:
DS_Store
| autotest
| byebug_history
| gemtest
| gitattributes
| gitignore
| hoerc
| minitest.rb
| simplecov-prelude.rb
)$
|
\.gemspec$
/x'
134 changes: 0 additions & 134 deletions .rubocop.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parallel: true
ruby_version: 2.0
ignore:
- '*.gemspec'
24 changes: 12 additions & 12 deletions Code-of-Conduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

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.
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.

## Our Standards

Expand Down Expand Up @@ -37,20 +37,20 @@ 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.
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.

## Scope

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.
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.

## Enforcement

Expand Down
38 changes: 19 additions & 19 deletions Contributing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Contributing

Contributions to mime-types-data is encouraged in any form: a bug report, new
MIME type defintions, or additional code to help manage the MIME types. As with
MIME type definitions, or additional code to help manage the MIME types. As with
many of my projects, I have a few suggestions for improving the chance of
acceptance of your code contributions:

Expand All @@ -26,12 +26,12 @@ other languages.
The Ruby mime-types gem loads its data from files encoded in the `data`
directory in this gem by loading `mime-types-data` and reading
MIME::Types::Data::PATH. These files are compiled files from the collection of
data in the `types` directory. Pull requests that include changes to these
files will require amendment to revert these files.
data in the `types` directory. Pull requests that include changes to these files
will require amendment to revert these files.

New or modified MIME types should be edited in the appropriate YAML file under
`types`. The format is as shown below for the `application/xml` MIME type
in `types/application.yml`.
`types`. The format is as shown below for the `application/xml` MIME type in
`types/application.yml`.

```yaml
- !ruby/object:MIME::Type
Expand All @@ -51,10 +51,10 @@ in `types/application.yml`.
There are other fields that can be added, matching the fields discussed in the
documentation for MIME::Type. Pull requests for MIME types should just contain
the changes to the YAML files for the new or modified MIME types; I will
convert the YAML files to JSON prior to a new release. I would rather not have
to verify that the JSON matches the YAML changes, which is why it is not
necessary to convert for the pull request.
the changes to the YAML files for the new or modified MIME types; I will convert
the YAML files to JSON prior to a new release. I would rather not have to verify
that the JSON matches the YAML changes, which is why it is not necessary to
convert for the pull request.
If you are making a change for a private fork, use `rake convert:yaml:json` to
convert the YAML to JSON, or `rake convert:yaml:columnar` to convert it to the
Expand Down Expand Up @@ -142,10 +142,10 @@ Here's the most direct way to get your work merged into the project:
The release process needs automation; as it includes generating code and
committing to the repository, it is not clear how this will happen safely.

1. Review any outstanding issues or pull requests to see if anything needs to
be addressed. This is necessary because there is currently no automated
source for extensions for the thousands of MIME entries. (Suggestions and/or
pull requests for same would be deeply appreciated.)
1. Review any outstanding issues or pull requests to see if anything needs to be
addressed. This is necessary because there is currently no automated source
for extensions for the thousands of MIME entries. (Suggestions and/or pull
requests for same would be deeply appreciated.)
2. `bundle install`
3. `bundle exec rake mime:apache`
4. `bundle exec rake mime:iana`
Expand All @@ -155,18 +155,18 @@ committing to the repository, it is not clear how this will happen safely.
category.)
6. `bundle exec rake convert`
7. `bundle exec rake update:version`
8. Write up the changes in History.md. If any PRs have been merged, these
should be noted specifically.
8. Write up the changes in History.md. If any PRs have been merged, these should
be noted specifically.
9. Commit the changes and push to GitHub.
10. `bundle exec rake release VERSION=newversion`

### Automating the Release

If anyone wishes to provide suggestions on automation, this would be a
two-phase process:
If anyone wishes to provide suggestions on automation, this would be a two-phase
process:

1. A system would need to periodically create PRs to the GitHub repository
with the output of the following commands (steps 2, 3, and 4):
1. A system would need to periodically create PRs to the GitHub repository with
the output of the following commands (steps 2, 3, and 4):

```sh
bundle install
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# NOTE: This file is present to keep Travis CI happy. Edits to it will not
# be accepted.

source 'https://rubygems.org/'
source "https://rubygems.org/"

gem 'byebug'
gem 'mime-types', path: '../ruby-mime-types' if ENV['DEV']
gem "byebug"
gem "mime-types", path: "../ruby-mime-types" if ENV["DEV"]

gemspec

Expand Down
19 changes: 9 additions & 10 deletions Licence.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Licence

- Copyright 2003–2020 Austin Ziegler and other contributors.
- Copyright 2003–2021 Austin Ziegler and other contributors.

The software in this repository is made available under the MIT license.

Expand All @@ -9,17 +9,16 @@ The software in this repository is made available under the MIT license.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 44f4023

Please sign in to comment.