ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: samuel@oriontransfer.net
To: ruby-core@ruby-lang.org
Subject: [ruby-core:96773] [Ruby master Bug#16500] Argument added both to splat and last &block argument
Date: Sat, 11 Jan 2020 01:28:09 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-83767.20200111012809.dbe24c170e4d49d2@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-16500.20200111000000@ruby-lang.org

Issue #16500 has been updated by ioquatix (Samuel Williams).

Assignee set to ioquatix (Samuel Williams)
Status changed from Open to Rejected

https://github.com/ruby-grape/grape/issues/1967

----------------------------------------
Bug #16500: Argument added both to splat and last &block argument
https://bugs.ruby-lang.org/issues/16500#change-83767

* Author: anatolik (Anatol Pomozov)
* Status: Rejected
* Priority: Normal
* Assignee: ioquatix (Samuel Williams)
* Target version: 
* ruby -v: 2.7.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Here is a followup for a ruby2.7 issue discussed here https://gitlab.com/groups/gitlab-org/-/epics/2380

I run gitlab with ruby2.7. Things work mostly fine except one weird issue. gitlab/lib/api/api_guard.rb calls Rack's `use` method:


```ruby
  use Rack::OAuth2::Server::Resource::Bearer, 'The API' do |request|
    # The authenticator only fetches the raw token string

    # Must yield access token to store it in the env
    request.access_token
  end

```

The `use` method looks like
```ruby
    def use(middleware, *args, &block)
      if @map
        mapping, @map = @map, nil
        @use << proc { |app| generate_map app, mapping }
      end
      @use << proc { |app| middleware.new(app, *args, &block) }
    end
```

For some reason `Proc` method set to `&block` *and* added to `args`. It sounds wrong. `Proc` should be set to `&block` only and `args` should contain only 1 argument.



-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2020-01-11  1:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-16500.20200111000000@ruby-lang.org>
2020-01-11  0:00 ` [ruby-core:96769] [Ruby master Bug#16500] Argument added both to splat and last &block argument anatol.pomozov
2020-01-11  0:31 ` [ruby-core:96770] " mame
2020-01-11  0:52 ` [ruby-core:96771] " samuel
2020-01-11  1:21 ` [ruby-core:96772] " samuel
2020-01-11  1:28 ` samuel [this message]
2020-01-11 23:45 ` [ruby-core:96795] " samuel
2020-01-11 23:59 ` [ruby-core:96796] " merch-redmine
2020-01-12  0:12 ` [ruby-core:96797] " mame
2020-01-12 16:38 ` [ruby-core:96807] [Ruby master Bug#16500] Argument is added to both " eregontp
2020-01-12 16:45 ` [ruby-core:96808] " eregontp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-83767.20200111012809.dbe24c170e4d49d2@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).