{"action":"created","issue":{"url":"https://api.github.com/repos/dagolden/Path-Tiny/issues/130","labels_url":"https://api.github.com/repos/dagolden/Path-Tiny/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/dagolden/Path-Tiny/issues/130/comments","events_url":"https://api.github.com/repos/dagolden/Path-Tiny/issues/130/events","html_url":"https://github.com/dagolden/Path-Tiny/issues/130","id":59728799,"number":130,"title":"Feature: allow checking path attributes at instantiation and throw error on failure","user":{"login":"kbenson","id":298458,"avatar_url":"https://avatars.githubusercontent.com/u/298458?v=3","gravatar_id":"","url":"https://api.github.com/users/kbenson","html_url":"https://github.com/kbenson","followers_url":"https://api.github.com/users/kbenson/followers","following_url":"https://api.github.com/users/kbenson/following{/other_user}","gists_url":"https://api.github.com/users/kbenson/gists{/gist_id}","starred_url":"https://api.github.com/users/kbenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbenson/subscriptions","organizations_url":"https://api.github.com/users/kbenson/orgs","repos_url":"https://api.github.com/users/kbenson/repos","events_url":"https://api.github.com/users/kbenson/events{/privacy}","received_events_url":"https://api.github.com/users/kbenson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-04T00:06:08Z","updated_at":"2015-03-04T16:53:49Z","closed_at":"2015-03-04T06:23:35Z","body":"How amenable are you to allowing an optional hashref passed as the last item in path() that confirms the path matches some simple criteria (such as the exists and the is_* methods) or throws an error?  I would be happy to write the code myself and submit a pull request if you think it's worth while.\r\n\r\nE.g.\r\npath(\"/opt/some_dir\", {is_dir=>1}); # OK\r\npath(\"/opt/some_dir\", {is_file=>1}); # throws error like \"Supplied path does not match positive 'is_file' requirement\r\npath(\"/opt/some_dir\", {is_dir=>0}); # throws error like \"Supplied path does not match negative 'is_dir' requirement\r\npath(\"../some_dir\", {is_absolute=>1,is_dir=>1}); # throws error like \"Supplied path does not match positive 'is_absolute' requirement\r\n\r\nI think that's clear, and will help clean up some validation code for a lot of people."},"comment":{"url":"https://api.github.com/repos/dagolden/Path-Tiny/issues/comments/77196481","html_url":"https://github.com/dagolden/Path-Tiny/issues/130#issuecomment-77196481","issue_url":"https://api.github.com/repos/dagolden/Path-Tiny/issues/130","id":77196481,"user":{"login":"kbenson","id":298458,"avatar_url":"https://avatars.githubusercontent.com/u/298458?v=3","gravatar_id":"","url":"https://api.github.com/users/kbenson","html_url":"https://github.com/kbenson","followers_url":"https://api.github.com/users/kbenson/followers","following_url":"https://api.github.com/users/kbenson/following{/other_user}","gists_url":"https://api.github.com/users/kbenson/gists{/gist_id}","starred_url":"https://api.github.com/users/kbenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbenson/subscriptions","organizations_url":"https://api.github.com/users/kbenson/orgs","repos_url":"https://api.github.com/users/kbenson/repos","events_url":"https://api.github.com/users/kbenson/events{/privacy}","received_events_url":"https://api.github.com/users/kbenson/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T16:53:49Z","updated_at":"2015-03-04T16:53:49Z","body":"sounds good! Thanks again!\nOn Mar 4, 2015 3:57 AM, \"David Golden\" <notifications@github.com> wrote:\n\n> Darn late night coding! Thanks for catching that typo.\n>\n> I have a bunch of other PR's to add to Path::Tiny so this will get\n> released \"soon\" but not necessarily today.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/dagolden/Path-Tiny/issues/130#issuecomment-77145594>.\n>\n"}}