Sha256: 33ed783b3350d1b2d4014dd4b3860a553f0a8083919a0874246157e32ce9c5fa

Contents?: true

Size: 638 Bytes

Versions: 8

Compression:

Stored size: 638 Bytes

Contents

namespace :value_set do

  desc 'Parse a value set to JSON'
  task :parse, [:path] do |t, args|
    
    raise "You must specify the value set xls file path to parse" unless args.path

    FileUtils.mkdir_p File.join(".","tmp",'json','value_sets')
    path = File.expand_path(args.path)

    parser = HQMF::ValueSet::Parser.new
    parsed = parser.parse path
    
    file = File.expand_path(path)
    filename = Pathname.new(file).basename
    
    outfile = File.join(".","tmp",'json', 'value_sets', "#{filename}.json")
    File.open(outfile, 'w') {|f| f.write(parsed.to_json) }
    puts "wrote result to: #{outfile}"
    
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hqmf-parser-1.1.0 lib/tasks/value_sets.rake
hqmf-parser-1.0.6 lib/tasks/value_sets.rake
hqmf-parser-1.0.5 lib/tasks/value_sets.rake
hqmf-parser-1.0.4 lib/tasks/value_sets.rake
hqmf-parser-1.0.3 lib/tasks/value_sets.rake
hqmf-parser-1.0.2 lib/tasks/value_sets.rake
hqmf-parser-1.0.1 lib/tasks/value_sets.rake
hqmf-parser-1.0.0 lib/tasks/value_sets.rake