Handle server_url being commented out in the example configuration
authorTom Hughes <tom@compton.nu>
Wed, 22 Mar 2017 17:17:47 +0000 (17:17 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 22 Mar 2017 17:17:47 +0000 (17:17 +0000)
cookbooks/web/definitions/rails_port.rb

index bbc3d60..8f27744 100644 (file)
@@ -109,7 +109,7 @@ define :rails_port, :action => [:create, :enable] do
   end
 
   application_yml = edit_file "#{rails_directory}/config/example.application.yml" do |line|
-    line.gsub!(/^( *)server_url:.*$/, "\\1server_url: \"#{name}\"")
+    line.gsub!(/^( *)#?server_url:.*$/, "\\1server_url: \"#{name}\"")
 
     if params[:email_from]
       line.gsub!(/^( *)email_from:.*$/, "\\1email_from: \"#{params[:email_from]}\"")