Skip to content

Commit

Permalink
working ruby code-gen rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
daino3 committed Jun 2, 2017
1 parent d0a56b9 commit 1d84d20
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion generator/ruby/bin/generate
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/usr/bin/env ruby

require_relative '../generator'
require 'fileutils'

PROJECT_ROOT = File.expand_path("./../../../../", __FILE__)
DESTINATION = ARGV[0] || "#{PROJECT_ROOT}/QuickFIXn/Message"

Dir["#{PROJECT_ROOT}/spec/fix/*.xml"].each do |data_dictionary|
xdoc = Nokogiri::XML(File.read(data_dictionary))
dd = DataDictionay.new(xdoc)
dd.save(ARGV[0] || "#{PROJECT_ROOT}/spec/tmp")
dd.save(DESTINATION)
end

# remove FIX11 directory and contents (session-level code gen)
FileUtils.rm_rf("#{DESTINATION}/FIX11")

0 comments on commit 1d84d20

Please sign in to comment.