Skip to content
Snippets Groups Projects
Commit b9f05087 authored by Spencer Owen's avatar Spencer Owen
Browse files

Adds support for ruby 1.8 in webhook example, issue #7763

By using the hash rocket syntax, the web hook will work on older versions of ruby (1.8) in addition to 1.9, 2.0 ect..
Moves do .. end to separate lines for ruby-lint.

Additional Information:
http://stackoverflow.com/questions/25899476/webrick-gives-error-unexpected-expecting-end
https://github.com/spuder/r10k_gitlab_webhook
parent 630d0424
No related branches found
No related tags found
1 merge request!7798Adds support for ruby 1.8 in webhook example
Loading
Loading
@@ -124,12 +124,14 @@ Save the following file as `print_http_body.rb`.
```ruby
require 'webrick'
 
server = WEBrick::HTTPServer.new(Port: ARGV.first)
server = WEBrick::HTTPServer.new(:Port => ARGV.first)
server.mount_proc '/' do |req, res|
puts req.body
end
 
trap 'INT' do server.shutdown end
trap 'INT' do
server.shutdown
end
server.start
```
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment