{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/2338","repository_url":"https://api.github.com/repos/bbatsov/rubocop","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2338/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2338/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2338/events","html_url":"https://github.com/bbatsov/rubocop/issues/2338","id":112773084,"number":2338,"title":"How to avoid Multiline block chains? What is the recommended style?","user":{"login":"wazery","id":470401,"avatar_url":"https://avatars.githubusercontent.com/u/470401?v=3","gravatar_id":"","url":"https://api.github.com/users/wazery","html_url":"https://github.com/wazery","followers_url":"https://api.github.com/users/wazery/followers","following_url":"https://api.github.com/users/wazery/following{/other_user}","gists_url":"https://api.github.com/users/wazery/gists{/gist_id}","starred_url":"https://api.github.com/users/wazery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wazery/subscriptions","organizations_url":"https://api.github.com/users/wazery/orgs","repos_url":"https://api.github.com/users/wazery/repos","events_url":"https://api.github.com/users/wazery/events{/privacy}","received_events_url":"https://api.github.com/users/wazery/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-22T10:22:59Z","updated_at":"2016-06-07T13:49:20Z","closed_at":"2015-12-25T10:36:18Z","body":"I have the following code\r\n\r\n```ruby\r\n    EM.run do\r\n      Pusher.get_async('/channels/' + pusher_channel).callback do |response|\r\n        handle_response(response)\r\n      end.errback do |error|\r\n        handle_error(error)\r\n      end\r\n    end\r\n```\r\n\r\nFor now I disable it with `# rubocop:disable Style/MultilineBlockChain` which I need to resolve.\r\n\r\nAs you can see, the block chaining is necessary for me since I need to handle the `errback`.\r\n\r\nSo what is the recommended style for this, I see that the Ruby style guide recommends avoiding using multiline block chains, but with not proposing any other option for it!"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/224285968","html_url":"https://github.com/bbatsov/rubocop/issues/2338#issuecomment-224285968","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2338","id":224285968,"user":{"login":"esad","id":11807,"avatar_url":"https://avatars.githubusercontent.com/u/11807?v=3","gravatar_id":"","url":"https://api.github.com/users/esad","html_url":"https://github.com/esad","followers_url":"https://api.github.com/users/esad/followers","following_url":"https://api.github.com/users/esad/following{/other_user}","gists_url":"https://api.github.com/users/esad/gists{/gist_id}","starred_url":"https://api.github.com/users/esad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esad/subscriptions","organizations_url":"https://api.github.com/users/esad/orgs","repos_url":"https://api.github.com/users/esad/repos","events_url":"https://api.github.com/users/esad/events{/privacy}","received_events_url":"https://api.github.com/users/esad/received_events","type":"User","site_admin":false},"created_at":"2016-06-07T13:49:20Z","updated_at":"2016-06-07T13:49:20Z","body":"@alexdowad A tool such as Rubocop should be more than an arbitrary set of style choice and should aim to codify good pratices. In this sense, I think that every check should have a documented rationale why it exists and why the style it warns is considered bad."}}
{"actor":{"display_login":"esad"}}