-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconfig.ru
More file actions
26 lines (18 loc) · 697 Bytes
/
config.ru
File metadata and controls
26 lines (18 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'octokit'
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'lib')
require 'dredd'
config = Dredd::Config.from_file('config/config.yml')
TEMPLATE = <<-EOT
Hey <%= username %>!
Thanks for submitting this pull request!
EOT
github_client = Octokit::Client.new(login: config.username,
oauth_token: config.token)
bootstrapper = Dredd::HookBootstrapper.new(github_client, config.callback_url)
config.repositories.each do |repo|
bootstrapper.bootstrap_repository(repo)
end
commenter = Dredd::PullRequestCommenter.new(github_client, TEMPLATE)
filterer = Dredd::UsernameFilterer.new(commenter, config.allowed_usernames)
Dredd::DreddApp.set :commenter, filterer
run Dredd::DreddApp