{"action":"opened","number":118,"pull_request":{"url":"https://api.github.com/repos/rails/sprockets/pulls/118","id":43409692,"html_url":"https://github.com/rails/sprockets/pull/118","diff_url":"https://github.com/rails/sprockets/pull/118.diff","patch_url":"https://github.com/rails/sprockets/pull/118.patch","issue_url":"https://api.github.com/repos/rails/sprockets/issues/118","number":118,"state":"open","locked":false,"title":"[close #115] Support Windows filesystem","user":{"login":"schneems","id":59744,"avatar_url":"https://avatars.githubusercontent.com/u/59744?v=3","gravatar_id":"","url":"https://api.github.com/users/schneems","html_url":"https://github.com/schneems","followers_url":"https://api.github.com/users/schneems/followers","following_url":"https://api.github.com/users/schneems/following{/other_user}","gists_url":"https://api.github.com/users/schneems/gists{/gist_id}","starred_url":"https://api.github.com/users/schneems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schneems/subscriptions","organizations_url":"https://api.github.com/users/schneems/orgs","repos_url":"https://api.github.com/users/schneems/repos","events_url":"https://api.github.com/users/schneems/events{/privacy}","received_events_url":"https://api.github.com/users/schneems/received_events","type":"User","site_admin":false},"body":"Windows uses a filesystem that starts with a drive letter than a colon and a slash. This is different from *nix systems that only start with a slash. Previous releases 3.3.{1,2,3} didn't take this into consideration.\r\n\r\nTargeted at 4.x\r\n\r\nTo support windows we have to make sure we can correctly expand both kinds of paths. Previously we were checking if a path started with a slash to indicate it was already an absolute path and that we don't need to prepend the root to it. Now we also check for a drive letter + colon + slash. I added tests for windows style paths and this works for compressing them. The downside is that someone could create a folder in their app root called `C:` and this code would incorrectly think that the path was absolute and not expand it. I would assume this would happen in an EXTREME minority of cases, but when it does happen it will be very frustrating to find and fix. We could explicitly check for when you're on a windows machine using `Gem.win_platform?` but I don't know how accurate this code is, and it would make running tests on *nix platforms difficult.\r\n\r\nIn addition to expanding uris, we also have to support compressing them. The root object we get from windows will not contain a beginning slash, it will be something like `C:/Path/to/root`. Unfortunately the path code we've written will produce paths with beginning slashes. If the path starts with a slash we must make sure the root starts with a slash. If we don't  then when we try to get a compressed path from `file:///C:/Projects/Rails/app/assets/javascripts/application.js` which has a path of `/C:/Projects/Rails/app/assets/javascripts/application.js` it will not correctly compare with it's root which is `C:/Projects/Rails/`.  I'm pretty sure this doesn't impact *nix systems as their root will always begin with a slash.\r\n\r\nAdded tests for the new behavior.","created_at":"2015-08-26T14:40:36Z","updated_at":"2015-08-26T14:40:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/sprockets/pulls/118/commits","review_comments_url":"https://api.github.com/repos/rails/sprockets/pulls/118/comments","review_comment_url":"https://api.github.com/repos/rails/sprockets/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/sprockets/issues/118/comments","statuses_url":"https://api.github.com/repos/rails/sprockets/statuses/573754b47484a8b9597ae41a4ce7463d6841ae40","head":{"label":"rails:schneems/fix-windows-4.x","ref":"schneems/fix-windows-4.x","sha":"573754b47484a8b9597ae41a4ce7463d6841ae40","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":32104924,"name":"sprockets","full_name":"rails/sprockets","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/sprockets","description":"Rack-based asset packaging system","fork":false,"url":"https://api.github.com/repos/rails/sprockets","forks_url":"https://api.github.com/repos/rails/sprockets/forks","keys_url":"https://api.github.com/repos/rails/sprockets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/sprockets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/sprockets/teams","hooks_url":"https://api.github.com/repos/rails/sprockets/hooks","issue_events_url":"https://api.github.com/repos/rails/sprockets/issues/events{/number}","events_url":"https://api.github.com/repos/rails/sprockets/events","assignees_url":"https://api.github.com/repos/rails/sprockets/assignees{/user}","branches_url":"https://api.github.com/repos/rails/sprockets/branches{/branch}","tags_url":"https://api.github.com/repos/rails/sprockets/tags","blobs_url":"https://api.github.com/repos/rails/sprockets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/sprockets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/sprockets/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/sprockets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/sprockets/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/sprockets/languages","stargazers_url":"https://api.github.com/repos/rails/sprockets/stargazers","contributors_url":"https://api.github.com/repos/rails/sprockets/contributors","subscribers_url":"https://api.github.com/repos/rails/sprockets/subscribers","subscription_url":"https://api.github.com/repos/rails/sprockets/subscription","commits_url":"https://api.github.com/repos/rails/sprockets/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/sprockets/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/sprockets/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/sprockets/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/sprockets/contents/{+path}","compare_url":"https://api.github.com/repos/rails/sprockets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/sprockets/merges","archive_url":"https://api.github.com/repos/rails/sprockets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/sprockets/downloads","issues_url":"https://api.github.com/repos/rails/sprockets/issues{/number}","pulls_url":"https://api.github.com/repos/rails/sprockets/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/sprockets/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/sprockets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/sprockets/labels{/name}","releases_url":"https://api.github.com/repos/rails/sprockets/releases{/id}","created_at":"2015-03-12T21:56:03Z","updated_at":"2015-08-25T21:56:01Z","pushed_at":"2015-08-26T14:40:10Z","git_url":"git://github.com/rails/sprockets.git","ssh_url":"git@github.com:rails/sprockets.git","clone_url":"https://github.com/rails/sprockets.git","svn_url":"https://github.com/rails/sprockets","homepage":"","size":4876,"stargazers_count":59,"watchers_count":59,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":462,"mirror_url":null,"open_issues_count":23,"forks":462,"open_issues":23,"watchers":59,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"5def4d7771ddb0a393f6ce3c2684205085fe6470","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":32104924,"name":"sprockets","full_name":"rails/sprockets","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/sprockets","description":"Rack-based asset packaging system","fork":false,"url":"https://api.github.com/repos/rails/sprockets","forks_url":"https://api.github.com/repos/rails/sprockets/forks","keys_url":"https://api.github.com/repos/rails/sprockets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/sprockets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/sprockets/teams","hooks_url":"https://api.github.com/repos/rails/sprockets/hooks","issue_events_url":"https://api.github.com/repos/rails/sprockets/issues/events{/number}","events_url":"https://api.github.com/repos/rails/sprockets/events","assignees_url":"https://api.github.com/repos/rails/sprockets/assignees{/user}","branches_url":"https://api.github.com/repos/rails/sprockets/branches{/branch}","tags_url":"https://api.github.com/repos/rails/sprockets/tags","blobs_url":"https://api.github.com/repos/rails/sprockets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/sprockets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/sprockets/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/sprockets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/sprockets/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/sprockets/languages","stargazers_url":"https://api.github.com/repos/rails/sprockets/stargazers","contributors_url":"https://api.github.com/repos/rails/sprockets/contributors","subscribers_url":"https://api.github.com/repos/rails/sprockets/subscribers","subscription_url":"https://api.github.com/repos/rails/sprockets/subscription","commits_url":"https://api.github.com/repos/rails/sprockets/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/sprockets/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/sprockets/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/sprockets/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/sprockets/contents/{+path}","compare_url":"https://api.github.com/repos/rails/sprockets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/sprockets/merges","archive_url":"https://api.github.com/repos/rails/sprockets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/sprockets/downloads","issues_url":"https://api.github.com/repos/rails/sprockets/issues{/number}","pulls_url":"https://api.github.com/repos/rails/sprockets/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/sprockets/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/sprockets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/sprockets/labels{/name}","releases_url":"https://api.github.com/repos/rails/sprockets/releases{/id}","created_at":"2015-03-12T21:56:03Z","updated_at":"2015-08-25T21:56:01Z","pushed_at":"2015-08-26T14:40:10Z","git_url":"git://github.com/rails/sprockets.git","ssh_url":"git@github.com:rails/sprockets.git","clone_url":"https://github.com/rails/sprockets.git","svn_url":"https://github.com/rails/sprockets","homepage":"","size":4876,"stargazers_count":59,"watchers_count":59,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":462,"mirror_url":null,"open_issues_count":23,"forks":462,"open_issues":23,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/sprockets/pulls/118"},"html":{"href":"https://github.com/rails/sprockets/pull/118"},"issue":{"href":"https://api.github.com/repos/rails/sprockets/issues/118"},"comments":{"href":"https://api.github.com/repos/rails/sprockets/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/sprockets/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/sprockets/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/sprockets/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/rails/sprockets/statuses/573754b47484a8b9597ae41a4ce7463d6841ae40"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":52,"deletions":2,"changed_files":2}}