From 7bf106ede67dad480f05a3899c29d8703b028a4c Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Fri, 21 Jun 2013 16:58:02 +0200 Subject: [PATCH] [UTIL] Fixed whitespace in Ruby template for code generator --- rest-api-spec/utils/thor/templates/ruby/method.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rest-api-spec/utils/thor/templates/ruby/method.erb b/rest-api-spec/utils/thor/templates/ruby/method.erb index 7f523592677..7f13d2fcb2c 100644 --- a/rest-api-spec/utils/thor/templates/ruby/method.erb +++ b/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? -%>