{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/comments/74302360","id":74302360,"diff_hunk":"@@ -34,19 +44,37 @@ class Bundle < Schmooze::Base\n       OUTRO = <<-JS.freeze\n }();\n JS\n+      def initialize(root)\n+        super(root, 'NODE_PATH' => JS_PACKAGE_PATH)\n+      end\n+\n       def self.instance(env)\n         @instance ||= new(env.root)\n       end\n \n       def self.call(input)\n-        instance(input[:environment]).call(input)\n+        env = input[:environment]\n+        instance(env).call(input)\n       end\n \n       def call(input)\n         return unless input[:metadata][:commoner_enabled]\n+        env = input[:environment]\n+        assets_in_bundle = Set.new(input[:metadata][:included]\n+          .map { |uri| env.load(uri) }\n+          .map { |asset| env.resolve(asset.filename, type: input[:content_type], pipeline: :self, compat: false)[0] })\n+        assets_missing = Set.new(input[:metadata][:commoner_required]) - assets_in_bundle\n+\n+        global_identifiers = assets_missing.map do |uri|\n+          asset = env.load(uri)\n+          filename = asset.filename\n+          global = asset.metadata[:commoner_global_identifier]\n+          raise InaccessibleStubbedFileError, \"#{filename} is stubbed in #{input[:filename]} but doesn't define a global. Add an 'expose' directive.\" if global.nil?\n+          [filename.slice(env.root.size + 1, filename.size), global]","path":"lib/sprockets/commoner/bundle.rb","position":70,"original_position":70,"commit_id":"4548d2e75142d0e0270b05f204389318923bc6ab","original_commit_id":"4548d2e75142d0e0270b05f204389318923bc6ab","user":{"login":"lemonmade","id":3012583,"avatar_url":"https://avatars.githubusercontent.com/u/3012583?v=3","gravatar_id":"","url":"https://api.github.com/users/lemonmade","html_url":"https://github.com/lemonmade","followers_url":"https://api.github.com/users/lemonmade/followers","following_url":"https://api.github.com/users/lemonmade/following{/other_user}","gists_url":"https://api.github.com/users/lemonmade/gists{/gist_id}","starred_url":"https://api.github.com/users/lemonmade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lemonmade/subscriptions","organizations_url":"https://api.github.com/users/lemonmade/orgs","repos_url":"https://api.github.com/users/lemonmade/repos","events_url":"https://api.github.com/users/lemonmade/events{/privacy}","received_events_url":"https://api.github.com/users/lemonmade/received_events","type":"User","site_admin":false},"body":"You don't need to iterate over it, do you? You just need to access the two properties unless I am reading it wrong.","created_at":"2016-08-10T18:28:17Z","updated_at":"2016-08-10T18:28:17Z","html_url":"https://github.com/Shopify/sprockets-commoner/pull/34#discussion_r74302360","pull_request_url":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/comments/74302360"},"html":{"href":"https://github.com/Shopify/sprockets-commoner/pull/34#discussion_r74302360"},"pull_request":{"href":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/34","id":80829932,"html_url":"https://github.com/Shopify/sprockets-commoner/pull/34","diff_url":"https://github.com/Shopify/sprockets-commoner/pull/34.diff","patch_url":"https://github.com/Shopify/sprockets-commoner/pull/34.patch","issue_url":"https://api.github.com/repos/Shopify/sprockets-commoner/issues/34","number":34,"state":"open","locked":false,"title":"Add support for automatic use of expose directives from other files","user":{"login":"bouk","id":97820,"avatar_url":"https://avatars.githubusercontent.com/u/97820?v=3","gravatar_id":"","url":"https://api.github.com/users/bouk","html_url":"https://github.com/bouk","followers_url":"https://api.github.com/users/bouk/followers","following_url":"https://api.github.com/users/bouk/following{/other_user}","gists_url":"https://api.github.com/users/bouk/gists{/gist_id}","starred_url":"https://api.github.com/users/bouk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bouk/subscriptions","organizations_url":"https://api.github.com/users/bouk/orgs","repos_url":"https://api.github.com/users/bouk/repos","events_url":"https://api.github.com/users/bouk/events{/privacy}","received_events_url":"https://api.github.com/users/bouk/received_events","type":"User","site_admin":false},"body":"@lemonmade @rafaelfranca @GoodForOneFare \r\n\r\nThis PR instruments the commoner bundler to retrieve the global identifiers of any files that are required, but not included in the bundle (that is, they were stubbed). It then uses these global identifiers to fulfill the references.","created_at":"2016-08-10T16:57:58Z","updated_at":"2016-08-10T18:28:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ab39393b2f4dfb375963510d2ed97251eca5a6b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/34/commits","review_comments_url":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/34/comments","review_comment_url":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/sprockets-commoner/issues/34/comments","statuses_url":"https://api.github.com/repos/Shopify/sprockets-commoner/statuses/4548d2e75142d0e0270b05f204389318923bc6ab","head":{"label":"Shopify:stubby","ref":"stubby","sha":"4548d2e75142d0e0270b05f204389318923bc6ab","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":51015245,"name":"sprockets-commoner","full_name":"Shopify/sprockets-commoner","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/sprockets-commoner","description":"Use Babel in Sprockets to compile JavaScript modules for the browser","fork":false,"url":"https://api.github.com/repos/Shopify/sprockets-commoner","forks_url":"https://api.github.com/repos/Shopify/sprockets-commoner/forks","keys_url":"https://api.github.com/repos/Shopify/sprockets-commoner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/sprockets-commoner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/sprockets-commoner/teams","hooks_url":"https://api.github.com/repos/Shopify/sprockets-commoner/hooks","issue_events_url":"https://api.github.com/repos/Shopify/sprockets-commoner/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/sprockets-commoner/events","assignees_url":"https://api.github.com/repos/Shopify/sprockets-commoner/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/sprockets-commoner/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/sprockets-commoner/tags","blobs_url":"https://api.github.com/repos/Shopify/sprockets-commoner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/sprockets-commoner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/sprockets-commoner/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/sprockets-commoner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/sprockets-commoner/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/sprockets-commoner/languages","stargazers_url":"https://api.github.com/repos/Shopify/sprockets-commoner/stargazers","contributors_url":"https://api.github.com/repos/Shopify/sprockets-commoner/contributors","subscribers_url":"https://api.github.com/repos/Shopify/sprockets-commoner/subscribers","subscription_url":"https://api.github.com/repos/Shopify/sprockets-commoner/subscription","commits_url":"https://api.github.com/repos/Shopify/sprockets-commoner/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/sprockets-commoner/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/sprockets-commoner/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/sprockets-commoner/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/sprockets-commoner/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/sprockets-commoner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/sprockets-commoner/merges","archive_url":"https://api.github.com/repos/Shopify/sprockets-commoner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/sprockets-commoner/downloads","issues_url":"https://api.github.com/repos/Shopify/sprockets-commoner/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/sprockets-commoner/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/sprockets-commoner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/sprockets-commoner/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/sprockets-commoner/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/sprockets-commoner/deployments","created_at":"2016-02-03T16:58:24Z","updated_at":"2016-07-31T22:04:09Z","pushed_at":"2016-08-10T16:57:59Z","git_url":"git://github.com/Shopify/sprockets-commoner.git","ssh_url":"git@github.com:Shopify/sprockets-commoner.git","clone_url":"https://github.com/Shopify/sprockets-commoner.git","svn_url":"https://github.com/Shopify/sprockets-commoner","homepage":"","size":199,"stargazers_count":35,"watchers_count":35,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":35,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"3f8174272d667109c01593de2c0dd5eb2f49dd0e","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":51015245,"name":"sprockets-commoner","full_name":"Shopify/sprockets-commoner","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/sprockets-commoner","description":"Use Babel in Sprockets to compile JavaScript modules for the browser","fork":false,"url":"https://api.github.com/repos/Shopify/sprockets-commoner","forks_url":"https://api.github.com/repos/Shopify/sprockets-commoner/forks","keys_url":"https://api.github.com/repos/Shopify/sprockets-commoner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/sprockets-commoner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/sprockets-commoner/teams","hooks_url":"https://api.github.com/repos/Shopify/sprockets-commoner/hooks","issue_events_url":"https://api.github.com/repos/Shopify/sprockets-commoner/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/sprockets-commoner/events","assignees_url":"https://api.github.com/repos/Shopify/sprockets-commoner/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/sprockets-commoner/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/sprockets-commoner/tags","blobs_url":"https://api.github.com/repos/Shopify/sprockets-commoner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/sprockets-commoner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/sprockets-commoner/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/sprockets-commoner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/sprockets-commoner/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/sprockets-commoner/languages","stargazers_url":"https://api.github.com/repos/Shopify/sprockets-commoner/stargazers","contributors_url":"https://api.github.com/repos/Shopify/sprockets-commoner/contributors","subscribers_url":"https://api.github.com/repos/Shopify/sprockets-commoner/subscribers","subscription_url":"https://api.github.com/repos/Shopify/sprockets-commoner/subscription","commits_url":"https://api.github.com/repos/Shopify/sprockets-commoner/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/sprockets-commoner/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/sprockets-commoner/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/sprockets-commoner/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/sprockets-commoner/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/sprockets-commoner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/sprockets-commoner/merges","archive_url":"https://api.github.com/repos/Shopify/sprockets-commoner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/sprockets-commoner/downloads","issues_url":"https://api.github.com/repos/Shopify/sprockets-commoner/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/sprockets-commoner/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/sprockets-commoner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/sprockets-commoner/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/sprockets-commoner/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/sprockets-commoner/deployments","created_at":"2016-02-03T16:58:24Z","updated_at":"2016-07-31T22:04:09Z","pushed_at":"2016-08-10T16:57:59Z","git_url":"git://github.com/Shopify/sprockets-commoner.git","ssh_url":"git@github.com:Shopify/sprockets-commoner.git","clone_url":"https://github.com/Shopify/sprockets-commoner.git","svn_url":"https://github.com/Shopify/sprockets-commoner","homepage":"","size":199,"stargazers_count":35,"watchers_count":35,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/34"},"html":{"href":"https://github.com/Shopify/sprockets-commoner/pull/34"},"issue":{"href":"https://api.github.com/repos/Shopify/sprockets-commoner/issues/34"},"comments":{"href":"https://api.github.com/repos/Shopify/sprockets-commoner/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/sprockets-commoner/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/sprockets-commoner/statuses/4548d2e75142d0e0270b05f204389318923bc6ab"}}}}
{"actor":{"display_login":"lemonmade"}}