Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer Owen <owenspencer@gmail.com>2014-09-19 23:33:03 +0400
committerSpencer Owen <owenspencer@gmail.com>2014-09-19 23:38:12 +0400
commitb9f0508732a70a50e48c460365d7eeee059cc7c0 (patch)
tree665d11f6d3031440eb1edfadb18cd5ca96984ff0 /doc/web_hooks
parent630d042433e0cecffe80aa5ebd7aa7a91c5eb2d8 (diff)
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
Diffstat (limited to 'doc/web_hooks')
-rw-r--r--doc/web_hooks/web_hooks.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/web_hooks/web_hooks.md b/doc/web_hooks/web_hooks.md
index 13c4de4301e..16817d1933d 100644
--- a/doc/web_hooks/web_hooks.md
+++ b/doc/web_hooks/web_hooks.md
@@ -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
```