Sha256: ab96fb34198c8e88d97826bf6bf32ec860bbf1e7f98a2eb280d61cbf70a7f29e

Contents?: true

Size: 834 Bytes

Versions: 51

Compression:

Stored size: 834 Bytes

Contents

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'appraisal/task'
require 'avro/builder'

RSpec::Core::RakeTask.new(:default_spec)

Appraisal::Task.new

if !ENV['APPRAISAL_INITIALIZED']
  task default: :appraisal
  task spec: :appraisal
else
  task default: :default_spec
end

namespace :avro do
  desc 'Generate Avro schema files used by specs'
  task :generate_spec do
    root = 'spec/avro/dsl'
    Avro::Builder.add_load_path(root)
    Dir["#{root}/**/*.rb"].each do |dsl_file|
      puts "Generating Avro schema from #{dsl_file}"
      output_file = dsl_file.sub('/dsl/', '/schema/').sub(/\.rb$/, '.avsc')
      schema = Avro::Builder.build(File.read(dsl_file))
      FileUtils.mkdir_p(File.dirname(output_file))
      File.write(output_file, schema.end_with?("\n") ? schema : schema << "\n")
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
avromatic-1.0.0 Rakefile
avromatic-0.33.0 Rakefile
avromatic-0.32.0 Rakefile
avromatic-0.32.0.rc0 Rakefile
avromatic-0.31.0 Rakefile
avromatic-0.30.0 Rakefile
avromatic-0.29.1 Rakefile
avromatic-0.29.0 Rakefile
avromatic-0.28.1 Rakefile
avromatic-0.27.0 Rakefile
avromatic-0.26.0 Rakefile
avromatic-0.25.0 Rakefile
avromatic-0.24.0 Rakefile
avromatic-0.23.0 Rakefile
avromatic-0.22.0 Rakefile
avromatic-0.21.1 Rakefile
avromatic-0.21.0 Rakefile
avromatic-0.21.0.rc1 Rakefile
avromatic-0.21.0.rc0 Rakefile
avromatic-0.20.0 Rakefile