パルカワ2

最近はFlutterをやっています

Octoksというのを書いた。

GithubのHookのhook nameによって、指定された処理を行う君です。
Github::Hooks::ReceiverというPerlモジュールがあるので、それをRubyで書いてみた感じです。
ノリでrubygemsにもあげました。

http://rubygems.org/gems/octoks
https://github.com/hisaichi5518/octoks

# config.ru
require 'octoks'

receiver = Octoks::Receiver.new
receiver.on :push do |event|
  # event is the Octoks::Event object
  p event.name
  p event.payload
end

run receiver
rackup config.ru

こういう書き方、イケてるのかイケてないのか、よくわからないけどとりあえず書いてみた。

参考
https://github.com/Songmu/Github-Hooks-Receiver
https://developer.github.com/v3/activity/events/types/