Modify: add new builtin data source "web-001" (experimental)
This commit adds simple web server functionality. It is more for one-liners. If the ring method is defined in outvoke.conf.rb and port 8080 is free, then if you start Outoke as follows and then access lodalhost:8080 via HTTP, you will hear a sound each time you access. ./outvoke.rb -e 'hookweb{ring}' It may be more convenient to do it as follows: ./outvoke.rb -e 'hookweb{ring; "ok"}' The following example displays the request headers in an easy-to-read format. ./outvoke.rb -e 'hookweb{ _1.req.header.to_yaml }' You can change the port by doing the following outside the block passed to the hook. $outvoke["web-001"].port = 8081 You can also put the above line in outvoke.conf.rb. The data source “web-001” uses the following features recently added to Outvoke: - post_procs (20f8d9c1) - attachment (d558e477) - msgid (0c1a0563) - new instance variable "ds" (835cc873) - new instance variable "outvoke" (bf184875) - OutvokeDataSource#generate_context (698e59bc) This commit is also related to 1c328546 which changed to use Object#to_yaml instead of Marshal.#dump. Because both WEBrick::HTTPRequest objects and WEBrick::HTTPResponse objects cause errors when Marshal.#dump.
Showing
- outvoke.rb 183 additions, 3 deletionsoutvoke.rb
- samples/2024/websrv_minsample1.rb 43 additions, 0 deletionssamples/2024/websrv_minsample1.rb
- samples/2024/websrv_minsample2.rb 65 additions, 0 deletionssamples/2024/websrv_minsample2.rb
- samples/2024/websrv_minsample3.rb 41 additions, 0 deletionssamples/2024/websrv_minsample3.rb
- samples/2024/websrv_minsample4.rb 21 additions, 0 deletionssamples/2024/websrv_minsample4.rb
- samples/2024/websrv_minsample5.rb 27 additions, 0 deletionssamples/2024/websrv_minsample5.rb
samples/2024/websrv_minsample1.rb
0 → 100644
samples/2024/websrv_minsample2.rb
0 → 100644
samples/2024/websrv_minsample3.rb
0 → 100644
samples/2024/websrv_minsample4.rb
0 → 100644
samples/2024/websrv_minsample5.rb
0 → 100644
Please register or sign in to comment