{"action":"created","issue":{"url":"https://api.github.com/repos/rylnd/shpec/issues/56","labels_url":"https://api.github.com/repos/rylnd/shpec/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/rylnd/shpec/issues/56/comments","events_url":"https://api.github.com/repos/rylnd/shpec/issues/56/events","html_url":"https://github.com/rylnd/shpec/pull/56","id":67482406,"number":56,"title":"Make it POSIX","user":{"login":"hlangeveld","id":1230736,"avatar_url":"https://avatars.githubusercontent.com/u/1230736?v=3","gravatar_id":"","url":"https://api.github.com/users/hlangeveld","html_url":"https://github.com/hlangeveld","followers_url":"https://api.github.com/users/hlangeveld/followers","following_url":"https://api.github.com/users/hlangeveld/following{/other_user}","gists_url":"https://api.github.com/users/hlangeveld/gists{/gist_id}","starred_url":"https://api.github.com/users/hlangeveld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlangeveld/subscriptions","organizations_url":"https://api.github.com/users/hlangeveld/orgs","repos_url":"https://api.github.com/users/hlangeveld/repos","events_url":"https://api.github.com/users/hlangeveld/events{/privacy}","received_events_url":"https://api.github.com/users/hlangeveld/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rylnd/shpec/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-04-10T01:02:50Z","updated_at":"2015-04-20T15:06:53Z","closed_at":"2015-04-20T15:06:53Z","pull_request":{"url":"https://api.github.com/repos/rylnd/shpec/pulls/56","html_url":"https://github.com/rylnd/shpec/pull/56","diff_url":"https://github.com/rylnd/shpec/pull/56.diff","patch_url":"https://github.com/rylnd/shpec/pull/56.patch"},"body":"Two major updates:\r\n\r\nThis removes any '...shisms' not compatible with POSIX.  We're not going back to pure Bourne shell, which I consider too primitive.  See the individual deltas for what changed.  Two major things were:\r\n\r\n* Arithmetic notation, which I fixed with a hack: prefix every `(( ... ))` expression with `: $`.\r\n\r\n* Simple, single bracket tests:  `[ ... ]` instead of `[[ ... ]]`\r\n\r\nThe second change is to throw all code into functions, this makes testing of functions simple, as we can just source the shpec script and test functions separately.  It also simplifies recursive calls to \r\nshpec. However, recursive calls do not update the assertion and failure counters, as its internals\r\nrun in a subshell, to protect the environment.\r\n\r\nPerformance: I had a simple set of 37 assertions which run in ~12 ms on my laptop.\r\nThere's little difference between bash, ksh and dash, except that bash takes an extra 8-10 ms to start itself.\r\n\r\nI'm still looking for the shell equivalent of python's `if __name__ == '__main__':`\r\nUntil then I need to trigger on the value of `$0`.\r\n\r\n\r\n   \r\n"},"comment":{"url":"https://api.github.com/repos/rylnd/shpec/issues/comments/94477937","html_url":"https://github.com/rylnd/shpec/pull/56#issuecomment-94477937","issue_url":"https://api.github.com/repos/rylnd/shpec/issues/56","id":94477937,"user":{"login":"rylnd","id":657252,"avatar_url":"https://avatars.githubusercontent.com/u/657252?v=3","gravatar_id":"","url":"https://api.github.com/users/rylnd","html_url":"https://github.com/rylnd","followers_url":"https://api.github.com/users/rylnd/followers","following_url":"https://api.github.com/users/rylnd/following{/other_user}","gists_url":"https://api.github.com/users/rylnd/gists{/gist_id}","starred_url":"https://api.github.com/users/rylnd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rylnd/subscriptions","organizations_url":"https://api.github.com/users/rylnd/orgs","repos_url":"https://api.github.com/users/rylnd/repos","events_url":"https://api.github.com/users/rylnd/events{/privacy}","received_events_url":"https://api.github.com/users/rylnd/received_events","type":"User","site_admin":false},"created_at":"2015-04-20T15:06:53Z","updated_at":"2015-04-20T15:06:53Z","body":"Closing this in favor of the newer #58 "}}