Sha256: 59e86840bbf58870ef62c12c49284e3c5f15a7832f39f388333f092b566a1b79

Contents?: true

Size: 987 Bytes

Versions: 1

Compression:

Stored size: 987 Bytes

Contents

#!/usr/bin/env ruby
require "rubygems"

require "optparse"
require "ar2gostruct"

OptionParser.new do |opt|
  opt.banner = "Usage: ar2gostruct [options]"

  opt.on("-v", "--version",
          "Show the current version of this gem") do
    puts "ar2gostruct v#{Ar2gostruct.version}"; exit
  end

  opt.on("--association", "Enable association") do
    ENV["association"] = "true"
  end

  opt.on("--orm orm", "Specify ORM. Currently supports only qbs") do |orm|
    ENV["orm"] = orm.to_s
  end

  opt.on("--plural", "Pluralize struct name") do
    ENV["plural"] = "true"
  end

  opt.on("--model-dir dir",
          "Model files stored in dir rather than app/models") do |dir|
    ENV["model_dir"] = dir.to_s
  end

  opt.on("--package pkgname", 
         "package name so structs can be imported") do |p|
    ENV["package"] = p.to_s
  end

  opt.on("--require r", "require path") do |r|
    ENV["require_path"] = r.to_s
  end
  opt.parse!(ARGV)
end
Ar2gostruct.load
Ar2gostruct.convert!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ar2gostruct-0.2.2 bin/ar2gostruct