Class: Ez7gen::Configurator
- Inherits:
-
Object
- Object
- Ez7gen::Configurator
- Defined in:
- lib/ez7gen/version.rb
Overview
Move the Configurator into main module
Instance Method Summary collapse
-
#configure ⇒ Object
This works with some corks, will be needed for external location of schema files.
Instance Method Details
#configure ⇒ Object
This works with some corks, will be needed for external location of schema files
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ez7gen/version.rb', line 12 def configure() properties_file = File.('../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.('../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 |