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: before_script:
- export PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin - export PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
- apt-get update - apt-get update
...@@ -6,6 +8,7 @@ before_script: ...@@ -6,6 +8,7 @@ before_script:
- cp config.yml.example config.yml - cp config.yml.example config.yml
- bundle install - bundle install
#ruby 2.2
rspec: rspec:
script: script:
- bundle exec rspec spec - bundle exec rspec spec
...@@ -21,3 +24,22 @@ rubocop: ...@@ -21,3 +24,22 @@ rubocop:
- ruby - ruby
except: except:
- tags - 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 ...@@ -24,6 +24,23 @@ class HTTPUNIXServer < WEBrick::HTTPServer
socket.close socket.close
@listeners << server @listeners << server
end 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 end
def tmp_socket_path 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