From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 273CC19E002D for ; Sat, 19 Dec 2015 15:55:16 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id F1AE4B5D828 for ; Sat, 19 Dec 2015 16:27:25 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 4DFCB18CC7E4 for ; Sat, 19 Dec 2015 16:27:26 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 67B641204AC; Sat, 19 Dec 2015 16:27:24 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 409EC12048A for ; Sat, 19 Dec 2015 16:27:21 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=D9oeeZoTSDahM/B/kfbgFusf1vo=; b=n393H7G+fRCH3jNgnX PJgiEMUaJCfrzHwTNyi1Nly4iI3wnOcrQ/ZAMQLE8SxZ8cNoL3VRm+H016OCaZI3 yGdRvDoXSIr/zhsBW2Aa0YAvUxjX8LLU+PGSTyvXhOynAPUpTNbyLpRqqvfnj5RW iRq9PYd44POTojGS//LTstgxk= Received: by filter0824p1mdw1.sendgrid.net with SMTP id filter0824p1mdw1.20540.567506D36 2015-12-19 07:27:15.100027632 +0000 UTC Received: from herokuapp.com (ec2-184-73-7-252.compute-1.amazonaws.com [184.73.7.252]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id gBAiFx5CSrG3M1JhQNY1rg for ; Sat, 19 Dec 2015 07:27:14.964 +0000 (UTC) Date: Sat, 19 Dec 2015 07:27:14 +0000 From: takashikkbn@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 46969 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11842 X-Redmine-Issue-Author: yui-knk X-Redmine-Sender: k0kubun X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS4QGjx6JfYg88eUjnNl+tn3WLK5v+l1Ipz2+E Rcgmr7qkEJDZmu6hu3tL4DT5U7BMBTlbgGkT3ueXwdsK6f7JkH+RrwhILIWfYzlDl6+6ISdxd2YADF qV22+IF82+eeBH//glHXFMvT/YG/PziJLaTAi31SEFM86rNvHtnEZgy92g== X-ML-Name: ruby-core X-Mail-Count: 72375 Subject: [ruby-core:72375] [Ruby trunk - Bug #11842] r53123 breaks some gems which use erb X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11842 has been updated by Takashi Kokubun. While this case is fixable by https://github.com/erikhuda/thor/pull/512, there may be some gems depending on the eoutvar's behavior. If "Pass the name of the variable to be used inside a String" is specification, r53123 should be breaking change and I have no objection to revert the patch. ---------------------------------------- Bug #11842: r53123 breaks some gems which use erb https://bugs.ruby-lang.org/issues/11842#change-55665 * Author: Kaneko Yuichiro * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.3.0dev (trunk 53153) [x86_64-darwin14] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- r53123 breaks some gems which use erb. Thor gem for example. They set an instance variable `"@output_buffer"` to 4th argument (`eoutvar`) of `ERB.new` ([here](https://github.com/erikhuda/thor/blob/f0c2166534e122636f5ce04d61885736ef605617/lib/thor/actions/file_manipulation.rb#L116)). And change this instance variable from outside erb ([here](https://github.com/erikhuda/thor/blob/f0c2166534e122636f5ce04d61885736ef605617/lib/thor/actions/file_manipulation.rb#L308)). [Example code of erb](https://github.com/ruby/ruby/blob/ec7a964dca57821d2d7a36f168c2355a46a76ca2/lib/erb.rb#L751) shows this usage of `eoutvar`. I think we should revert r53123 and add a test case for this usage. ``` Failures: 1) Thor::Actions#template allows using block helpers in the template Failure/Error: concat(result.strip + " world!") NoMethodError: undefined method `strip' for ["Hello\n"]:Array # ./spec/fixtures/group.thor:58:in `world' # (erb):1:in `template' # ./lib/thor/actions/file_manipulation.rb:116:in `block in template' # ./lib/thor/actions/create_file.rb:53:in `render' # ./lib/thor/actions/create_file.rb:62:in `block (2 levels) in invoke!' # ./lib/thor/actions/create_file.rb:62:in `open' # ./lib/thor/actions/create_file.rb:62:in `block in invoke!' # ./lib/thor/actions/empty_directory.rb:116:in `invoke_with_conflict_check' # ./lib/thor/actions/create_file.rb:60:in `invoke!' # ./lib/thor/actions.rb:94:in `action' # ./lib/thor/actions/create_file.rb:25:in `create_file' # ./lib/thor/actions/file_manipulation.rb:115:in `template' # ./spec/actions/file_manipulation_spec.rb:11:in `block in action' # ./spec/helper.rb:55:in `capture' # ./spec/actions/file_manipulation_spec.rb:11:in `action' # ./spec/actions/file_manipulation_spec.rb:160:in `block (3 levels) in ' ``` -- https://bugs.ruby-lang.org/