{"action":"created","issue":{"url":"https://api.github.com/repos/capistrano/capistrano/issues/1724","repository_url":"https://api.github.com/repos/capistrano/capistrano","labels_url":"https://api.github.com/repos/capistrano/capistrano/issues/1724/labels{/name}","comments_url":"https://api.github.com/repos/capistrano/capistrano/issues/1724/comments","events_url":"https://api.github.com/repos/capistrano/capistrano/issues/1724/events","html_url":"https://github.com/capistrano/capistrano/pull/1724","id":165539054,"number":1724,"title":"Print a warning if a task is skipped because of re-invocation.","user":{"login":"troelskn","id":37910,"avatar_url":"https://avatars.githubusercontent.com/u/37910?v=3","gravatar_id":"","url":"https://api.github.com/users/troelskn","html_url":"https://github.com/troelskn","followers_url":"https://api.github.com/users/troelskn/followers","following_url":"https://api.github.com/users/troelskn/following{/other_user}","gists_url":"https://api.github.com/users/troelskn/gists{/gist_id}","starred_url":"https://api.github.com/users/troelskn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troelskn/subscriptions","organizations_url":"https://api.github.com/users/troelskn/orgs","repos_url":"https://api.github.com/users/troelskn/repos","events_url":"https://api.github.com/users/troelskn/events{/privacy}","received_events_url":"https://api.github.com/users/troelskn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2016-07-14T11:26:05Z","updated_at":"2016-07-18T09:44:14Z","closed_at":"2016-07-15T21:42:34Z","pull_request":{"url":"https://api.github.com/repos/capistrano/capistrano/pulls/1724","html_url":"https://github.com/capistrano/capistrano/pull/1724","diff_url":"https://github.com/capistrano/capistrano/pull/1724.diff","patch_url":"https://github.com/capistrano/capistrano/pull/1724.patch"},"body":"Resolves #1689"},"comment":{"url":"https://api.github.com/repos/capistrano/capistrano/issues/comments/233286487","html_url":"https://github.com/capistrano/capistrano/pull/1724#issuecomment-233286487","issue_url":"https://api.github.com/repos/capistrano/capistrano/issues/1724","id":233286487,"user":{"login":"troelskn","id":37910,"avatar_url":"https://avatars.githubusercontent.com/u/37910?v=3","gravatar_id":"","url":"https://api.github.com/users/troelskn","html_url":"https://github.com/troelskn","followers_url":"https://api.github.com/users/troelskn/followers","following_url":"https://api.github.com/users/troelskn/following{/other_user}","gists_url":"https://api.github.com/users/troelskn/gists{/gist_id}","starred_url":"https://api.github.com/users/troelskn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troelskn/subscriptions","organizations_url":"https://api.github.com/users/troelskn/orgs","repos_url":"https://api.github.com/users/troelskn/repos","events_url":"https://api.github.com/users/troelskn/events{/privacy}","received_events_url":"https://api.github.com/users/troelskn/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T09:44:14Z","updated_at":"2016-07-18T09:44:14Z","body":"How about something like this:\r\n\r\n```\r\nrequire \"rake/task\"\r\nmodule Rake\r\n  class Task\r\n    def reinvokable!\r\n      @reinvokable = true\r\n    end\r\n\r\n    alias original_invoke_with_call_chain invoke_with_call_chain # :nodoc:\r\n    def invoke_with_call_chain(task_args, invocation_chain) # :nodoc:\r\n      original_invoke_with_call_chain(task_args, invocation_chain)\r\n    ensure\r\n      if @reinvokable\r\n        @already_invoked = false\r\n      end\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nUsage:\r\n\r\n```\r\ndesc \"A good task\"\r\ntask :good do\r\n  puts \"yah\"\r\nend.reinvokable!\r\n\r\ndesc \"calling twice\"\r\ntask :twice do\r\n  invoke \"good\"\r\n  invoke \"good\"\r\nend\r\n```\r\n\r\nAnd coupled with a warning from `Capistrano::DSL#invoke` if a non-reinvokable is invoked twice."}}
{"actor":{"display_login":"troelskn"}}