From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: yahns-public@yhbt.net Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id BBA5A1F45F; Thu, 20 Nov 2014 20:45:52 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Cc: e@80x24.org Subject: [PATCH 3/6] config: use literal symbol array for now Date: Thu, 20 Nov 2014 20:45:39 +0000 Message-Id: <1416516342-18987-4-git-send-email-e@80x24.org> X-Mailer: git-send-email 2.2.0.rc0.dirty In-Reply-To: <1416516342-18987-1-git-send-email-e@80x24.org> References: <1416516342-18987-1-git-send-email-e@80x24.org> List-Id: Until we drop 1.9.3 support, we'll save some bytecode by using [ :literal, :symbols, :in, :arrays ] In 2.0.0 and later, we may use %i(terser syntax) --- lib/yahns/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb index 3055539..f354961 100644 --- a/lib/yahns/config.rb +++ b/lib/yahns/config.rb @@ -402,7 +402,7 @@ class Yahns::Config # :nodoc: val.close_on_exec = val.sync = true val.binmode else - rt = %w(puts write flush).map(&:to_sym) # match Rack::Lint + rt = [ :puts, :write, :flush ] # match Rack::Lint rt.all? { |m| val.respond_to?(m) } or raise ArgumentError, "`#{var}' destination must respond to all of: #{rt.inspect}" end -- EW