Kouhei Sutou
kou****@clear*****
Fri Oct 31 13:56:33 JST 2014
コマンドバージョンが1でも「,」区切りを受け付けるので常に「,」 区切りで大丈夫です! In <e98686c31fc0b95c52106b68de1eadcbf32d2edb �� jenkins.clear-code.com> "[Groonga-commit] droonga/droonga-engine �� e98686c [master] Groonga: select: Accept whitespace-separeted output_columns (command_version=1)" on Fri, 31 Oct 2014 13:50:02 +0900, YUKI Hiroshi <null+groonga �� clear-code.com> wrote: > YUKI Hiroshi 2014-10-31 13:50:02 +0900 (Fri, 31 Oct 2014) > > New Revision: e98686c31fc0b95c52106b68de1eadcbf32d2edb > https://github.com/droonga/droonga-engine/commit/e98686c31fc0b95c52106b68de1eadcbf32d2edb > > Message: > Groonga: select: Accept whitespace-separeted output_columns (command_version=1) > > Modified files: > lib/droonga/plugins/groonga/select.rb > > Modified: lib/droonga/plugins/groonga/select.rb (+9 -1) > =================================================================== > --- lib/droonga/plugins/groonga/select.rb 2014-10-31 13:44:45 +0900 (9cb2898) > +++ lib/droonga/plugins/groonga/select.rb 2014-10-31 13:50:02 +0900 (6ea2215) > @@ -166,8 +166,16 @@ module Droonga > queries > end > > + COMMAND_VERSION_1_OUTPUT_COLUMNS_PATTERN = /\A[^\s,]+(\s+[^\s,]+)+\z/ > + > def convert_output_columns(output_columns) > - output_columns.split(/\s*,\s*/) > + output_columns = output_columns.strip > + command_version_is_1 = output_columns =~ COMMAND_VERSION_1_OUTPUT_COLUMNS_PATTERN > + if command_version_is_1 > + output_columns.split(/\s+/) > + else > + output_columns.split(/\s*,\s*/) > + end > end > end >