Ver Fonte

[UTIL] Fixed whitespace in Ruby template for code generator

Karel Minarik há 12 anos atrás
pai
commit
7bf106ede6
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      rest-api-spec/utils/thor/templates/ruby/method.erb

+ 3 - 1
rest-api-spec/utils/thor/templates/ruby/method.erb

@@ -31,7 +31,9 @@ module Elasticsearch
       <%- @spec['url']['parts'].select { |name, info| info['required'] }.each do |name, info| -%>
       <%= '  '*(@namespace_depth+1) + "raise ArgumentError, \"Required argument '#{name}' missing\" unless arguments[:#{name}]" + "\n" -%>
       <%- end -%>
-      <%= '  '*(@namespace_depth+1) + "raise ArgumentError, \"Required argument 'body' missing\" unless arguments[:body]" + "\n" if @spec['body'] && @spec['body']['required'] -%>
+<%- if @spec['body'] && @spec['body']['required'] -%>
+      <%= '  '*(@namespace_depth+1) + "raise ArgumentError, \"Required argument 'body' missing\" unless arguments[:body]" + "\n" -%>
+<%- end -%>
 <%# Method, path, params, body  -%>
       <%= '  '*@namespace_depth %>  method = '<%= @spec['methods'].first %>'
       <%- unless @spec['url']['parts'].empty?  -%>