forked from github/github-services
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
29 lines (26 loc) · 807 Bytes
/
Rakefile
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
27
28
29
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
task :default => :test
task :console do
sh "irb -r ./config/load"
end
namespace :services do
desc "Writes a JSON config to FILE || config/services.json"
task :config do
file = ENV["FILE"] || File.expand_path("../config/services.json", __FILE__)
require File.expand_path("../config/load", __FILE__)
services = []
Service.services.each do |svc|
services << {:name => svc.hook_name, :events => svc.default_events,
:title => svc.title, :schema => svc.schema}
end
services.sort! { |x, y| x[:name] <=> y[:name] }
File.open file, 'w' do |io|
io << Yajl.dump(services, :pretty => true)
end
end
end