Sha256: 85b2e40945ef18fa03e26f34fc12e48f26a2d205f9779a67b0620767c8fd3d90

Contents?: true

Size: 824 Bytes

Versions: 3

Compression:

Stored size: 824 Bytes

Contents

#!/usr/bin/env ruby -w -I..

if $0 == __FILE__ then

  class File
    def File.sjoin(*args)
      File.join(args.select{ | o | o })
    end
  end

  require 'xamplr-generator'

  include XamplGenerator
  include Xampl

  Xampl.transaction("setup", :in_memory) do
    directory = File.sjoin(".", "xampl_generated_code")

    options = Xampl.make(Options) do |options|
      options.new_index_attribute("pid").persisted = true
      options.new_index_attribute("id")

      options.resolve("http://xampl.com/people", "RandomPeople", "p")
    end

    filenames = Dir.glob("./xml/**/*.xml")

    generator = Generator.new
    generator.go(:options => options,
                 :filenames => filenames,
                 :directory => directory)

    puts generator.print_elements("./generated-elements.xml")
    exit!
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
hutch-xamplr-1.1.4 examples/random-people-shared-addresses/xampl-gen.rb
hutch-xamplr-1.2.0 examples/random-people-shared-addresses/xampl-gen.rb
xamplr-1.2.0 examples/random-people-shared-addresses/xampl-gen.rb