Ramaze

4,299 views
4,175 views

Published on

Proudcloud Talks presentation

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,299
On SlideShare
0
From Embeds
0
Number of Embeds
1,536
Actions
Shares
0
Downloads
9
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Ramaze

  1. 1. RamazeAlternative Ruby Framework(ra-ma-ze)<br />andrei@proudcloud.net<br />
  2. 2. My Background<br />Used Ramaze in 2009 as an alternative to Rails<br />Heterogenous team of developers<br />Some ruby first-timers<br />Problems/resistance with Rails conventions<br />Built a production app serving 10k+ users<br />
  3. 3. Ramaze<br />Simple, light, modular web framework<br />MVC<br />Agnostic<br />Database/ORM (no default)<br />Templating (default Etanni)<br />Based off of Nitro<br />No set structure<br />prototypes<br />Dependency: Rack<br />
  4. 4. Installation<br />http://github.com/ramaze/ramaze<br />Maintained by 4 guys<br />gem install ramaze<br />Innate<br />Core<br />RamazeInnate  Rack<br />Innate = Sinatra, Ramaze = Padrino<br />
  5. 5. Hello World<br />Listing 1: hello.rb<br />Simple. One file(4kb) vs Rails (900kb).<br />
  6. 6. Run<br />ramaze start<br />ruby hello.rb<br />thin start<br />Pow, Passenger, Mongrel etc<br />Rack based<br />
  7. 7. POLS<br />Principle of Least Surprise<br />Law of Least Astonishment<br />It should work because I made it work<br />No “magic”<br />
  8. 8. Freedom<br />No set structure for organizing your files<br />Flexible<br />BUT: Could lead to messed up code<br />Use what makes most sense to you (and your team)<br />Sensible defaults<br />Prototypes<br />ramaze create project<br />
  9. 9. Views<br />Listing 2: view/index.rhtml (using Erubis) <br />By default Ramaze looks for the template in the path called ‘view’, but can be<br />overriden via setting Ramaze.options.views = ‘view_path’<br />Add @message in controller<br />You could also add inline views in your really wanted to.<br />
  10. 10. Models<br />Use any ORM<br />Sequel<br />Active Record<br />Standalone classes<br />
  11. 11. Models (cont.)<br />Simple Model: in hello.rb<br />*Modify controller to use this<br />
  12. 12. Organizing your code<br />Use prototype<br />Allows opportunity to refactor and build our code as we go along<br />Ex:<br />Remove model and controller from hello.rb into separate files<br />Ramaze.acquire – broken in 1.9.2 as of 5/2011 <br />
  13. 13. Routing<br />controllers/another_controller.rb<br />Looks for views in ‘view/bye/’ view_path/route_name<br />
  14. 14. Routing (cont.)<br />You can also specify routes via configuration<br />regex routes<br />
  15. 15. Other Stuff<br />Layouts<br />Placed in view path<br />Just call layout ‘layout_name’ in controller to set<br />Helpers<br />paginate<br />user<br />flash<br />https://github.com/Ramaze/ramaze/tree/master/lib/ramaze/helper<br />Middlewares<br />
  16. 16. Great things about Ramaze<br />Low memory usage<br />Cheaper than Rails<br />Uses 60% less memory vsPadrino<br />Freedom<br />Simple codebase<br />Focus on Ruby, rather than the framework<br />
  17. 17. Cons<br />Outdated documentation<br />Slightly slower compared to Padrino<br />Can’t use Rails specific gems<br />You can but with slightly more work<br />
  18. 18. Still Great Things<br />Good community<br />Freenode #ramaze<br />Google groups<br />Know exactly what your code does<br />Know where to place/find your code (because you organized it)<br />
  19. 19. Conclusion<br />Great to use for smallish projects<br />When server memory is an issue<br />Great way to help transition developers from other technologies who are used to their “own way of doing things”<br />Let’s you focus on Ruby<br />Good alternative to Rails, use it when you are sick of Rails<br />In the end, Ramaze, Rails, Sinatra are tools: It’s what’s in your heart that counts, use frameworks that make you happy.<br />
  20. 20. END<br />Questions?<br />

×