lib/service_contract/tasks.rb in service_contract-0.0.5 vs lib/service_contract/tasks.rb in service_contract-0.0.6

- old
+ new

@@ -3,12 +3,14 @@ task :build do jar_file = File.expand_path("../../../src/avro-tools-1.7.7.jar", __FILE__) spec_dir = File.expand_path(".") Dir.glob(File.join(spec_dir, "/**/*.avdl")) do |file| puts file - new_file = File.expand_path(File.join(File.dirname(file), "../compiled", File.basename(file, ".avdl"))) + folder = File.expand_path(File.join(File.dirname(file), "../compiled")) + FileUtils.mkdir_p(folder) + new_file = File.join(folder, File.basename(file, ".avdl")) command = "java -jar #{jar_file} idl #{file} #{new_file}.avpr" puts command `#{command}` end end -end \ No newline at end of file +end