class Ez7gen::Configurator

Move the Configurator into main module

Public Instance Methods

configure() click to toggle source

This works with some corks, will be needed for external location of schema files

# File lib/ez7gen/version.rb, line 12
def configure()

  properties_file = File.expand_path('../resources/properties.yml', __FILE__)
  yml = YAML.load_file properties_file
  puts 'Before update schema location:' + ((yml['web.install.dir']) ? yml['web.install.dir'] : 'schema location not set')

  #This will remove all comments
  if(ARGV[0])
    yml['web.install.dir'] =  ARGV[0].gsub("\\", '/') # convert windows path to linux, ruby defaults to that
    File.open(properties_file, 'w') { |f| YAML.dump(yml, f) }
  end

  # This will add multiple properties
  # if(ARGV[0])
  #   file = File.open(propertiesFile, 'a')
  #   file.puts 'schema.dir.location: ' + ARGV[0]
  #   file.flush
  # end


  properties_file = File.expand_path('../resources/properties.yml', __FILE__)
  yml = YAML.load_file properties_file
  puts 'After update schema location:' + ((yml['web.install.dir']!=nil)?yml['web.install.dir']:'schema location not set')
end