0
+## A little blog (小さなブログ)
0
+#### What will be covered (この節で取り扱う内容)
0
+ * Setting up the example blog application
0
+ * Configuring your routes
0
+ * Some of the view helpers in `merb_helpers`
0
+ * Configuring and sending emails
0
+ * サンプルとなるブログアプリケーションの設定
0
+ * `merb_helpers` で定義されているビューヘルパのいくつか
0
+In the examples, we'll be developing a small blogging application. It's a good
0
+idea to grab the source code from [http://github.com/deimos1986/book_mdar/tree/master/code](http://github.com/deimos1986/book_mdar/tree/master/code),
0
+so you can follow along with the examples.
0
+サンプルでは、小さいブログアプリケーションを作成します。
0
+ソースコードは [http://github.com/deimos1986/book_mdar/tree/master/code](http://github.com/deimos1986/book_mdar/tree/master/code) から取ってこれますので、サンプルに沿って試すことができます。
0
+First of all, let's define some of the functionality we would expect from any
0
+まず最初に、ブログアプリケーションとして考えられる機能をいくつか定義しましょう。
0
+* Sending email notifications
0
+We're going to call our app `golb`. Think of it as a backward blog. Feel free
0
+to change the name of your app, but if you do, remember to replace the word
0
+`golb` with the name of your app.
0
+このアプリケーションは、`golb` という名前にすることにします。
0
+バックワードのブログとして考えてください〔訳注: ???〕。
0
+アプリの名前は自由に変更して構いませんが、変更した場合は `golb` という単語が出てきたら変更後の名前に置き換えてください。
0
+To make a new app we'll use the command
0
+新しいアプリを作るには、次のコマンドを使います。
0
+Set up the configuration files for your application, this lets Merb know what
0
+gems to load for plugins and generators.
0
+自分のアプリケーションの設定構成ファイルを設定してください。
0
+そうすることで、プラグインやジェネレータでどの gems を読み込むのか、Merb は知ることができるようになります。
0
+ dependencies "dm-validations"
0
+Now add a `config/database.yml` file with the following:
0
+また `config/database.yml` ファイルを次のような内容で作成してください:
0
+ # This is a sample database file for the DataMapper ORM
0
+ development: &defaults
0
+ # These are the settings for repository :default
0
+ # Add more repositories
0
+ # database: sample_development
0
+ # database: sample_development
0
+ database: golb_production
0
+ # database: sample_development
0
+Note: DataMapper has a rake task to generate a default database.yml file:
0
+注意: DataMapper には、デフォルトの database.yml ファイルを生成する rake タスクが用意されています。
0
+You can also put a database URI in development.rb (or other environments) just as easily:
0
+また development.rb (または他の環境設定ファイル) にデータベース URI を設定することも簡単です:
0
+ Merb::BootLoader.after_app_loads do
0
+ DataMapper.setup(:default, 'mysql://user:pass@localhost/database')
0
+Now we're ready to rock and roll ...
0
+ここまできたら、ロックンロールする準備はできました...