Skip to content

Commit 6e9e894

Browse files
committed
text-hyphen project modernization
- Changed documentation to markdown - Added a code of conduct - Added GitHub Actions workflow for CI - Fix a `latin1` -> `iso-8859-1` bug - Use Standard Ruby formatting for tests, ignoring Ruby 1.8 language files - Replace missing test/unit task (no minitest migration yet) - Add test/unit gem for CI
1 parent b9319ee commit 6e9e894

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1352
-971
lines changed

.autotest

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
1-
# -*- ruby -*-
1+
# frozen_string_literal: true
22

3+
require 'autotest/bundler'
34
require 'autotest/restart'
5+
require 'autotest/timestamp'
46

5-
# Autotest.add_hook :initialize do |at|
6-
# at.extra_files << "../some/external/dependency.rb"
7-
#
8-
# at.libs << ":../some/external"
9-
#
10-
# at.add_exception 'vendor'
11-
#
12-
# at.add_mapping(/dependency.rb/) do |f, _|
13-
# at.files_matching(/test_.*rb$/)
14-
# end
15-
#
16-
# %w(TestA TestB).each do |klass|
17-
# at.extra_class_map[klass] = "test/test_misc.rb"
18-
# end
19-
# end
7+
def require_plugin(resource)
8+
require resource
9+
rescue LoadError
10+
false
11+
end
12+
13+
require_plugin 'autotest/clear'
14+
15+
Autotest.add_hook :initialize do |at|
16+
# at.testlib = "minitest/unit"
17+
#
18+
# at.extra_files << "../some/external/dependency.rb"
19+
#
20+
# at.libs << ":../some/external"
21+
#
22+
# at.add_exception "vendor"
23+
#
24+
# at.add_mapping(/dependency.rb/) do |f, _|
25+
# at.files_matching(/test_.*rb$/)
26+
# end
27+
#
28+
# %w(TestA TestB).each do |klass|
29+
# at.extra_class_map[klass] = "test/test_misc.rb"
30+
# end
31+
end
2032

2133
# Autotest.add_hook :run_command do |at|
2234
# system "rake build"

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7+
8+
name: CI
9+
10+
on:
11+
push:
12+
branches: [main, master]
13+
pull_request:
14+
branches: [main, master]
15+
16+
jobs:
17+
test:
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os:
22+
- macos-latest
23+
- ubuntu-20.04
24+
ruby:
25+
- '2.6'
26+
- '2.7'
27+
- '3.0'
28+
- '3.1'
29+
- '3.2'
30+
- head
31+
- jruby
32+
- jruby-head
33+
- truffleruby
34+
- truffleruby-head
35+
- truffleruby+graalvm
36+
- truffleruby+graalvm-head
37+
include:
38+
- ruby: head
39+
continue-on-error: true
40+
- ruby: jruby-head
41+
continue-on-error: true
42+
- os: windows-latest
43+
ruby: mingw
44+
- os: windows-latest
45+
ruby: mswin
46+
- os: windows-latest
47+
ruby: jruby
48+
continue-on-error: true
49+
- os: ubuntu-22.04
50+
ruby: head
51+
- os: ubuntu-22.04
52+
ruby: '3.1'
53+
- os: ubuntu-22.04
54+
ruby: '3.2'
55+
runs-on: ${{ matrix.os }}
56+
continue-on-error: ${{ matrix.continue-on-error || false }}
57+
steps:
58+
- uses: actions/checkout@v3
59+
- uses: ruby/setup-ruby@v1
60+
with:
61+
ruby-version: ${{ matrix.ruby }}
62+
rubygems: ${{ matrix.rubygems || 'latest' }}
63+
bundler: 2
64+
bundler-cache: true
65+
- run: bundle exec ruby -S rake test --trace

.gitignore

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
*.gem
2-
*.pyc
3-
*.rbc
4-
*.swp
5-
*.gem
6-
*~
7-
.DS_Store
2+
.byebug_history
83
.rake_tasks~
9-
.rvmrc
104
.source_index
11-
Gemfile.lock
125
coverage.info
136
coverage/
147
doc/
8+
Gemfile.lock
159
html/
1610
pkg/
1711
publish/
18-
research/
19-
website/index.html
12+
.ruby-version
13+
.envrc

.hoerc

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
11
---
2-
exclude: !ruby/regexp /(tmp|swp)$|CVS|TAGS|\.(svn|git|hg|DS_Store|idea)|Gemfile\.lock|research\/|\.gemspec$/
2+
exclude: !ruby/regexp '/
3+
\.(?:
4+
tmp |
5+
swp
6+
)$
7+
|
8+
\.(?:
9+
bundle|
10+
git|
11+
github|
12+
hg|
13+
idea|
14+
svn|
15+
vagrant
16+
)\/
17+
|
18+
[gG]emfile(?:\.lock)?
19+
|
20+
(?:
21+
support |
22+
research
23+
)\/
24+
|
25+
\.(?:
26+
appveyor |
27+
coveralls |
28+
fasterer |
29+
pullreview |
30+
rubocop.* |
31+
travis |
32+
unused
33+
)\.yml$
34+
|
35+
(?i:TAGS)$
36+
|
37+
\.(?:
38+
DS_Store |
39+
autotest |
40+
byebug_history |
41+
gemtest |
42+
gitattributes |
43+
gitignore |
44+
hoerc |
45+
minitest.rb |
46+
simplecov-prelude.rb
47+
)$
48+
|
49+
\.gemspec$
50+
|
51+
Vagrantfile$
52+
/x'

.standard.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parallel: true
2+
ruby_version: 1.8
3+
ignore:
4+
- '*.gemspec'
5+
- 'lib/text/hyphen/language/1.8/*.rb'

Code-of-Conduct.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and 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 [INSERT EMAIL ADDRESS]. 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 https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org

Contributing.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Contributing
2+
3+
I value any contribution to text-hyphen you can provide: a bug report, a feature
4+
request, or code contributions.
5+
6+
There are a few guidelines for contributing to text-hyphen:
7+
8+
- Code changes _will_ _not_ be accepted without tests. The test suite is
9+
written with test/unit and will be eventually moved to [minitest][].
10+
- Match my coding style.
11+
- Use a thoughtfully-named topic branch that contains your change. Rebase your
12+
commits into logical chunks as necessary.
13+
- Use [quality commit messages][].
14+
- Do not change the version number; when your patch is accepted and a release
15+
is made, the version will be updated at that point.
16+
- Submit a GitHub pull request with your changes.
17+
- New or changed behaviours require new or updated documentation.
18+
19+
### Test Dependencies
20+
21+
text-hyphen uses Ryan Davis’s [Hoe][] to manage the release process, and it adds
22+
a number of rake tasks. You will mostly be interested in `rake`, which runs the
23+
tests the same way that `rake test` will do.
24+
25+
To assist with the installation of the development dependencies for text-hyphen,
26+
I have provided the simplest possible Gemfile pointing to the (generated)
27+
`text-hyphen.gemspec` file. This will permit you to do `bundle install` to get
28+
the development dependencies. If you already have `hoe` installed, you can
29+
accomplish the same thing with `rake newb`.
30+
31+
This task will install any missing dependencies, run the tests/specs, and
32+
generate the RDoc.
33+
34+
You can run tests with code coverage analysis by running `rake test:coverage`.
35+
36+
## Workflow
37+
38+
Here's the most direct way to get your work merged into the project:
39+
40+
- Fork the project.
41+
- Clone down your fork (`git clone git://github.com/<username>/text-hyphen.git`).
42+
- Create a topic branch to contain your change (`git checkout -b my_awesome_feature`).
43+
- Hack away, add tests. Not necessarily in that order.
44+
- Make sure everything still passes by running `rake`.
45+
- If necessary, rebase your commits into logical chunks, without errors.
46+
- Push the branch up (`git push origin my_awesome_feature`).
47+
- Create a pull request against halostatue/text-hyphen and describe what
48+
your change does and the why you think it should be merged.
49+
50+
## Contributors
51+
52+
- Austin Ziegler created text-hyphen based on TeX::Hyphen by Martin DeMello.
53+
54+
Thanks to everyone else who has contributed to text-hyphen over the years:
55+
56+
- anes hodza
57+
- Cezary Baginsky
58+
- Dmitry Lihachev
59+
- Kirill Maksimov
60+
- @hadmut
61+
- Markus (@doits)
62+
- Martin DeMello
63+
- Pavol Sopko
64+
- Petras Kudaras
65+
66+
[minitest]: https://github.com/seattlerb/minitest
67+
[quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
68+
[hoe]: https://github.com/seattlerb/hoe

Gemfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# -*- ruby -*-
2-
3-
# NOTE: This file is present to keep Travis CI happy. Edits to it will not
4-
# be accepted.
1+
# NOTE: This file is not the canonical source of dependencies. Edit the
2+
# Rakefile, instead.
53

64
source "https://rubygems.org/"
75
gemspec

0 commit comments

Comments
 (0)