New WebDAV Ruby On Rails Plugin Release

January 6th, 2007

I’ve finally had some time over the holidays to put together a new release of the RailsDAV plugin for WebDAV functionality in Rails.

It’s still really a 0.0.2 release as bugs are to be fixed and still havn’t nailed a structure for the plugin i’m happy with. But for now I have improved the structure and implemented some fixes courtesy of Albert Ramstedt. Thanks Albert.

As such the use of RailsDAV plugin has changed a bit and it won’t be backwards compatible so scan the code if you are using it.

The act_as_railsdav method is attached to ActionController and can be used by calling act_as_railsdav on a controller


 class MyDavController < ActionController::Base
    act_as_railsdav

The controller must then have a route of

map.connect 'mydav/*path_info', :controller => 'my_dav', :action => 'webdav'

It is then necessary to implement some or all of the following methods:

get_resource_for_path needs to return a WebDAVResource object such as FileWebDavResource

To add webdav authentication to your controller just use


class MyDavController < ActionController::Base
   act_as_railsdav
   before_filter :my_auth

   def my_auth()
       basic_auth_required |username, password| do
          session[:user] = User.your_authentication(username,password)
       end
   end

Additionally you can add a simple filesystem expose to a controller by:


 class FileDavController < ActionController::Base
    act_as_filewebdav :base_dir => 'public'
 end

The new version of the plugin can be donwloaded using
svn co http://svn.liverail.net/svn/plugins/railsdav
It also requires the following gems

I’m going to spend a lot more time on RailsDAV now so let me know what you want out of it!

27 Responses to “ New WebDAV Ruby On Rails Plugin Release”

  1. Fabien Franzen Says:

    Nice work Stuart! I still have a need for WebDAV in Rails, so I will be using your plugin in the near future. I’m sorry I wasn’t able to contribute (yet), I’ve been awfully busy. Also, I’m starting out using Flex with Rails as well.

  2. Tony Says:

    This is looking good, thanks! All it needs for me is ability to set the base_dir dynamically. :)

  3. Stuart Eccles Says:

    yep thats in the TODOs ;-)

  4. Michael Says:

    Thanks Stuart. I’ m really looking forward to the next RailsDAV release and it’s good to read, that you will work on improvements. Keep on your great work.

  5. Linkfelhő Says:

    Thanks for it. I’m looking forward to the next release too.

  6. Martin Says:

    Hi there. This looks really useful. I noticed that in your description of the new version, you don’t mention the ActiveRecord exposer which existed in versions past. Any plans to support that again? That’d really be awesome thing to have for many Rails apps, I’m sure.

    Many thanks and please keep up the good work!

  7. Stuart Eccles Says:

    The active record version was always meant more of an example as how to use railsdav to expose things other than directories over webdav rather than anything really useful. I might be tempted to do some other clever active record things as examples if people are interested.

  8. Martin Says:

    Definitely interested. Thanks!

  9. rot Says:

    has anyone tested this with the windows xp webdav clients (there are 2 – one that comes when you specify a port – the other one when you don´t). the only way i found out that it works is when you use the one that works with the port specified. And this one only seems to work when you use mongrel or something similar directly or with a proxy in front not in a fastcgi setup because apache doesn´t let the rails app answer the http options request (well that´s an apache problem but still its not so comfortable)

  10. Stuart Eccles Says:

    Yes there has been a lot of testing on windows. I think the problem is with the apache setup but i have run a successfully before using a Lighttpd FCGI setup behind an apache proxy but i’ll try to test it out with a few different setups.

  11. Albert Ramstedt Says:

    Oh, I just found this post! Thanks for mentioning me. I sortof abandoned the ServeWebdav gem, so its good that you found it useful. I have tested the ServeWebdav gem on macs and windows default/netdrive, and it worked pretty good. I never really got performance to an acceptable level for my own use (mapping AR).

  12. 3d Says:

    Thank you!

  13. lars Says:

    Definitely interested. Thanks!

  14. Daniel Says:

    To be able to handle large files, getting the contents streamed to a yield-block would be nice. Do you already have a version of webdav_put() that does this? A test for respond_to?(:webdav_put_streamed) would probably be enough.

  15. Barney Says:

    Great stuff so far. What about security? Is there a way to use https with filedav?

    Cheers

  16. Jim Says:

    Hi!

    How do I upload a whole folder containing multiple files?

    I cannot figure it out!

    Thanks

  17. seo Says:

    本当にいいですね。

  18. 阳澄湖大闸蟹 Says:

    批发阳澄湖大闸蟹,买卖阳澄湖大闸蟹,咨询阳澄湖大闸蟹价格。建立几年的大闸蟹团购和大闸蟹批发供需关系。研究阳澄湖大闸蟹生态养殖、大闸蟹吃法、阳澄湖大闸蟹介绍与鉴别。

  19. 車 コーティング Says:

    こちらお車 コーティングさんは、バンパーを板金したそうでガラス車コーティングの部分施工とボディ全体。

  20. 铸造 Says:

    中国铸造网提供铸造信息,铸造标准,铸造工艺,不锈钢铸件,压铸件,铝铸件,铜铸件,铝浇铸,离心浇铸,离心浇铸机,浇铸模具,精密铸造公司,大型铸钢件铸造公司,不锈钢精密铸造,精密铸造工艺,宁波铸造等。

  21. 铸造 Says:

    中国铸造网提供铸造信息,铸造标准,铸造工艺,不锈钢铸件,压铸件,铝铸件,铜铸件,铝浇铸,离心浇铸,离心浇铸机,浇铸模具,精密铸造公司,大型铸钢件铸造公司,不锈钢精密铸造,精密铸造工艺,宁波铸造等。

  22. 铸造 Says:

    中国铸造网提供铸造信息,铸造标准,铸造工艺,不锈钢铸件,压铸件,铝铸件,铜铸件,铝浇铸,离心浇铸,离心浇铸机,浇铸模具,精密铸造公司,大型铸钢件铸造公司,不锈钢精密铸造,精密铸造工艺,宁波铸造等。

  23. 铸造 Says:

    中国铸造网提供铸造信息,铸造标准,铸造工艺,不锈钢铸件,压铸件,铝铸件,铜铸件,铝浇铸,离心浇铸,离心浇铸机,浇铸模具,精密铸造公司,大型铸钢件铸造公司,不锈钢精密铸造,精密铸造工艺,宁波铸造等。

  24. 铸造 Says:

    中国铸造网提供铸造信息,铸造标准,铸造工艺,不锈钢铸件,压铸件,铝铸件,铜铸件,铝浇铸,离心浇铸,离心浇铸机,浇铸模具,精密铸造公司,大型铸钢件铸造公司,不锈钢精密铸造,精密铸造工艺,宁波铸造等。

  25. ビジネスローン Says:

    ビジネスローンの湊屋商事では、無担保ビジネスローン、そして診療報酬担保ローンといった、多彩なサービスをご用意しています。

  26. &#19981;&#21205;&#29987;&#25237;&#36039; Says:

    資金を増やそうとするのに不動産投資をするのが手っ取り早い。日本で不動産で収益物件をさがすのはきわめて難しくシステム開発は日本の会社が良い。

  27. webマーケティング Says:

    異性との関係において「ひょっとして家庭教師 東京オレのこと好きなのかな?」 「これ、いけちゃうんじゃない?」と思うときを聞いた今回のランキング。 1位に選ばれたのは《「一緒に帰ろっ」失恋と言われる》でした。 声をかけた女性にしてみれば「帰る方向がいっしょだし、 途中まで……」程度なのかもしれませんが、声をかけられた男性は、「 この時間に席が取れるレストランはあったかな」webマーケティングと食事の予定を考えはじめたり、 「靴下に穴が開いていたら彼女の家にお邪魔した時にマズいな」とあらぬ方向に妄想をナンパ膨らませたりと大忙しです。

Leave a Reply