Skip to content

Commit

Permalink
Merge branch 'master' into fix_up_config_defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
jalevin authored Apr 13, 2020
2 parents d8b72e8 + 19b2a21 commit e1a1750
Show file tree
Hide file tree
Showing 78 changed files with 1,033 additions and 1,498 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/puma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: CI

on: [push, pull_request]

jobs:
build:
name: >-
${{ matrix.os }} ${{ matrix.ruby }}
env:
CI: true
TESTOPTS: -v

runs-on: ${{ matrix.os }}-latest
if: |
!(contains(github.event.pull_request.title, '[ci skip]')
|| contains(github.event.head_commit.message, '[ci skip]'))
strategy:
fail-fast: false
matrix:
os: [ ubuntu, macos, windows ]
ruby: [ 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, head, jruby, truffleruby-head ]
include:
- { os: windows , ruby: mingw }
exclude:
- { os: windows , ruby: head }
- { os: windows , ruby: jruby }
- { os: windows , ruby: truffleruby-head }

steps:
- name: repo checkout
uses: actions/checkout@v2

- name: load ruby, ragel
uses: MSP-Greg/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: 1
apt-get: ragel
brew: ragel
mingw: _upgrade_ openssl ragel

- name: bundle install
shell: pwsh
run: |
# update RubyGems in Ruby 2.2, bundle install
if ('${{ matrix.ruby }}' -lt '2.3') {
gem update --system 2.7.10 --no-document
}
bundle install --jobs 4 --retry 3 --path=.bundle/puma
- name: compile
run: bundle exec rake compile

- name: rubocop
if: startsWith(matrix.ruby, '2.')
run: bundle exec rake rubocop

- name: test
timeout-minutes: 10
run: bundle exec rake test:all

allowedFailures:
name: >-
optional: ${{ matrix.os }} ${{ matrix.ruby }}
env:
CI: true
TESTOPTS: -v

runs-on: ${{ matrix.os }}-latest
if: |
!(contains(github.event.pull_request.title, '[ci skip]')
|| contains(github.event.head_commit.message, '[ci skip]'))
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu, ruby: jruby-head }

steps:
- name: repo checkout
uses: actions/checkout@v2

- name: load ruby, ragel
uses: MSP-Greg/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
apt-get: ragel
brew: ragel

- name: bundle install
run: |
bundle install --jobs 4 --retry 3 --path=.bundle/puma
- name: compile
continue-on-error: true
run: bundle exec rake compile

- name: test
timeout-minutes: 10
continue-on-error: true
if: success()
run: bundle exec rake
106 changes: 0 additions & 106 deletions .github/workflows/ruby.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ AllCops:
Exclude:
- 'tmp/**/*'
- 'vendor/**/*'
- 'examples/**/*'
- 'pkg/**/*'
- 'Rakefile'

Layout/SpaceAfterColon:
Expand Down Expand Up @@ -53,3 +55,24 @@ Style/TrailingCommaInArguments:

Performance:
Enabled: true

Metrics/ParameterLists:
Max: 7

Performance/RedundantMatch:
Enabled: true

Performance/RedundantBlockCall:
Enabled: true

Performance/StringReplacement:
Enabled: true

Layout/AccessModifierIndentation:
EnforcedStyle: indent

Style/WhileUntilModifier:
Enabled: true

Style/TernaryParentheses:
Enabled: true
30 changes: 1 addition & 29 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,7 @@ Layout/EmptyLinesAroundModuleBody:
# 5 offenses
Layout/IndentationWidth:
Enabled: true

# 3 offenses
Layout/AccessModifierIndentation:
EnforcedStyle: indent

# 2 offenses
Style/WhileUntilModifier:
Enabled: true

# 1 offense
Style/TernaryParentheses:
Enabled: true


# >200 offenses for 80
# 58 offenses for 100
# 18 offenses for 120
Expand All @@ -64,19 +52,3 @@ Metrics/LineLength:
- https
IgnoreCopDirectives: false
IgnoredPatterns: []

# 1 offense
Metrics/ParameterLists:
Max: 5

# 1 offense
Performance/RedundantMatch:
Enabled: true

# 1 offense
Performance/RedundantBlockCall:
Enabled: true

# 1 offense
Performance/StringReplacement:
Enabled: true
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

14 changes: 9 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,26 @@ There are lots of ways to contribute to puma. Some examples include:

* creating a [bug report] or [feature request]
* verifying [existing bug reports] and adding [reproduction steps]
* reviewing [pull requests] and testing the changes on your own machine
* writing or editing documentation
* reviewing [pull requests] and testing the changes locally, on your own machine
* writing or editing [documentation]
* improving test coverage
* fixing a [reproducing bug] or adding a new feature

[bug report]: https://github.com/puma/puma/issues/new?template=bug_report.md
[feature request]: https://github.com/puma/puma/issues/new?template=feature_request.md
[existing bug reports]: https://github.com/puma/puma/issues?q=is%3Aopen+is%3Aissue+label%3Aneeds-repro
[pull requests]: https://github.com/puma/puma/pulls
[documentation]: https://github.com/puma/puma/tree/master/docs
[reproduction steps]: https://github.com/puma/puma/blob/CONTRIBUTING.md#reproduction-steps
[reproducing bug]: https://github.com/puma/puma/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Abug

Newbies welcome! We would be happy to help you make your first contribution to a F/OSS project.

## Setup

Clone down the Puma repository.

You will need to install [ragel] to generate puma's extension code.
You will need to install [ragel] (use Ragel version 7.0.0.9) to generate puma's extension code.

macOS:

Expand Down Expand Up @@ -68,7 +71,7 @@ bundle exec rake test:all
To run a single test file:

```sh
ruby -Ilib test/test_binder.rb
bundle exec ruby test/test_binder.rb
```

Or use [`m`](https://github.com/qrush/m):
Expand Down Expand Up @@ -112,7 +115,7 @@ bundle exec puma -C <path/to/config.rb> <path/to/rackup.ru>
```

As an example, using one of the test rack apps:
[`test/rackup/hello.ru`][rackup], and one of the test config files:
[`test/rackup/hello.ru`][rackup file], and one of the test config files:
[`test/config/settings.rb`][config], you would run the test app with:

```sh
Expand Down Expand Up @@ -144,6 +147,7 @@ check](https://github.com/puma/puma/pull/1991).

Puma can be a bit intimidating for your first contribution because there's a lot of concepts here that you've probably never had to think about before - Rack, sockets, forking, threads etc. Here are some helpful links for learning more about things related to Puma:

* [Puma's Architecture docs](https://github.com/puma/puma/blob/master/docs/architecture.md)
* [The Rack specification](https://www.rubydoc.info/github/rack/rack/file/SPEC)
* The Ruby docs for IO.pipe, TCPServer/Socket.
* [nio4r documentation](https://github.com/socketry/nio4r/wiki/Getting-Started)
Loading

0 comments on commit e1a1750

Please sign in to comment.