forked from crashlytics/crashlytics-services
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
37 lines (28 loc) · 862 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
30
31
32
33
34
35
36
37
#!/usr/bin/env rake
require 'rake/testtask'
require 'rspec/core/rake_task'
require 'bundler/gem_tasks'
RSpec::Core::RakeTask.new('spec')
desc 'Run tests'
task :default => :spec
namespace :services do
desc 'Writes a YAML config to $FILE || the current directory'
task :config do
$:.unshift "#{ File.dirname(__FILE__) }/lib"
require 'service'
require 'yaml'
file = ENV['FILE'] || File.join(File.dirname(__FILE__), 'service_hooks.yml')
services = []
Service.services.each do |identifier, svc|
services << {
:identifier => identifier,
:name => svc.title,
:events => svc.events_handled,
:schema => svc.schema }
end
services.sort! { |x, y| x[:identifier] <=> y[:identifier] }
output = YAML::dump(services)
File.open(file, 'w') { |io| io << output }
puts output
end
end