Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 30 lines (23 sloc) 0.576 kb
8c2d166 @jarib Initial commit
authored
1 require 'bundler'
2 Bundler::GemHelper.install_tasks
3
4 require 'rspec/core/rake_task'
72118f2 @jarib Move schema generation to the Rakefile.
authored
5 RSpec::Core::RakeTask.new
6
7 desc 'Regenerate the schema files'
8 task :schema do
9 require "json"
10
11 out = File.expand_path("../lib/har/schemas", __FILE__)
12 schema = JSON.parse(File.read("schema.json"))
13
14 # cleanup
15 Dir[File.join(out, "*.json")].each { |f|
16 rm f
17 }
18
19 # generate
20 schema.each do |type, schema|
ff3fc22 @jarib Fixing schema validation.
authored
21 path = File.join(out, type)
72118f2 @jarib Move schema generation to the Rakefile.
authored
22 puts path
23
24 File.open(path, "w") { |file|
25 file << JSON.pretty_generate(schema)
26 }
27 end
f6b3c52 @jarib Add rake dep and default task.
authored
28 end
29
30 task :default => :spec
Something went wrong with that request. Please try again.