dm-is-remi
しかし、Validation
1 module Commentable 2 include DataMapper ::Resource 3 is :remixable, :suffix => "comment" 4 5 (..snip..) 6 7 def self.inclu ded(base) 8 base.class_eval do 9 validates_ present :message 10 end 11 end 12 end
See Also
dm-is-remi
しかし、Validation
1 module Commentable 2 include DataMapper ::Resource 3 is :remixable, :suffix => "comment" 4 5 (..snip..) 6 7 def self.inclu ded(base) 8 base.class_eval do 9 validates_ present :message 10 end 11 end 12 end
See Also
Hello, Merbists!
Today, I explain how to develop Merb apps that runs on GAE/J environmen
First of all, here is whole source code of an example app. Please check it out.
After checking it out,
you must edit appengine-
1 MERB_ROOT%jruby -S warble war
It generates files under tmp/war.
So far, you are ready to deploy this app to GAE/J Of course, you need an account of GAE/J to do it. Please get it in advance :-)
Let us go to deploy by this command.
1 MERB_ROOT%appcfg.sh update -e {youraccoun t@gmail.com} tmp/war
This process takes a time for the first time. If the log didn't say any errors, you got success!
Now your first Merb app on GAE/J is here at
http://{your app name}.appspot.c
Congrats!
Further improvemen
APPENDIX
All required gems are being packed into jar file located at lib/merb.j
Enjoy!
Merbでconfig/rou
1 resource :users, 2 :collection=> {:active => :get}, 3 :member => {:password => :get}
:collectio
:memberで指定したアクションは、resource(@user, :password) などのように参照できて、"/users/1/p
GAEを使う上での大きな制限として、ファイル数1000までというのがあります。 これを乗り越えるために、unpackしたGemの中から不要なファイルを掃除したりする必要があったのですが、 関連するGem群をjarファイルにまとめる事でこの問題を乗り越えられます。
上記のファイルをlibの下に配置して、config/ini
実際に以下のサイトでmerb.jarを使って運用しています。
これによって、事実上ファイル数制限に左右されずにアプリケーションを開発する事が出来るようになります。 ただ、1ファイルのサイズ制限(10MB)が存在するので、jarファイルが大きくなりすぎた場合は分割する必要があります。
I shipped new dm-datasto
This update is a long jump from previous version. It includes following functions
1 Post.all(:id => [1,2])
1 Post.all(:id.not => 4)
So now we can use most of functions defined in DM by using this adapter.
Enjoy!
非常にシンプルなのですが、毎回GlobalHelp
http://git
インストール方法
1 % sudo gem install merb_gravatar
使用法
dependency
1 <%= gravatar @user.mail, 16 %>
第二引数はアイコンのサイズを1~80で指定します。省略すると80が選ばれます。
例
GAE/Jでも使えます(See http://wat
Today I shipped a new DataMapper
By using this plugin, you can seamlessly
For example, this site is powered by Merb/DM with the dm-datasto
(This service is under constructi
As a matter of fact, because it is still being alpha status,
you must treat various issues regarding gem dependenci
Enjoy!
Bumble はGoogle App Engine for JavaのDateSoreを利用するためのライブラリですが、Railsで利用する前提で作られているので、 Merbで利用する場合には、以下のような修正を加えると良いようです。
bumble.rb
1 module Bumble 2 (..snip..) 3 def self.included(base) 4 base.send :include, InstanceMe thods 5 base.send :extend, ClassMetho ds 6 Merb::Router.root_behav ior = 7 Merb::Router.root_behav ior.identify(Bumble => :key) 8 end
これによって、resource(@person) #=> /people/5 のようにidentifyしてくれるようになります。
2日前ぐらいからいろいろ頑張ってたのですが、ようやくGAEjの本番環境でMerbアプリを動かせました。
使っているgemをfreezeする仕組みがあるフレームワークであれば、どれでも以外と簡単に動きそうな感じがします。
いやー、これは色々面白い事が出来そうですね!
以前、Merb用のaliasの設定をご紹介しましたが、今度はjruby版です。
1 alias jm='PATH=./bin:$PATH jruby -S merb' 2 alias jmi='jm -i' 3 alias jmg='PATH=./bin :$PATH jruby -S merb-gen'
rubyとjrubyを両方使ってると、
1 % jruby -S merb
のように書く事が多いので、aliasを設定しておくと便利ですね。