forked from slack-ruby/slack-api-ref
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmethods.rake
More file actions
26 lines (24 loc) · 770 Bytes
/
methods.rake
File metadata and controls
26 lines (24 loc) · 770 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_relative 'lib/slack_api/methods_generator'
require_relative 'lib/slack_api/spec_validator'
namespace :api do
namespace :methods do
desc 'Validate scraped methods are valid.'
task :validate do
schema = File.read('schemas/methods.json')
validator = SlackApi::SpecValidator.new(schema)
Dir.glob('methods/**/*.json')
.grep_v(%r{/_patches\b})
.grep_v(%r{/_errors\b})
.each do |file|
puts file
abort "Invalid file format: #{file}" unless validator.valid?(file)
end
end
desc 'Update methods.'
task :update do
Rake::Task['api:clean_files'].invoke('methods')
Rake::Task['api:clean_files'].invoke('groups')
SlackApi::MethodsGenerator.new.generate!
end
end
end