GitHub PullRequestReviewCommentEvent at 2014-12-13 06:24:11
Repository: paperclip
Actor: houndci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/comments/21786357","id":21786357,"diff_hunk":"@@ -507,33 +507,55 @@ def post_process(*style_args) #:nodoc:\n     end\n \n     def post_process_styles(*style_args) #:nodoc:\n-      post_process_style(:original, styles[:original]) if styles.include?(:original) && process_style?(:original, style_args)\n-      styles.reject{ |name, style| name == :original }.each do |name, style|\n-        post_process_style(name, style) if process_style?(name, style_args)\n+      styles_to_process = styles.select { |name, style| process_style?(name, style_args) }\n+\n+      if (original = styles_to_process.delete(:original))\n+        post_process_style(:original, original)\n+      end\n+\n+      if (generator = options[:generator])\n+        generate_styles(generator, styles_to_process)\n+      end\n+\n+      styles_to_process.each do |name, style|\n+        post_process_style(name, style)\n       end\n     end\n \n     def post_process_style(name, style) #:nodoc:\n-      begin\n-        raise RuntimeError.new(\"Style #{name} has no processors defined.\") if style.processors.blank?\n-        intermediate_files = []\n-\n-        @queued_for_write[name] = style.processors.inject(@queued_for_write[:original]) do |file, processor|\n-          file = Paperclip.processor(processor).make(file, style.processor_options, self)\n-          intermediate_files << file\n-          file\n-        end\n+      options[:generator] || !style.processors.blank? or\n+        raise RuntimeError.new(\"Style #{name} has no processors defined.\")\n+      source = @queued_for_write[name] || @queued_for_write[:original]\n+      intermediate_files = []\n+\n+      @queued_for_write[name] = style.processors.inject(source) do |file, processor|\n+        file = Paperclip.processor(processor).make(file, style.processor_options, self)\n+        intermediate_files << file\n+        file\n+      end\n \n-        unadapted_file = @queued_for_write[name]\n-        @queued_for_write[name] = Paperclip.io_adapters.for(@queued_for_write[name])\n-        unadapted_file.close if unadapted_file.respond_to?(:close)\n-        @queued_for_write[name]\n-      rescue Paperclip::Error => e\n-        log(\"An error was received while processing: #{e.inspect}\")\n-        (@errors[:processing] ||= []) << e.message if @options[:whiny]\n-      ensure\n-        unlink_files(intermediate_files)\n+      unadapted_file = @queued_for_write[name]\n+      @queued_for_write[name] = Paperclip.io_adapters.for(@queued_for_write[name])\n+      unadapted_file.close if unadapted_file.respond_to?(:close)\n+      @queued_for_write[name]\n+    rescue Paperclip::Error => e\n+      log(\"An error was received while processing: #{e.inspect}\")\n+      (@errors[:processing] ||= []) << e.message if @options[:whiny]\n+    ensure\n+      unlink_files(intermediate_files)\n+    end\n+\n+    def generate_styles(generator, styles)\n+      style_options = {}\n+      styles.select{|name| name != :original}.each do |name, style|\n+        style_options[name] = style.processor_options\n       end\n+      generator = Paperclip.processor(generator)\n+      results = generator.make(@queued_for_write[:original], style_options, self)","path":"lib/paperclip/attachment.rb","position":69,"original_position":69,"commit_id":"f153955b1b60f045e03731f74fdad7e10ad7a075","original_commit_id":"f153955b1b60f045e03731f74fdad7e10ad7a075","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [81/80]","created_at":"2014-12-13T06:24:11Z","updated_at":"2014-12-13T06:24:11Z","html_url":"https://github.com/thoughtbot/paperclip/pull/1728#discussion_r21786357","pull_request_url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1728","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/comments/21786357"},"html":{"href":"https://github.com/thoughtbot/paperclip/pull/1728#discussion_r21786357"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1728"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1728","id":26017952,"html_url":"https://github.com/thoughtbot/paperclip/pull/1728","diff_url":"https://github.com/thoughtbot/paperclip/pull/1728.diff","patch_url":"https://github.com/thoughtbot/paperclip/pull/1728.patch","issue_url":"https://api.github.com/repos/thoughtbot/paperclip/issues/1728","number":1728,"state":"open","locked":false,"title":"Again generating multiple styles","user":{"login":"soramugi","id":1216011,"avatar_url":"https://avatars.githubusercontent.com/u/1216011?v=3","gravatar_id":"","url":"https://api.github.com/users/soramugi","html_url":"https://github.com/soramugi","followers_url":"https://api.github.com/users/soramugi/followers","following_url":"https://api.github.com/users/soramugi/following{/other_user}","gists_url":"https://api.github.com/users/soramugi/gists{/gist_id}","starred_url":"https://api.github.com/users/soramugi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soramugi/subscriptions","organizations_url":"https://api.github.com/users/soramugi/orgs","repos_url":"https://api.github.com/users/soramugi/repos","events_url":"https://api.github.com/users/soramugi/events{/privacy}","received_events_url":"https://api.github.com/users/soramugi/received_events","type":"User","site_admin":false},"body":"This pull request https://github.com/thoughtbot/paperclip/pull/1360\r\nI tried to fix because it seems there is no change","created_at":"2014-12-13T06:24:01Z","updated_at":"2014-12-13T06:24:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbd9cee5a39a80bf932f838394f9ae89d090ec0c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1728/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1728/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/comments/{number}","comments_url":"https://api.github.com/repos/thoughtbot/paperclip/issues/1728/comments","statuses_url":"https://api.github.com/repos/thoughtbot/paperclip/statuses/f153955b1b60f045e03731f74fdad7e10ad7a075","head":{"label":"soramugi:generators_upstream","ref":"generators_upstream","sha":"f153955b1b60f045e03731f74fdad7e10ad7a075","user":{"login":"soramugi","id":1216011,"avatar_url":"https://avatars.githubusercontent.com/u/1216011?v=3","gravatar_id":"","url":"https://api.github.com/users/soramugi","html_url":"https://github.com/soramugi","followers_url":"https://api.github.com/users/soramugi/followers","following_url":"https://api.github.com/users/soramugi/following{/other_user}","gists_url":"https://api.github.com/users/soramugi/gists{/gist_id}","starred_url":"https://api.github.com/users/soramugi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soramugi/subscriptions","organizations_url":"https://api.github.com/users/soramugi/orgs","repos_url":"https://api.github.com/users/soramugi/repos","events_url":"https://api.github.com/users/soramugi/events{/privacy}","received_events_url":"https://api.github.com/users/soramugi/received_events","type":"User","site_admin":false},"repo":{"id":26632501,"name":"paperclip","full_name":"soramugi/paperclip","owner":{"login":"soramugi","id":1216011,"avatar_url":"https://avatars.githubusercontent.com/u/1216011?v=3","gravatar_id":"","url":"https://api.github.com/users/soramugi","html_url":"https://github.com/soramugi","followers_url":"https://api.github.com/users/soramugi/followers","following_url":"https://api.github.com/users/soramugi/following{/other_user}","gists_url":"https://api.github.com/users/soramugi/gists{/gist_id}","starred_url":"https://api.github.com/users/soramugi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soramugi/subscriptions","organizations_url":"https://api.github.com/users/soramugi/orgs","repos_url":"https://api.github.com/users/soramugi/repos","events_url":"https://api.github.com/users/soramugi/events{/privacy}","received_events_url":"https://api.github.com/users/soramugi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/soramugi/paperclip","description":"Easy file attachment management for ActiveRecord","fork":true,"url":"https://api.github.com/repos/soramugi/paperclip","forks_url":"https://api.github.com/repos/soramugi/paperclip/forks","keys_url":"https://api.github.com/repos/soramugi/paperclip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/soramugi/paperclip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/soramugi/paperclip/teams","hooks_url":"https://api.github.com/repos/soramugi/paperclip/hooks","issue_events_url":"https://api.github.com/repos/soramugi/paperclip/issues/events{/number}","events_url":"https://api.github.com/repos/soramugi/paperclip/events","assignees_url":"https://api.github.com/repos/soramugi/paperclip/assignees{/user}","branches_url":"https://api.github.com/repos/soramugi/paperclip/branches{/branch}","tags_url":"https://api.github.com/repos/soramugi/paperclip/tags","blobs_url":"https://api.github.com/repos/soramugi/paperclip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/soramugi/paperclip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/soramugi/paperclip/git/refs{/sha}","trees_url":"https://api.github.com/repos/soramugi/paperclip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/soramugi/paperclip/statuses/{sha}","languages_url":"https://api.github.com/repos/soramugi/paperclip/languages","stargazers_url":"https://api.github.com/repos/soramugi/paperclip/stargazers","contributors_url":"https://api.github.com/repos/soramugi/paperclip/contributors","subscribers_url":"https://api.github.com/repos/soramugi/paperclip/subscribers","subscription_url":"https://api.github.com/repos/soramugi/paperclip/subscription","commits_url":"https://api.github.com/repos/soramugi/paperclip/commits{/sha}","git_commits_url":"https://api.github.com/repos/soramugi/paperclip/git/commits{/sha}","comments_url":"https://api.github.com/repos/soramugi/paperclip/comments{/number}","issue_comment_url":"https://api.github.com/repos/soramugi/paperclip/issues/comments/{number}","contents_url":"https://api.github.com/repos/soramugi/paperclip/contents/{+path}","compare_url":"https://api.github.com/repos/soramugi/paperclip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/soramugi/paperclip/merges","archive_url":"https://api.github.com/repos/soramugi/paperclip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/soramugi/paperclip/downloads","issues_url":"https://api.github.com/repos/soramugi/paperclip/issues{/number}","pulls_url":"https://api.github.com/repos/soramugi/paperclip/pulls{/number}","milestones_url":"https://api.github.com/repos/soramugi/paperclip/milestones{/number}","notifications_url":"https://api.github.com/repos/soramugi/paperclip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/soramugi/paperclip/labels{/name}","releases_url":"https://api.github.com/repos/soramugi/paperclip/releases{/id}","created_at":"2014-11-14T09:52:44Z","updated_at":"2014-12-12T15:20:28Z","pushed_at":"2014-12-13T06:15:58Z","git_url":"git://github.com/soramugi/paperclip.git","ssh_url":"git@github.com:soramugi/paperclip.git","clone_url":"https://github.com/soramugi/paperclip.git","svn_url":"https://github.com/soramugi/paperclip","homepage":"http://thoughtbot.com/open-source","size":3957,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":0,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"79d42b62ebacb26bfda98fb2f9707f5d5a0e51fb","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":8393,"name":"paperclip","full_name":"thoughtbot/paperclip","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/paperclip","description":"Easy file attachment management for ActiveRecord","fork":false,"url":"https://api.github.com/repos/thoughtbot/paperclip","forks_url":"https://api.github.com/repos/thoughtbot/paperclip/forks","keys_url":"https://api.github.com/repos/thoughtbot/paperclip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/paperclip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/paperclip/teams","hooks_url":"https://api.github.com/repos/thoughtbot/paperclip/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/paperclip/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/paperclip/events","assignees_url":"https://api.github.com/repos/thoughtbot/paperclip/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/paperclip/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/paperclip/tags","blobs_url":"https://api.github.com/repos/thoughtbot/paperclip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/paperclip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/paperclip/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/paperclip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/paperclip/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/paperclip/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/paperclip/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/paperclip/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/paperclip/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/paperclip/subscription","commits_url":"https://api.github.com/repos/thoughtbot/paperclip/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/paperclip/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/paperclip/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/paperclip/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/paperclip/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/paperclip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/paperclip/merges","archive_url":"https://api.github.com/repos/thoughtbot/paperclip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/paperclip/downloads","issues_url":"https://api.github.com/repos/thoughtbot/paperclip/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/paperclip/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/paperclip/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/paperclip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/paperclip/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/paperclip/releases{/id}","created_at":"2008-04-10T19:58:20Z","updated_at":"2014-12-12T23:25:45Z","pushed_at":"2014-12-12T17:21:56Z","git_url":"git://github.com/thoughtbot/paperclip.git","ssh_url":"git@github.com:thoughtbot/paperclip.git","clone_url":"https://github.com/thoughtbot/paperclip.git","svn_url":"https://github.com/thoughtbot/paperclip","homepage":"http://thoughtbot.com/open-source","size":13023,"stargazers_count":6489,"watchers_count":6489,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1442,"mirror_url":null,"open_issues_count":241,"forks":1442,"open_issues":241,"watchers":6489,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1728"},"html":{"href":"https://github.com/thoughtbot/paperclip/pull/1728"},"issue":{"href":"https://api.github.com/repos/thoughtbot/paperclip/issues/1728"},"comments":{"href":"https://api.github.com/repos/thoughtbot/paperclip/issues/1728/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1728/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1728/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/paperclip/statuses/f153955b1b60f045e03731f74fdad7e10ad7a075"}}}}