Commit ff31080b authored by Jacob Vosmaer's avatar Jacob Vosmaer

Merge branch 'fix/ruby-2.2-webrick' into 'master'

workaround for webrick issue on ruby 2.2

Workaround that fixes https://gitlab.com/gitlab-org/gitlab-shell/issues/36

See merge request !38
parents 6a88498b c28af5c6
image: "ruby:2.2"
before_script:
- export PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
- apt-get update
......@@ -6,6 +8,7 @@ before_script:
- cp config.yml.example config.yml
- bundle install
#ruby 2.2
rspec:
script:
- bundle exec rspec spec
......@@ -21,3 +24,22 @@ rubocop:
- ruby
except:
- tags
#ruby 2.1
rspec:ruby2.1:
image: ruby:2.1
script:
- bundle exec rspec spec
tags:
- ruby
except:
- tags
rubocop:ruby2.1:
image: ruby:2.1
script:
- bundle exec rubocop
tags:
- ruby
except:
- tags
......@@ -24,6 +24,23 @@ class HTTPUNIXServer < WEBrick::HTTPServer
socket.close
@listeners << server
end
# Workaround:
# https://bugs.ruby-lang.org/issues/10956
# Affecting Ruby 2.2
# Fix for 2.2 is at https://github.com/ruby/ruby/commit/ab0a64e1
# However, this doesn't work with 2.1. The following should work for both:
def start(&block)
@shutdown_pipe = IO.pipe
shutdown_pipe = @shutdown_pipe
super(&block)
end
def cleanup_shutdown_pipe(shutdown_pipe)
@shutdown_pipe = nil
return if !shutdown_pipe
super(shutdown_pipe)
end
end
def tmp_socket_path
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment