{"action":"created","comment":{"url":"https://api.github.com/repos/wagn/wagn/pulls/comments/82493582","pull_request_review_id":3400664,"id":82493582,"diff_hunk":"@@ -3,110 +3,148 @@ class Format\n     # View rendering methods.\n     #\n     module Render\n-      DEPRECATED_VIEWS = {\n-        view: :open, card: :open, line: :closed, bare: :core, naked: :core\n-      }.freeze\n+      CACHE_SETTING_NEST_LEVEL =\n+        { always: :full, nested: :off, never: :stub }.freeze\n+\n+      # API\n+      # `view cache: [:always, :nested, :never]\n+      # :always means a view is always cached when rendered\n+\n+      # :nested means a view is not cached independently,\n+      # but it can be cached within another view\n+      # :never means a view is never cached\n \n       def render view, args={}\n-        view = canonicalize_view view\n-        return if hidden_view? view, args\n-        view = ok_view view, args\n+        puts \"render #{card.name} :: #{view}\"\n+        View.new(self, view, args).render do |final_view, final_args|\n+          final_render final_view, final_args\n+        end\n+      rescue => e\n+        rescue_view e, view\n+      end\n+\n+      def final_render view, args\n         current_view(view) do\n-          args = default_render_args view, args\n           with_nest_mode view do\n-            Card::Cache::ViewCache.fetch(self, view, args) do\n-              method = view_method view, args\n-              method.arity.zero? ? method.call : method.call(args)\n-            end\n+            method = view_method view, args\n+            method.arity.zero? ? method.call : method.call(args)\n           end\n         end\n-      rescue => e\n-        rescue_view e, view\n       end\n \n-      def render_api match, opts\n-        view = match[3] ? match[4] : opts.shift\n-        args = opts[0] ? opts.shift.clone : {}\n-        optional_render_args(args, opts) if match[2]\n-        args[:skip_permissions] = true if match[1]\n-        render view, args\n+      def cache_render view, args, &block\n+        case (level = cache_level viewo)\n+        when :off  then yield viewo\n+        when :full then cached_result viewo, &block\n+        when :stub then stub_nest viewo\n+        else raise \"Invalid cache level #{level}\"\n+        end\n       end\n \n-      def optional_render_args args, opts\n-        args[:optional] = true\n-        args[:default_visibility] = opts.shift\n+      def stub_nest view, args","path":"card/lib/card/format/render.rb","position":64,"original_position":64,"commit_id":"e75974cc1bb06f8d933887ee80b6f79e45d04a21","original_commit_id":"e75974cc1bb06f8d933887ee80b6f79e45d04a21","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Unused method argument - view. If it's necessary, use _ or _view as an argument name to indicate that it won't be used. You can also write as stub_nest(*) if you want the method to accept any arguments but don't care about them.<br>Unused method argument - args. If it's necessary, use _ or _args as an argument name to indicate that it won't be used. You can also write as stub_nest(*) if you want the method to accept any arguments but don't care about them.","created_at":"2016-10-08T02:40:30Z","updated_at":"2016-10-08T02:40:30Z","html_url":"https://github.com/wagn/wagn/pull/694#discussion_r82493582","pull_request_url":"https://api.github.com/repos/wagn/wagn/pulls/694","_links":{"self":{"href":"https://api.github.com/repos/wagn/wagn/pulls/comments/82493582"},"html":{"href":"https://github.com/wagn/wagn/pull/694#discussion_r82493582"},"pull_request":{"href":"https://api.github.com/repos/wagn/wagn/pulls/694"}}},"pull_request":{"url":"https://api.github.com/repos/wagn/wagn/pulls/694","id":87408807,"html_url":"https://github.com/wagn/wagn/pull/694","diff_url":"https://github.com/wagn/wagn/pull/694.diff","patch_url":"https://github.com/wagn/wagn/pull/694.patch","issue_url":"https://api.github.com/repos/wagn/wagn/issues/694","number":694,"state":"open","locked":false,"title":"improved view caching","user":{"login":"ethn","id":21904,"avatar_url":"https://avatars.githubusercontent.com/u/21904?v=3","gravatar_id":"","url":"https://api.github.com/users/ethn","html_url":"https://github.com/ethn","followers_url":"https://api.github.com/users/ethn/followers","following_url":"https://api.github.com/users/ethn/following{/other_user}","gists_url":"https://api.github.com/users/ethn/gists{/gist_id}","starred_url":"https://api.github.com/users/ethn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethn/subscriptions","organizations_url":"https://api.github.com/users/ethn/orgs","repos_url":"https://api.github.com/users/ethn/repos","events_url":"https://api.github.com/users/ethn/events{/privacy}","received_events_url":"https://api.github.com/users/ethn/received_events","type":"User","site_admin":false},"body":"(not ready)","created_at":"2016-09-29T22:55:33Z","updated_at":"2016-10-08T02:40:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef9687e61e38b9b7a89c554a531d78b8e6ddc017","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wagn/wagn/pulls/694/commits","review_comments_url":"https://api.github.com/repos/wagn/wagn/pulls/694/comments","review_comment_url":"https://api.github.com/repos/wagn/wagn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wagn/wagn/issues/694/comments","statuses_url":"https://api.github.com/repos/wagn/wagn/statuses/e75974cc1bb06f8d933887ee80b6f79e45d04a21","head":{"label":"ethn:pagecache","ref":"pagecache","sha":"e75974cc1bb06f8d933887ee80b6f79e45d04a21","user":{"login":"ethn","id":21904,"avatar_url":"https://avatars.githubusercontent.com/u/21904?v=3","gravatar_id":"","url":"https://api.github.com/users/ethn","html_url":"https://github.com/ethn","followers_url":"https://api.github.com/users/ethn/followers","following_url":"https://api.github.com/users/ethn/following{/other_user}","gists_url":"https://api.github.com/users/ethn/gists{/gist_id}","starred_url":"https://api.github.com/users/ethn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethn/subscriptions","organizations_url":"https://api.github.com/users/ethn/orgs","repos_url":"https://api.github.com/users/ethn/repos","events_url":"https://api.github.com/users/ethn/events{/privacy}","received_events_url":"https://api.github.com/users/ethn/received_events","type":"User","site_admin":false},"repo":{"id":379894,"name":"wagn","full_name":"ethn/wagn","owner":{"login":"ethn","id":21904,"avatar_url":"https://avatars.githubusercontent.com/u/21904?v=3","gravatar_id":"","url":"https://api.github.com/users/ethn","html_url":"https://github.com/ethn","followers_url":"https://api.github.com/users/ethn/followers","following_url":"https://api.github.com/users/ethn/following{/other_user}","gists_url":"https://api.github.com/users/ethn/gists{/gist_id}","starred_url":"https://api.github.com/users/ethn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethn/subscriptions","organizations_url":"https://api.github.com/users/ethn/orgs","repos_url":"https://api.github.com/users/ethn/repos","events_url":"https://api.github.com/users/ethn/events{/privacy}","received_events_url":"https://api.github.com/users/ethn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ethn/wagn","description":"the wiki on wheels: a Ruby on Rails app for building dynamic, structured websites out of wiki cards","fork":true,"url":"https://api.github.com/repos/ethn/wagn","forks_url":"https://api.github.com/repos/ethn/wagn/forks","keys_url":"https://api.github.com/repos/ethn/wagn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethn/wagn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethn/wagn/teams","hooks_url":"https://api.github.com/repos/ethn/wagn/hooks","issue_events_url":"https://api.github.com/repos/ethn/wagn/issues/events{/number}","events_url":"https://api.github.com/repos/ethn/wagn/events","assignees_url":"https://api.github.com/repos/ethn/wagn/assignees{/user}","branches_url":"https://api.github.com/repos/ethn/wagn/branches{/branch}","tags_url":"https://api.github.com/repos/ethn/wagn/tags","blobs_url":"https://api.github.com/repos/ethn/wagn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethn/wagn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethn/wagn/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethn/wagn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethn/wagn/statuses/{sha}","languages_url":"https://api.github.com/repos/ethn/wagn/languages","stargazers_url":"https://api.github.com/repos/ethn/wagn/stargazers","contributors_url":"https://api.github.com/repos/ethn/wagn/contributors","subscribers_url":"https://api.github.com/repos/ethn/wagn/subscribers","subscription_url":"https://api.github.com/repos/ethn/wagn/subscription","commits_url":"https://api.github.com/repos/ethn/wagn/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethn/wagn/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethn/wagn/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethn/wagn/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethn/wagn/contents/{+path}","compare_url":"https://api.github.com/repos/ethn/wagn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethn/wagn/merges","archive_url":"https://api.github.com/repos/ethn/wagn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethn/wagn/downloads","issues_url":"https://api.github.com/repos/ethn/wagn/issues{/number}","pulls_url":"https://api.github.com/repos/ethn/wagn/pulls{/number}","milestones_url":"https://api.github.com/repos/ethn/wagn/milestones{/number}","notifications_url":"https://api.github.com/repos/ethn/wagn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethn/wagn/labels{/name}","releases_url":"https://api.github.com/repos/ethn/wagn/releases{/id}","deployments_url":"https://api.github.com/repos/ethn/wagn/deployments","created_at":"2009-11-20T19:39:26Z","updated_at":"2016-08-17T02:52:41Z","pushed_at":"2016-10-08T02:40:09Z","git_url":"git://github.com/ethn/wagn.git","ssh_url":"git@github.com:ethn/wagn.git","clone_url":"https://github.com/ethn/wagn.git","svn_url":"https://github.com/ethn/wagn","homepage":"http://www.wagn.org","size":67642,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"wagn:master","ref":"master","sha":"0138d248bcc4fbd10e64f42237628dea1bda3fa4","user":{"login":"wagn","id":20722,"avatar_url":"https://avatars.githubusercontent.com/u/20722?v=3","gravatar_id":"","url":"https://api.github.com/users/wagn","html_url":"https://github.com/wagn","followers_url":"https://api.github.com/users/wagn/followers","following_url":"https://api.github.com/users/wagn/following{/other_user}","gists_url":"https://api.github.com/users/wagn/gists{/gist_id}","starred_url":"https://api.github.com/users/wagn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wagn/subscriptions","organizations_url":"https://api.github.com/users/wagn/orgs","repos_url":"https://api.github.com/users/wagn/repos","events_url":"https://api.github.com/users/wagn/events{/privacy}","received_events_url":"https://api.github.com/users/wagn/received_events","type":"User","site_admin":false},"repo":{"id":44462,"name":"wagn","full_name":"wagn/wagn","owner":{"login":"wagn","id":20722,"avatar_url":"https://avatars.githubusercontent.com/u/20722?v=3","gravatar_id":"","url":"https://api.github.com/users/wagn","html_url":"https://github.com/wagn","followers_url":"https://api.github.com/users/wagn/followers","following_url":"https://api.github.com/users/wagn/following{/other_user}","gists_url":"https://api.github.com/users/wagn/gists{/gist_id}","starred_url":"https://api.github.com/users/wagn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wagn/subscriptions","organizations_url":"https://api.github.com/users/wagn/orgs","repos_url":"https://api.github.com/users/wagn/repos","events_url":"https://api.github.com/users/wagn/events{/privacy}","received_events_url":"https://api.github.com/users/wagn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wagn/wagn","description":"Ruby on rails wiki platform for collaborating to build custom web systems","fork":false,"url":"https://api.github.com/repos/wagn/wagn","forks_url":"https://api.github.com/repos/wagn/wagn/forks","keys_url":"https://api.github.com/repos/wagn/wagn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wagn/wagn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wagn/wagn/teams","hooks_url":"https://api.github.com/repos/wagn/wagn/hooks","issue_events_url":"https://api.github.com/repos/wagn/wagn/issues/events{/number}","events_url":"https://api.github.com/repos/wagn/wagn/events","assignees_url":"https://api.github.com/repos/wagn/wagn/assignees{/user}","branches_url":"https://api.github.com/repos/wagn/wagn/branches{/branch}","tags_url":"https://api.github.com/repos/wagn/wagn/tags","blobs_url":"https://api.github.com/repos/wagn/wagn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wagn/wagn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wagn/wagn/git/refs{/sha}","trees_url":"https://api.github.com/repos/wagn/wagn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wagn/wagn/statuses/{sha}","languages_url":"https://api.github.com/repos/wagn/wagn/languages","stargazers_url":"https://api.github.com/repos/wagn/wagn/stargazers","contributors_url":"https://api.github.com/repos/wagn/wagn/contributors","subscribers_url":"https://api.github.com/repos/wagn/wagn/subscribers","subscription_url":"https://api.github.com/repos/wagn/wagn/subscription","commits_url":"https://api.github.com/repos/wagn/wagn/commits{/sha}","git_commits_url":"https://api.github.com/repos/wagn/wagn/git/commits{/sha}","comments_url":"https://api.github.com/repos/wagn/wagn/comments{/number}","issue_comment_url":"https://api.github.com/repos/wagn/wagn/issues/comments{/number}","contents_url":"https://api.github.com/repos/wagn/wagn/contents/{+path}","compare_url":"https://api.github.com/repos/wagn/wagn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wagn/wagn/merges","archive_url":"https://api.github.com/repos/wagn/wagn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wagn/wagn/downloads","issues_url":"https://api.github.com/repos/wagn/wagn/issues{/number}","pulls_url":"https://api.github.com/repos/wagn/wagn/pulls{/number}","milestones_url":"https://api.github.com/repos/wagn/wagn/milestones{/number}","notifications_url":"https://api.github.com/repos/wagn/wagn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wagn/wagn/labels{/name}","releases_url":"https://api.github.com/repos/wagn/wagn/releases{/id}","deployments_url":"https://api.github.com/repos/wagn/wagn/deployments","created_at":"2008-08-21T00:36:11Z","updated_at":"2016-09-22T18:46:10Z","pushed_at":"2016-10-08T02:40:09Z","git_url":"git://github.com/wagn/wagn.git","ssh_url":"git@github.com:wagn/wagn.git","clone_url":"https://github.com/wagn/wagn.git","svn_url":"https://github.com/wagn/wagn","homepage":"http://www.wagn.org","size":70886,"stargazers_count":272,"watchers_count":272,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":58,"mirror_url":null,"open_issues_count":6,"forks":58,"open_issues":6,"watchers":272,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wagn/wagn/pulls/694"},"html":{"href":"https://github.com/wagn/wagn/pull/694"},"issue":{"href":"https://api.github.com/repos/wagn/wagn/issues/694"},"comments":{"href":"https://api.github.com/repos/wagn/wagn/issues/694/comments"},"review_comments":{"href":"https://api.github.com/repos/wagn/wagn/pulls/694/comments"},"review_comment":{"href":"https://api.github.com/repos/wagn/wagn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wagn/wagn/pulls/694/commits"},"statuses":{"href":"https://api.github.com/repos/wagn/wagn/statuses/e75974cc1bb06f8d933887ee80b6f79e45d04a21"}}}}
{"actor":{"display_login":"houndci-bot"}}