{"action":"created","issue":{"url":"https://api.github.com/repos/SunriseDigital/cs-sdx/issues/22","labels_url":"https://api.github.com/repos/SunriseDigital/cs-sdx/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/SunriseDigital/cs-sdx/issues/22/comments","events_url":"https://api.github.com/repos/SunriseDigital/cs-sdx/issues/22/events","html_url":"https://github.com/SunriseDigital/cs-sdx/pull/22","id":105949519,"number":22,"title":"Configリファクタリング","user":{"login":"gomo","id":639604,"avatar_url":"https://avatars.githubusercontent.com/u/639604?v=3","gravatar_id":"","url":"https://api.github.com/users/gomo","html_url":"https://github.com/gomo","followers_url":"https://api.github.com/users/gomo/followers","following_url":"https://api.github.com/users/gomo/following{/other_user}","gists_url":"https://api.github.com/users/gomo/gists{/gist_id}","starred_url":"https://api.github.com/users/gomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gomo/subscriptions","organizations_url":"https://api.github.com/users/gomo/orgs","repos_url":"https://api.github.com/users/gomo/repos","events_url":"https://api.github.com/users/gomo/events{/privacy}","received_events_url":"https://api.github.com/users/gomo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-11T05:52:09Z","updated_at":"2015-09-11T06:09:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SunriseDigital/cs-sdx/pulls/22","html_url":"https://github.com/SunriseDigital/cs-sdx/pull/22","diff_url":"https://github.com/SunriseDigital/cs-sdx/pull/22.diff","patch_url":"https://github.com/SunriseDigital/cs-sdx/pull/22.patch"},"body":"Configの役目は、Yamlの様なツリーデータから値を取り出す機能と、ディレクトリを指定して、そこから設定ファイルを読み込む機能と２つの責任をもっていたのを、Data.TreeとConfigに分割します。\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/SunriseDigital/cs-sdx/issues/comments/139461602","html_url":"https://github.com/SunriseDigital/cs-sdx/pull/22#issuecomment-139461602","issue_url":"https://api.github.com/repos/SunriseDigital/cs-sdx/issues/22","id":139461602,"user":{"login":"gomo","id":639604,"avatar_url":"https://avatars.githubusercontent.com/u/639604?v=3","gravatar_id":"","url":"https://api.github.com/users/gomo","html_url":"https://github.com/gomo","followers_url":"https://api.github.com/users/gomo/followers","following_url":"https://api.github.com/users/gomo/following{/other_user}","gists_url":"https://api.github.com/users/gomo/gists{/gist_id}","starred_url":"https://api.github.com/users/gomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gomo/subscriptions","organizations_url":"https://api.github.com/users/gomo/orgs","repos_url":"https://api.github.com/users/gomo/repos","events_url":"https://api.github.com/users/gomo/events{/privacy}","received_events_url":"https://api.github.com/users/gomo/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T06:09:36Z","updated_at":"2015-09-11T06:09:36Z","body":"# 驚きの事実！！\r\n\r\n## Windowsで.で終わるファイル\r\n\r\nちょっとしたケアレスミスで、実際のパスの最後に`.`が付与されてプログラムから読み込んでいました。\r\n\r\n```c#\r\n      //pathの中身は\"c:\\path\\to\\yaml.yml.\"\r\n      using (var fs = new FileStream(path, FileMode.Open))\r\n      {\r\n        var input = new StreamReader(fs, encoding);\r\n        tree.Load(input);\r\n      }\r\n```\r\n\r\nなんと、これは何事もなかったかのように`\"c:\\path\\to\\yaml.yml.\"`を読みます。ローカルでテストが通っていたのに、pushしたらtravisでコケて発覚しました。Windowsだけでテストしていたらずっと気づかなかったでしょう。\r\n\r\nまあ、windowsのみで使うぶんには問題ないのかもしれんけど気持ち悪い。\r\n\r\nちなみに、windowsで`yaml.yml.`の様に`.`で終わるファイルを作ろうとすると勝手に取り除かれるようです。"}}