{"id":7136,"date":"2012-07-08T16:52:58","date_gmt":"2012-07-08T07:52:58","guid":{"rendered":"http:\/\/fukata.org\/?p=7136"},"modified":"2017-08-11T22:58:48","modified_gmt":"2017-08-11T22:58:48","slug":"mojolicious-oreore-fw-add-cli","status":"publish","type":"post","link":"https:\/\/blog.fukata.org\/archives\/7136\/","title":{"rendered":"Mojolicious\u3092\u4f7f\u3063\u3066\u30aa\u30ec\u30aa\u30ecFW\u5316\u3078\u306e\u9053 \u301cCLI\u6a5f\u80fd\u306e\u8ffd\u52a0\u301c"},"content":{"rendered":"

\u6700\u8fd1\u3001\u81ea\u5206\u306e\u4e2d\u3067\u4e2d\u898f\u6a21\uff08WEB\u3068\u3061\u3087\u3063\u3068\u3057\u305f\u30d0\u30c3\u30c1\u6570\u672c\uff09\u30b5\u30a4\u30c8\u3092\u4f5c\u6210\u3059\u308b\u6642\u306b\u4ee5\u524d\u306fPHP\u3092\u4f7f\u7528\u3057\u3066\u3044\u305f\u3093\u3067\u3059\u304c\u3001\u672c\u696d\u3067Perl\u3092\u89e6\u308a\u3060\u3057\u305f\u3068\u3044\u3046\u306e\u3068CPAN\u306e\u4fbf\u5229\u3055\u306b\u6163\u308c\u3066\u3057\u307e\u3063\u3066\u4eca\u3067\u306fPerl\u3067\u4f5c\u308b\u3053\u3068\u304c\u591a\u304f\u306a\u308a\u307e\u3057\u305f\u3002 \u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u3092\u65e9\u3081\u308b\u305f\u3081\u306b\u500b\u4eba\u7684\u306b\u4f7f\u3044\u3084\u3059\u3044FW\u3092\u4f7f\u3063\u3066\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u3072\u306a\u5f62\u3092\u4f5c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n

\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u3072\u306a\u5f62\u3092\u4f5c\u308b\u524d\u306b\u3069\u306eFW\u3092\u4f7f\u304a\u3046\u304b\u8ff7\u3063\u305f\u3093\u3067\u3059\u304c\u3001MVC\u30d9\u30fc\u30b9\u3067\u4f9d\u5b58\u6027\u306e\u4f4e\u3044\u3082\u306e\u304c\u6b32\u3057\u304b\u3063\u305f\u306e\u3068\u3061\u3087\u3046\u3069Mojolicious3.0<\/a>\u306e\u30ea\u30ea\u30fc\u30b9\u8a18\u4e8b\u3092\u898b\u304b\u3051\u305f\u306e\u3067Mojolicious\u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\u3061\u306a\u307f\u306bMojolicious\u3092\u4f7f\u3046\u306e\u306f\u4eca\u56de\u304c\u521d\u3081\u3066\u3067\u3059\u3002<\/p>\n

\u4eca\u56de\u306fMojolicious\u306bCLI\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n

<\/p>\n

\u307e\u305a\u3001\u6700\u7d42\u7684\u306b\u3053\u3093\u306a\u611f\u3058\u3067\u5b9f\u884c\u3057\u305f\u3044\u3067\u3059\u3002<\/p>\n

\r\n.\/script\/cli Hoge\r\n<\/pre>\n

Hoge\u306f\u30d5\u30a1\u30a4\u30eb\u5358\u4f4d\u306b\u5206\u5272\u3055\u308c\u305fcli\u7528\u30e2\u30b8\u30e5\u30fc\u30eb\u540d\u3067\u3059\u3002<\/p>\n

Mojolicious\u306bcil\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u305f\u7d50\u679c\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u69cb\u6210\u306b\u306a\u308a\u307e\u3057\u305f\u3002mojo generate app MyApp::Web\u3068\u3059\u308b\u3053\u3068\u3067Web\u7528\u306e\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u3092\u78ba\u4fdd\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n

\r\nmy_app\/\r\n\u251c\u2500\u2500 lib\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 MyApp\r\n\u2502\u00a0\u00a0     \u251c\u2500\u2500 Cli\r\n\u2502\u00a0\u00a0     \u2502\u00a0\u00a0 \u2514\u2500\u2500 Hoge.pm\r\n\u2502\u00a0\u00a0     \u251c\u2500\u2500 Cli.pm\r\n\u2502\u00a0\u00a0     \u251c\u2500\u2500 Web\r\n\u2502\u00a0\u00a0     \u2502\u00a0\u00a0 \u2514\u2500\u2500 Example.pm\r\n\u2502\u00a0\u00a0     \u2514\u2500\u2500 Web.pm\r\n\u251c\u2500\u2500 log\r\n\u251c\u2500\u2500 public\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 index.html\r\n\u251c\u2500\u2500 script\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 cli\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 my_app\r\n\u251c\u2500\u2500 t\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 basic.t\r\n\u2514\u2500\u2500 templates\r\n    \u251c\u2500\u2500 example\r\n    \u2502\u00a0\u00a0 \u2514\u2500\u2500 welcome.html.ep\r\n    \u2514\u2500\u2500 layouts\r\n        \u2514\u2500\u2500 default.html.ep\r\n<\/pre>\n

\u65b0\u305f\u306b\u8ffd\u52a0\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n

\u76ee\u6b21<\/p>