Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syntax "each" for ruby1.9 => each_line #113

Closed
wants to merge 9 commits into from
Closed
6 changes: 3 additions & 3 deletions templates/vhost/vhost_footer.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<% if @include_files %><% @include_files.each do |file| -%>
<% if @include_files %><% @include_files.each_line do |file| -%>
include <%= file %>;
<% end -%><% end -%>
<% if @vhost_cfg_append -%><% vhost_cfg_append.each do |key,value| -%>
<% if @vhost_cfg_append -%><% vhost_cfg_append.each_line do |key,value| -%>
<%= key %> <%= value %>;
<% end -%>
<% end -%>
}
<% if @rewrite_www_to_non_www -%>
server {
listen <%= @listen_ip %>;
listen <%= @listen_ip %>:<%= @listen_port %>;
server_name www.<%= @name.gsub(/^www\./, '') %>;
rewrite ^ http://<%= @name.gsub(/^www\./, '') %>$uri permanent;
}
Expand Down
2 changes: 1 addition & 1 deletion templates/vhost/vhost_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ server {
<% if defined? auth_basic_user_file -%>
auth_basic_user_file <%= @auth_basic_user_file %>;
<% end -%>
<% @proxy_set_header.each do |header| -%>
<% @proxy_set_header.each_line do |header| -%>
proxy_set_header <%= header %>;
<% end -%>
<% if @rewrite_to_https -%>
Expand Down
4 changes: 2 additions & 2 deletions templates/vhost/vhost_location_alias.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
location <%= @location %> {
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;<% end -%><% end -%>
alias <%= @location_alias %>;
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;<% end -%><% end -%>
}

8 changes: 4 additions & 4 deletions templates/vhost/vhost_location_directory.erb
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
location <%= @location %> {
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;
<% end -%><% end -%>
<% if defined? @www_root -%>
root <%= @www_root %>;
<% end -%>
<% if @try_files -%>
try_files <% @try_files.each do |try| -%> <%= try %> <% end -%>;
try_files <% @try_files.each_line do |try| -%> <%= try %> <% end -%>;
<% end -%>
<% if @index_files -%>
index <% @index_files.each do |i| %> <%= i %><% end %>;
index <% @index_files.each_line do |i| %> <%= i %><% end %>;
<% end -%>
<% if defined? auth_basic -%>
auth_basic "<%= @auth_basic %>";
<% end -%>
<% if defined? auth_basic_user_file -%>
auth_basic_user_file <%= @auth_basic_user_file %>;
<% end -%>
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;
<% end -%><% end -%>
}
Expand Down
2 changes: 1 addition & 1 deletion templates/vhost/vhost_location_empty.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
location <%= @location %> {
<% if @location_custom_cfg -%><% @location_custom_cfg.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_custom_cfg -%><% @location_custom_cfg.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;
<% end -%><% end -%>
}
Expand Down
6 changes: 3 additions & 3 deletions templates/vhost/vhost_location_fastcgi.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
location <%= @location %> {
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;
<% end -%><% end -%>
<% if defined? @www_root -%>
Expand All @@ -9,14 +9,14 @@
fastcgi_split_path_info <%= @fastcgi_split_path %>;
<% end -%>
<% if @try_files -%>
try_files <% @try_files.each do |try| -%> <%= try %> <% end -%>;
try_files <% @try_files.each_line do |try| -%> <%= try %> <% end -%>;
<% end -%>
include <%= @fastcgi_params %>;
fastcgi_pass <%= @fastcgi %>;
<% if defined? @fastcgi_script %>
fastcgi_param SCRIPT_FILENAME <%= @fastcgi_script %>;
<% end -%>
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;
<% end -%><% end -%>
}
Expand Down
4 changes: 2 additions & 2 deletions templates/vhost/vhost_location_proxy.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
location <%= @location %> {
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;
<% end -%><% end -%>
<% if @proxy_cache -%>
Expand All @@ -8,7 +8,7 @@
<% end -%>
proxy_pass <%= @proxy %>;
proxy_read_timeout <%= @proxy_read_timeout %>;
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;
<% end -%><% end -%>
}
Expand Down
4 changes: 2 additions & 2 deletions templates/vhost/vhost_location_stub_status.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
location <%= @location %> {
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;<% end -%><% end -%>
stub_status on;
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each_line do |key,value| -%>
<%= key %> <%= value %>;<% end -%><% end -%>
}