Skip to content

Use bundler for installing dependencies, fix ruby-head issues #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ jobs:
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
ruby: ['3.0', '3.1', '3.2', '3.3', 'ruby-head']
rack: ['2', '3']
gemfile: ['rack-2', 'rack-3']

name: Ruby ${{ matrix.ruby }} - Rack ${{ matrix.rack }}
name: Ruby ${{ matrix.ruby }} - Rack ${{ matrix.gemfile }}

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile

steps:
- uses: actions/checkout@v4
Expand All @@ -31,11 +35,5 @@ jobs:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}

- name: Install raindrops
run: gem install raindrops-maintained -v 0.21.0

- name: Install Rack ${{ matrix.rack }}
run: gem install rack -v '~> ${{ matrix.rack }}.0'

- name: Run tests with perl prove
run: make -j1 && prove -vw
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ pkg/
/LATEST
/lib/unicorn/version.rb
/*_1
Gemfile.lock
gemfiles/*.lock
6 changes: 3 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ all:: test

RLFLAGS = -G2

MRI = ruby
RUBY = ruby
RAKE = rake
MRI = bundle exec ruby
RUBY = bundle exec ruby
RAKE = bundle exec rake
RAGEL = ragel
RSYNC = rsync
OLDDOC = olddoc
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gemspec
5 changes: 5 additions & 0 deletions gemfiles/rack-2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gemspec path: "../"

gem "rack", "~> 2.0"
5 changes: 5 additions & 0 deletions gemfiles/rack-3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gemspec path: "../"

gem "rack", "~> 3.0"
1 change: 1 addition & 0 deletions lib/unicorn.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false
require 'etc'
require 'stringio'
require 'raindrops'
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/app/old_rails.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false

# :enddoc:
# This code is based on the original Rails handler in Mongrel
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/app/old_rails/static.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false
# :enddoc:
# This code is based on the original Rails handler in Mongrel
# Copyright (c) 2005 Zed A. Shaw
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/cgi_wrapper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false

# :enddoc:
# This code is based on the original CGIWrapper from Mongrel
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/configurator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false
require 'logger'

# Implements a simple DSL for configuring a unicorn server.
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/const.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false

module Unicorn::Const # :nodoc:
# default TCP listen host address (0.0.0.0, all interfaces)
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/http_request.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false
# :enddoc:
# no stable API here
require 'unicorn_http'
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/http_response.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false
# :enddoc:
# Writes a Rack response to your client using the HTTP/1.1 specification.
# You use it by simply doing:
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/http_server.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false

# This is the process manager of Unicorn. This manages worker
# processes which in turn handle the I/O and application process.
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/launcher.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false

# :enddoc:
$stdout.sync = $stderr.sync = true
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/oob_gc.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false

# Strongly consider https://github.com/tmm1/gctools if using Ruby 2.1+
# It is built on new APIs in Ruby 2.1, so it is more intelligent than
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/preread_input.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false

module Unicorn
# This middleware is used to ensure input is buffered to memory
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/select_waiter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: false
# fallback for non-Linux and Linux <4.5 systems w/o EPOLLEXCLUSIVE
class Unicorn::SelectWaiter # :nodoc:
def get_readers(ready, readers, timeout) # :nodoc:
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/socket_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false
# :enddoc:
require 'socket'

Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/stream_input.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false

# When processing uploads, unicorn may expose a StreamInput object under
# "rack.input" of the Rack environment when
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/tee_input.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false

# Acts like tee(1) on an input input to provide a input-like stream
# while providing rewindable semantics through a File/StringIO backing
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/tmpio.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false
# :stopdoc:
require 'tmpdir'

Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/util.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false

require 'fcntl'
module Unicorn::Util # :nodoc:
Expand Down
1 change: 1 addition & 0 deletions lib/unicorn/worker.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: binary -*-
# frozen_string_literal: false
require "raindrops"

# This class and its members can be considered a stable interface
Expand Down
2 changes: 1 addition & 1 deletion t/lib.perl
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ sub unicorn {
state $eng = $ENV{TEST_RUBY_ENGINE} // `$ruby -e 'print RUBY_ENGINE'`;
state $ext = File::Spec->rel2abs("test/$eng-$ver/ext/unicorn_http");
state $exe = File::Spec->rel2abs('bin/unicorn');
my $pid = spawn(\%env, $ruby, '-I', $lib, '-I', $ext, $exe, @args);
my $pid = spawn(\%env, 'bundle', 'exec', $ruby, '-I', $lib, '-I', $ext, $exe, @args);
UnicornTest::AutoReap->new($pid);
}

Expand Down