test/setpath.rb in ruby_odata-0.0.10 vs test/setpath.rb in ruby_odata-0.1.0
- old
+ new
@@ -1,3 +1,13 @@
-# Open template config file and write in current directory to virtual path
-puts "Replacing %SAMPLE_SERVICE_DIR% with #{Dir.pwd}\\SampleService"
-File.open("applicationhost.config", "w") {|file| file.puts File.read("applicationhost.config.template").gsub("%SAMPLE_SERVICE_DIR%", "#{Dir.pwd.gsub("\/", "\\")}\\SampleService" ) }
+require File.expand_path('../../features/support/constants', __FILE__)
+
+# Open template config file and write in proper data
+puts "Replacing Configuration Data"
+File.open("applicationhost.config", "w") do |file|
+ File.open("applicationhost.config.template", 'r').each do |line|
+ line.gsub!("%SAMPLE_SERVICE_DIR%", "#{Dir.pwd.gsub("\/", "\\")}\\RubyODataService\\RubyODataService")
+ line.gsub!("%HTTP_PORT_NUMBER%", "#{HTTP_PORT_NUMBER}")
+ line.gsub!("%HTTPS_PORT_NUMBER%", "#{HTTPS_PORT_NUMBER}")
+ line.gsub!("%WEBSERVER%", "#{WEBSERVER}")
+ file.puts line
+ end
+end