Merbのsliceは、独立したMerbのサブシステムを再利用する仕組みです。
はじめ、Railsのcomponentのようなものだと思っていたのですが、
どちらかというとEnginesのような機能を持っているようです。

Merbのsliceは、Gemで管理されているので、sliceを利用する場合は、
sliceのGemをインストールします。
例えば、
merb-auth-activation-slice
を利用したい場合、
今の所Gemが配布されていないので、githubからソースを持ってきて、
以下のようにインストールします。

pre>>
% git clone git://github.com/ck/merb-auth-slice-activation.git
% cd merb-auth-slice-activation
% sudo rake install
<<--

そうすると、以下のようにGemがbuildされてインストールされます。

pre>>
% gem list merb-auth-slice-activation

*** LOCAL GEMS ***

merb-auth-slice-activation (1.0)
<<--

この状態で、config/dependencies.rbファイルに依存関係を登録します。

config/dependencies.rb

ruby>>
dependency "merb-auth-slice-activation"
<<--

続いて、sliceをアプリケーションにインストールするRake
タスクを実行します。

pre>>
% rake slices:merb_auth_slice_activation:install
<<--

Sliceに関連するRubyコードがMERB_ROOT/slices以下に、
Assetsファイルが、
public/slices/merb-auth-slice-activation以下に展開されます。

あとは、config/router.rbやconfig/init.rb、config/environments/*.rb
などの中で、適宜slice関連の設定を行います。

posted by genki genki on Tue 25 Nov 2008 at 03:31 with 0 comments
Contents rssrss
光ファイバーを二次元振動させて走査するAR用ディスプレイ
因果の取り違え
Swift2's defer for CoffeeScript
mongodb-3.0からcreateIndexのdropDupsが無くなったらしい
mongodb-3.0以降のWiredTigerの設定を動的に変更する方法
一般楕円の高速生成アルゴリズムへの道標
farro mantecatoのレシピ
Droonga関連の記事のまとめ
RuntimeErrorの特定のメッセージに限定してrescueする方法
jQueryでscriptタグを実行せずにappendする
Tags
coffeescriptdefergroongajsmemonodenodejs
Comments rssrss
https://buy-property-uae.com/ https://buy-property-uae.com/: Real estate experts are convinced, that buying pro... 04/24 00:16
https://buy-property-uae.com/ https://buy-property-uae.com/: Real estate experts are convinced, that acquiring ... 04/24 00:16
https://xn--mgmarkt9-9db.com https://xn--mgmarkt9-9db.com: Как проверить целостность ссылок MEGA: защита от ... 04/23 22:08
https://xn--mgmarkt6-9db.com https://xn--mgmarkt6-9db.com: Как обезопасить хранилище криптовалюты: сравнение... 04/23 20:02
https://www.lifnest.com/author/bradwhiddon136/ https://www.lifnest.com/author/bradwhiddon136/: Лучший bulk index checker из тех, что я пробовал... 04/23 10:21
https://mklider.ru/katalog/protivopozharnoe-oborudovanie/predohranitel-ognevoy-zhidkostnyy-pozh/ https://mklider.ru/katalog/protivopozharnoe-oborudovanie/predohranitel-ognevoy-zhidkostnyy-pozh/: За многие годы работы по производству резервуаров ... 04/23 10:05
https://landminder.com/author/sharonhindman https://landminder.com/author/sharonhindman: Работает стабильно даже на больших объемах данных. 04/23 05:59
https://mimrent.com/author/laylazercho023/ https://mimrent.com/author/laylazercho023/: Good blog. I really liked this. Many thanks for ... 04/23 02:56