{"action":"closed","number":118,"pull_request":{"url":"https://api.github.com/repos/nanoc/nanoc.ws/pulls/118","id":39758453,"html_url":"https://github.com/nanoc/nanoc.ws/pull/118","diff_url":"https://github.com/nanoc/nanoc.ws/pull/118.diff","patch_url":"https://github.com/nanoc/nanoc.ws/pull/118.patch","issue_url":"https://api.github.com/repos/nanoc/nanoc.ws/issues/118","number":118,"state":"closed","locked":false,"title":"Simpler lib","user":{"login":"ddfreyne","id":6269,"avatar_url":"https://avatars.githubusercontent.com/u/6269?v=3","gravatar_id":"","url":"https://api.github.com/users/ddfreyne","html_url":"https://github.com/ddfreyne","followers_url":"https://api.github.com/users/ddfreyne/followers","following_url":"https://api.github.com/users/ddfreyne/following{/other_user}","gists_url":"https://api.github.com/users/ddfreyne/gists{/gist_id}","starred_url":"https://api.github.com/users/ddfreyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddfreyne/subscriptions","organizations_url":"https://api.github.com/users/ddfreyne/orgs","repos_url":"https://api.github.com/users/ddfreyne/repos","events_url":"https://api.github.com/users/ddfreyne/events{/privacy}","received_events_url":"https://api.github.com/users/ddfreyne/received_events","type":"User","site_admin":false},"body":"Rather than explicitly creating classes that are never used, this approach uses `Class.new` to create an anonymous class. **[Best viewed with ?w=1](https://github.com/nanoc/nanoc.ws/pull/118/files?w=1).**\r\n\r\nBefore:\r\n\r\n```\r\nmodule NanocSite\r\n  class CLIDataSource < Nanoc::DataSource\r\n    identifier :cli\r\n    # …\r\n  end\r\nend\r\n```\r\n\r\nAfter:\r\n\r\n```\r\nClass.new(Nanoc::DataSource) do\r\n  identifier :cli\r\n  # …\r\nend\r\n```\r\n\r\nIt might be worth taking this one step further, and adding a `.define` method on plugin classes:\r\n\r\n```\r\nNanoc::DataSource.define(:cli) do\r\n  # …\r\nend\r\n```","created_at":"2015-07-12T07:46:15Z","updated_at":"2015-07-12T08:02:45Z","closed_at":"2015-07-12T08:02:45Z","merged_at":"2015-07-12T08:02:45Z","merge_commit_sha":"ae17a99e8cded967e92fce26a3eb9e75292113b5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nanoc/nanoc.ws/pulls/118/commits","review_comments_url":"https://api.github.com/repos/nanoc/nanoc.ws/pulls/118/comments","review_comment_url":"https://api.github.com/repos/nanoc/nanoc.ws/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nanoc/nanoc.ws/issues/118/comments","statuses_url":"https://api.github.com/repos/nanoc/nanoc.ws/statuses/b09db59456b0f601dc535fa858ab28b614094120","head":{"label":"nanoc:simpler-lib","ref":"simpler-lib","sha":"b09db59456b0f601dc535fa858ab28b614094120","user":{"login":"nanoc","id":3260163,"avatar_url":"https://avatars.githubusercontent.com/u/3260163?v=3","gravatar_id":"","url":"https://api.github.com/users/nanoc","html_url":"https://github.com/nanoc","followers_url":"https://api.github.com/users/nanoc/followers","following_url":"https://api.github.com/users/nanoc/following{/other_user}","gists_url":"https://api.github.com/users/nanoc/gists{/gist_id}","starred_url":"https://api.github.com/users/nanoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanoc/subscriptions","organizations_url":"https://api.github.com/users/nanoc/orgs","repos_url":"https://api.github.com/users/nanoc/repos","events_url":"https://api.github.com/users/nanoc/events{/privacy}","received_events_url":"https://api.github.com/users/nanoc/received_events","type":"Organization","site_admin":false},"repo":{"id":2021748,"name":"nanoc.ws","full_name":"nanoc/nanoc.ws","owner":{"login":"nanoc","id":3260163,"avatar_url":"https://avatars.githubusercontent.com/u/3260163?v=3","gravatar_id":"","url":"https://api.github.com/users/nanoc","html_url":"https://github.com/nanoc","followers_url":"https://api.github.com/users/nanoc/followers","following_url":"https://api.github.com/users/nanoc/following{/other_user}","gists_url":"https://api.github.com/users/nanoc/gists{/gist_id}","starred_url":"https://api.github.com/users/nanoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanoc/subscriptions","organizations_url":"https://api.github.com/users/nanoc/orgs","repos_url":"https://api.github.com/users/nanoc/repos","events_url":"https://api.github.com/users/nanoc/events{/privacy}","received_events_url":"https://api.github.com/users/nanoc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nanoc/nanoc.ws","description":"The nanoc web site","fork":false,"url":"https://api.github.com/repos/nanoc/nanoc.ws","forks_url":"https://api.github.com/repos/nanoc/nanoc.ws/forks","keys_url":"https://api.github.com/repos/nanoc/nanoc.ws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nanoc/nanoc.ws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nanoc/nanoc.ws/teams","hooks_url":"https://api.github.com/repos/nanoc/nanoc.ws/hooks","issue_events_url":"https://api.github.com/repos/nanoc/nanoc.ws/issues/events{/number}","events_url":"https://api.github.com/repos/nanoc/nanoc.ws/events","assignees_url":"https://api.github.com/repos/nanoc/nanoc.ws/assignees{/user}","branches_url":"https://api.github.com/repos/nanoc/nanoc.ws/branches{/branch}","tags_url":"https://api.github.com/repos/nanoc/nanoc.ws/tags","blobs_url":"https://api.github.com/repos/nanoc/nanoc.ws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nanoc/nanoc.ws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nanoc/nanoc.ws/git/refs{/sha}","trees_url":"https://api.github.com/repos/nanoc/nanoc.ws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nanoc/nanoc.ws/statuses/{sha}","languages_url":"https://api.github.com/repos/nanoc/nanoc.ws/languages","stargazers_url":"https://api.github.com/repos/nanoc/nanoc.ws/stargazers","contributors_url":"https://api.github.com/repos/nanoc/nanoc.ws/contributors","subscribers_url":"https://api.github.com/repos/nanoc/nanoc.ws/subscribers","subscription_url":"https://api.github.com/repos/nanoc/nanoc.ws/subscription","commits_url":"https://api.github.com/repos/nanoc/nanoc.ws/commits{/sha}","git_commits_url":"https://api.github.com/repos/nanoc/nanoc.ws/git/commits{/sha}","comments_url":"https://api.github.com/repos/nanoc/nanoc.ws/comments{/number}","issue_comment_url":"https://api.github.com/repos/nanoc/nanoc.ws/issues/comments{/number}","contents_url":"https://api.github.com/repos/nanoc/nanoc.ws/contents/{+path}","compare_url":"https://api.github.com/repos/nanoc/nanoc.ws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nanoc/nanoc.ws/merges","archive_url":"https://api.github.com/repos/nanoc/nanoc.ws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nanoc/nanoc.ws/downloads","issues_url":"https://api.github.com/repos/nanoc/nanoc.ws/issues{/number}","pulls_url":"https://api.github.com/repos/nanoc/nanoc.ws/pulls{/number}","milestones_url":"https://api.github.com/repos/nanoc/nanoc.ws/milestones{/number}","notifications_url":"https://api.github.com/repos/nanoc/nanoc.ws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nanoc/nanoc.ws/labels{/name}","releases_url":"https://api.github.com/repos/nanoc/nanoc.ws/releases{/id}","created_at":"2011-07-09T09:26:43Z","updated_at":"2015-06-23T03:57:24Z","pushed_at":"2015-07-12T08:02:45Z","git_url":"git://github.com/nanoc/nanoc.ws.git","ssh_url":"git@github.com:nanoc/nanoc.ws.git","clone_url":"https://github.com/nanoc/nanoc.ws.git","svn_url":"https://github.com/nanoc/nanoc.ws","homepage":"http://nanoc.ws/","size":21034,"stargazers_count":91,"watchers_count":91,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":7,"forks":47,"open_issues":7,"watchers":91,"default_branch":"master"}},"base":{"label":"nanoc:master","ref":"master","sha":"647d016962819e70ae566d4fdacb5d39b6f2fec0","user":{"login":"nanoc","id":3260163,"avatar_url":"https://avatars.githubusercontent.com/u/3260163?v=3","gravatar_id":"","url":"https://api.github.com/users/nanoc","html_url":"https://github.com/nanoc","followers_url":"https://api.github.com/users/nanoc/followers","following_url":"https://api.github.com/users/nanoc/following{/other_user}","gists_url":"https://api.github.com/users/nanoc/gists{/gist_id}","starred_url":"https://api.github.com/users/nanoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanoc/subscriptions","organizations_url":"https://api.github.com/users/nanoc/orgs","repos_url":"https://api.github.com/users/nanoc/repos","events_url":"https://api.github.com/users/nanoc/events{/privacy}","received_events_url":"https://api.github.com/users/nanoc/received_events","type":"Organization","site_admin":false},"repo":{"id":2021748,"name":"nanoc.ws","full_name":"nanoc/nanoc.ws","owner":{"login":"nanoc","id":3260163,"avatar_url":"https://avatars.githubusercontent.com/u/3260163?v=3","gravatar_id":"","url":"https://api.github.com/users/nanoc","html_url":"https://github.com/nanoc","followers_url":"https://api.github.com/users/nanoc/followers","following_url":"https://api.github.com/users/nanoc/following{/other_user}","gists_url":"https://api.github.com/users/nanoc/gists{/gist_id}","starred_url":"https://api.github.com/users/nanoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanoc/subscriptions","organizations_url":"https://api.github.com/users/nanoc/orgs","repos_url":"https://api.github.com/users/nanoc/repos","events_url":"https://api.github.com/users/nanoc/events{/privacy}","received_events_url":"https://api.github.com/users/nanoc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nanoc/nanoc.ws","description":"The nanoc web site","fork":false,"url":"https://api.github.com/repos/nanoc/nanoc.ws","forks_url":"https://api.github.com/repos/nanoc/nanoc.ws/forks","keys_url":"https://api.github.com/repos/nanoc/nanoc.ws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nanoc/nanoc.ws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nanoc/nanoc.ws/teams","hooks_url":"https://api.github.com/repos/nanoc/nanoc.ws/hooks","issue_events_url":"https://api.github.com/repos/nanoc/nanoc.ws/issues/events{/number}","events_url":"https://api.github.com/repos/nanoc/nanoc.ws/events","assignees_url":"https://api.github.com/repos/nanoc/nanoc.ws/assignees{/user}","branches_url":"https://api.github.com/repos/nanoc/nanoc.ws/branches{/branch}","tags_url":"https://api.github.com/repos/nanoc/nanoc.ws/tags","blobs_url":"https://api.github.com/repos/nanoc/nanoc.ws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nanoc/nanoc.ws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nanoc/nanoc.ws/git/refs{/sha}","trees_url":"https://api.github.com/repos/nanoc/nanoc.ws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nanoc/nanoc.ws/statuses/{sha}","languages_url":"https://api.github.com/repos/nanoc/nanoc.ws/languages","stargazers_url":"https://api.github.com/repos/nanoc/nanoc.ws/stargazers","contributors_url":"https://api.github.com/repos/nanoc/nanoc.ws/contributors","subscribers_url":"https://api.github.com/repos/nanoc/nanoc.ws/subscribers","subscription_url":"https://api.github.com/repos/nanoc/nanoc.ws/subscription","commits_url":"https://api.github.com/repos/nanoc/nanoc.ws/commits{/sha}","git_commits_url":"https://api.github.com/repos/nanoc/nanoc.ws/git/commits{/sha}","comments_url":"https://api.github.com/repos/nanoc/nanoc.ws/comments{/number}","issue_comment_url":"https://api.github.com/repos/nanoc/nanoc.ws/issues/comments{/number}","contents_url":"https://api.github.com/repos/nanoc/nanoc.ws/contents/{+path}","compare_url":"https://api.github.com/repos/nanoc/nanoc.ws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nanoc/nanoc.ws/merges","archive_url":"https://api.github.com/repos/nanoc/nanoc.ws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nanoc/nanoc.ws/downloads","issues_url":"https://api.github.com/repos/nanoc/nanoc.ws/issues{/number}","pulls_url":"https://api.github.com/repos/nanoc/nanoc.ws/pulls{/number}","milestones_url":"https://api.github.com/repos/nanoc/nanoc.ws/milestones{/number}","notifications_url":"https://api.github.com/repos/nanoc/nanoc.ws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nanoc/nanoc.ws/labels{/name}","releases_url":"https://api.github.com/repos/nanoc/nanoc.ws/releases{/id}","created_at":"2011-07-09T09:26:43Z","updated_at":"2015-06-23T03:57:24Z","pushed_at":"2015-07-12T08:02:45Z","git_url":"git://github.com/nanoc/nanoc.ws.git","ssh_url":"git@github.com:nanoc/nanoc.ws.git","clone_url":"https://github.com/nanoc/nanoc.ws.git","svn_url":"https://github.com/nanoc/nanoc.ws","homepage":"http://nanoc.ws/","size":21034,"stargazers_count":91,"watchers_count":91,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":7,"forks":47,"open_issues":7,"watchers":91,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nanoc/nanoc.ws/pulls/118"},"html":{"href":"https://github.com/nanoc/nanoc.ws/pull/118"},"issue":{"href":"https://api.github.com/repos/nanoc/nanoc.ws/issues/118"},"comments":{"href":"https://api.github.com/repos/nanoc/nanoc.ws/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/nanoc/nanoc.ws/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/nanoc/nanoc.ws/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nanoc/nanoc.ws/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/nanoc/nanoc.ws/statuses/b09db59456b0f601dc535fa858ab28b614094120"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"ddfreyne","id":6269,"avatar_url":"https://avatars.githubusercontent.com/u/6269?v=3","gravatar_id":"","url":"https://api.github.com/users/ddfreyne","html_url":"https://github.com/ddfreyne","followers_url":"https://api.github.com/users/ddfreyne/followers","following_url":"https://api.github.com/users/ddfreyne/following{/other_user}","gists_url":"https://api.github.com/users/ddfreyne/gists{/gist_id}","starred_url":"https://api.github.com/users/ddfreyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddfreyne/subscriptions","organizations_url":"https://api.github.com/users/ddfreyne/orgs","repos_url":"https://api.github.com/users/ddfreyne/repos","events_url":"https://api.github.com/users/ddfreyne/events{/privacy}","received_events_url":"https://api.github.com/users/ddfreyne/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":2,"additions":166,"deletions":232,"changed_files":11}}