Sha256: ba40df4e9fb0ec0056aa5ffbe842d9b6a49dcb3942633ed91df80e88b4d84675

Contents?: true

Size: 576 Bytes

Versions: 9

Compression:

Stored size: 576 Bytes

Contents

require 'bundler'
Bundler::GemHelper.install_tasks

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new

desc 'Regenerate the schema files'
task :schema do
  require "json"
  
  out    = File.expand_path("../lib/har/schemas", __FILE__)
  schema = JSON.parse(File.read("schema.json"))
  
  # cleanup
  Dir[File.join(out, "*.json")].each { |f| 
    rm f
  }
  
  # generate
  schema.each do |type, schema|
    path = File.join(out, type)
    puts path
    
    File.open(path, "w") { |file|
      file << JSON.pretty_generate(schema)
    }
  end
end

task :default => :spec

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
har-0.1.5 Rakefile
har-0.1.4 Rakefile
har-0.1.3 Rakefile
har-0.1.2 Rakefile
har-0.1.1 Rakefile
har-0.1.0 Rakefile
har-0.0.9 Rakefile
har-0.0.8 Rakefile
har-0.0.7 Rakefile