{"id":42049,"date":"2016-08-27T00:57:26","date_gmt":"2016-08-26T15:57:26","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=42049"},"modified":"2016-08-27T00:57:26","modified_gmt":"2016-08-26T15:57:26","slug":"bash-oo-framework","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/bash-oo-framework\/","title":{"rendered":"Bash Infinity Framework - \u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u6982\u5ff5\u3092\u306f\u308b\u304b\u306b\u8d85\u3048\u308b\u30e2\u30c0\u30f3\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2016\/08\/s-2016-08-27-0.25.01.jpg\" alt=\"S 2016 08 27 0 25 01\" title=\"s 2016-08-27 0.25.01.jpg\" border=\"0\" width=\"1072\" height=\"507\" \/><\/p>\n<p>UNIX\u3084Mac\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306a\u3089\u3070\u8ab0\u3067\u3082\u4e00\u5ea6\u306f\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3057\u305f\u7d4c\u9a13\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u3069\u3093\u306a\u74b0\u5883\u3067\u3082\u4f7f\u3044\u56de\u305b\u308b\u30dd\u30fc\u30bf\u30d3\u30ea\u30c6\u30a3\u306e\u9ad8\u3055\u304c\u9b45\u529b\u3067\u3059\u304c\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3068\u3057\u3066\u307f\u308b\u3068\u72ec\u7279\u306a\u90e8\u5206\u304c\u591a\u304f\u3001\u306a\u3093\u3068\u306a\u304f\u82e6\u624b\u610f\u8b58\u3092\u6301\u3063\u3066\u3044\u308b\u65b9\u3082\u591a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300c<a href=\"https:\/\/invent.life\/project\/bash-infinity-framework\">Bash Infinity Framework<\/a>\u300d\u306f\u305d\u3093\u306a\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u6982\u5ff5\u3092\u5b8c\u5168\u306b\u5909\u3048\u3066\u3057\u307e\u3046Bash\u7528\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002<\/p>\n<p>\u30e2\u30b8\u30e5\u30e9\u30fc\u304b\u3064\u8efd\u91cf\u3067\u3001C#\u3084Java\u3001JavaScript\u3068\u3044\u3063\u305f\u4ed6\u306e\u8a00\u8a9e\u306e\u30b3\u30f3\u30bb\u30d7\u30c8\u3092\u53d6\u308a\u5165\u308c\u3001\u30d7\u30e9\u30b0\uff06\u30d7\u30ec\u30a4\u3067\u5fc5\u8981\u306a\u6a5f\u80fd\u3060\u3051\u3092\u8ffd\u52a0\u3057\u3066\u3044\u3051\u308b\u7279\u5fb4\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e3b\u306a\u7279\u5fb4\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059:<\/p>\n<ul>\n<li>\u81ea\u52d5\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/li>\n<li>\u540d\u524d\u4ed8\u304d\u30d1\u30e9\u30e1\u30fc\u30bf($1\u3001$2\u3067\u306f\u306a\u304f\u3066)<\/li>\n<li>\u914d\u5217\u3068\u30de\u30c3\u30d7\u3092\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u5f15\u304d\u6e21\u305b\u308b<\/li>\n<li>try-catch\u306e\u5b9f\u88c5<\/li>\n<li>\u72ec\u81ea\u4f8b\u5916\u306ethrow<\/li>\n<li>\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/li>\n<li>\u51fa\u529b\u3092\u6539\u5584\u3059\u308b\u305f\u3081\u306ecolors\u3068powerline\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u4fbf\u5229\u306a\u30a8\u30a4\u30ea\u30a2\u30b9<\/li>\n<li>\u30ab\u30e9\u30d5\u30eb\u306a\u30ed\u30ae\u30f3\u30b0\u6a5f\u80fd<\/li>\n<li>\u30c6\u30b9\u30c8\u30e9\u30a4\u30d6\u30e9\u30ea<\/li>\n<li>\u578b\u30b7\u30b9\u30c6\u30e0\u306e\u305f\u3081\u306e\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea<\/li>\n<li>\u95a2\u6570\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u305f\u3081\u306e\u30aa\u30da\u30ec\u30fc\u30b7\u30e7\u30f3\u30c1\u30a7\u30a4\u30f3<\/li>\n<li>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u305f\u3081\u306e\u578b\u30b7\u30b9\u30c6\u30e0<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u5b9f\u969b\u306b\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>\u4f7f\u7528\u65b9\u6cd5<\/h2>\n<p>Bash Infinity Framework\u306f\u4eca\u306e\u3068\u3053\u308dBash 4\u7cfb\u3067\u3057\u304b\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002Mac\u306e\u6a19\u6e96Bash\u306f3\u7cfb\u306a\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067Bash 4\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre>\nbrew install bash\n<\/pre>\n<p>\u6b21\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092clone\u3057\u307e\u3059\u3002<\/p>\n<pre>\ngit clone https:\/\/github.com\/niieani\/bash-oo-framework.git\n<\/pre>\n<p>example\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bBash Infinity Framework\u3092\u4f7f\u7528\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3069\u308c\u3082\u666e\u901a\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u306f\u307e\u3063\u305f\u304f\u7570\u306a\u308a\u3001\u4f8b\u3048\u3070human.sh\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code class=\"sh\">#!\/usr\/local\/bin\/bash\n\nsource \"$( cd \"${BASH_SOURCE[0]%\/*}\" && pwd )\/..\/lib\/oo-bootstrap.sh\"\n\nimport util\/namedParameters util\/class\n\nclass:Human() {\n  public string name\n  public integer height\n  public array eaten\n\n  Human.__getter__() {\n    echo \"I'm a human called $(this name), $(this height) cm tall.\"\n  }\n\n  Human.Example() {\n    [array]     someArray\n    [integer]   someNumber\n    [...rest]   arrayOfOtherParams\n\n    echo \"Testing $(var: someArray toString) and $someNumber\"\n    echo \"Stuff: ${arrayOfOtherParams[*]}\"\n\n    # returning the first passed in array\n    @return someArray\n  }\n\n  Human.Eat() {\n    [string] food\n\n    this eaten push \"$food\"\n\n    # will return a string with the value:\n    @return:value \"$(this name) just ate $food, which is the same as $1\"\n  }\n\n  Human.WhatDidHeEat() {\n    this eaten toString\n  }\n\n  # this is a static method, hence the :: in definition\n  Human::PlaySomeJazz() {\n    echo \"$(UI.Powerline.Saxophone)\"\n  }\n}<\/code><\/pre>\n<p>\u25b2Human\u30af\u30e9\u30b9\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u5148\u982d\u884c\u3092\u300c#!\/usr\/local\/bin\/bash\u300d\u306b\u5909\u3048\u300c.\/human.sh\u300d\u3067\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2016\/08\/s-2016-08-27-0.49.07.jpg\" alt=\"S 2016 08 27 0 49 07\" title=\"s 2016-08-27 0.49.07.jpg\" border=\"0\" width=\"755\" height=\"405\" \/><\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u3044\u304d\u306a\u308a\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306f\u30cf\u30fc\u30c9\u30eb\u304c\u9ad8\u305d\u3046\u3067\u3059\u304c\u3001\u5fc5\u8981\u306a\u6a5f\u80fd\u3060\u3051\u3092\u53b3\u9078\u3057\u3066\u5c0e\u5165\u3059\u308c\u3070\u5b9f\u7528\u7684\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u529b\u3092\u5411\u4e0a\u3057\u305f\u3044\u65b9\u306f\u5404\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3069\u306e\u3088\u3046\u306a\u30c6\u30af\u30cb\u30c3\u30af\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u306e\u304b\u78ba\u8a8d\u3057\u3066\u307f\u3066\u3082\u52c9\u5f37\u306b\u306a\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UNIX\u3084Mac\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306a\u3089\u3070\u8ab0\u3067\u3082\u4e00\u5ea6\u306f\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3057\u305f\u7d4c\u9a13\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u3069\u3093\u306a\u74b0\u5883\u3067\u3082\u4f7f\u3044\u56de\u305b\u308b\u30dd\u30fc\u30bf\u30d3\u30ea\u30c6\u30a3\u306e\u9ad8\u3055\u304c\u9b45\u529b\u3067\u3059\u304c\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3068\u3057\u3066\u307f\u308b\u3068\u72ec\u7279\u306a\u90e8\u5206\u304c\u591a\u304f\u3001\u306a\u3093\u3068\u306a\u304f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":42050,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[3459],"tags":[1360],"class_list":["post-42049","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-review","tag-bash"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/42049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=42049"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/42049\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/42050"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=42049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=42049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=42049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}