4 ms·
Here's why I love ramaze: multi-app, multi-db app, ~50 lines, one file, zero proprietary plugins, rake tasks, generators, etc. No bending of the framework whats
by ducktyped 18y ago
Here's why I love ramaze: multi-app, multi-db app, ~50 lines, one file, zero proprietary plugins, rake tasks, generators, etc. No bending of the framework whatsoever. Use require, use modules, pure ruby, pure joy. :)
require 'rubygems'
require 'ramaze'
require 'sequel'
# Models
module AppOne
DB = Sequel.sqlite('app_one.db')
class Post < Sequel::Model(DB[:posts])
set_schema do
primary_key :id
varchar :title
text :body
end
end
end
module AppTwo
DB = Sequel.sqlite('app_two.db')
class Post < Sequel::Model(DB[:posts])
set_schema do
primary_key :id
varchar :title
text :body
end
end
end
AppOne::Post.create_table!
AppTwo::Post.create_table!
AppOne::Post.create(:title => "app one title", :body => "app one body")
AppTwo::Post.create(:title => "app two title", :body => "app two body")
# Controllers
module AppOne
class MainController < Ramaze::Controller
map "/app_one"
def index
@post = Post[1]
"#{@post.title}<br/>#{@post.body}"
end
end
end
module AppTwo
class MainController < Ramaze::Controller
map "/app_two"
def index
@post = Post[1]
"#{@post.title}<br/>#{@post.body}"
end
end
end
Ramaze.start :adapter => :mongrel
Run, go to /app_one and /app_two respectively. Enjoy.
Here's some of what ramaze is missing:
* Some conventions (simple modules, no "plugins" please) and a space (website) to share code, such as rake tasks for sequel migrations, authentication boilerplate, etc. Ramaze needs an ecosystem of modules to allow developers to benefit from each other. I'm not a fan of cargo-culting, but rails/merb plugins do speed up development.
* Marketing/evangelism. (I'm trying).
* A more nicely integrated restful router with urls a la rails/merb conventions. While "technically" somewhat silly, all the cool kids want something like it.
- jhancock 18y agoThis is good stuff. I certainly hope frameworks like ramaze stick around and gain their own niche market share. For http://shellshadow.com http://shellshadow.com I had to make careful decisions about being able to eventually hire others to do the web app dev, which meant making sure my framework picks wouldn't be too obscure. I had to get away from Rails. In fact, if other frameworks like Merb, Ramaze, datamapper, and Sequel didn't show up, I would have had to dump ruby. I like Sequel http://sequel.rubyforge.org/ http://sequel.rubyforge.org/ quite a lot. It blazes new territory for an ORM. It was a tough call to go with datamapper. In short, Merb showed promise and I bet on the strength of its backers in addition to what I saw as solid software engineering.
- deleted 18y ago[deleted]
- jamongkad 18y agoWhile I did try out Ramaze a few months back. I had a hell of a time trying to setup the ORM. The documentation has a looong way to go compared to other frameworks. So far the best documentation I've ever had the pleasure of reading is CodeIgniter and Django. I would love to use Ramaze on future projects but unfortunately it's documentation needs work. [EDIT] I love how Sequal was designed to allow the developer to craft their data with a high degree of granularity compared to most ORM's that try to do too much magic behind the scenes.
- jamesbritt 18y ago"While I did try out Ramaze a few months back. I had a hell of a time trying to setup the ORM. The documentation has a looong way to go compared to other frameworks. So far the best documentation I've ever had the pleasure of reading is CodeIgniter and Django. I would love to use Ramaze on future projects but unfortunately it's documentation needs work." Ramaze does not have an ORM. While I see a trend towards using Sequel, it is not part of Ramaze, is not shipped with Ramaze, and so you will not find much docs about it on the Ramaze site.
- jamesbritt 18y ago"This is good stuff. I certainly hope frameworks like ramaze stick around and gain their own niche market share. ... I had to get away from Rails. In fact, if other frameworks like Merb, Ramaze, datamapper, and Sequel didn't show up, I would have had to dump ruby." It's a tough sell in the mainstream Ruby (ie. Rails-centric) community. For example, at MtWest RubyConf two years ago, Chad Fowler told the assembled crowd that people working on Nitro (arguably the forerunner of Ramaze, and an influence on other Ruby Web tools) to stop. Flat out stop working on it. "We don't need it; it's just like Rails." Which, of course, was simply untrue. (My take was that Nitro was to Rails as Ruby is to Python. Similar, but with enough differences to matter. Ramaze follows in that way. Ramaze is opinionated software that says your opinion matters ) Fortunately, people kept on with developing new Web frameworks (both Rails-like and not), but none have had the same level of hype and business backing as Rails. Merb gets some decent attention, perhaps because it's (sort of) Rails-lite or Rails-done-better. (I'm not trying to disparage Merb, just offer an idea on why it gets more traction than, say, Ramaze.) Seeing almost every 3rd-generation Ruby Web framework use Rack is encouraging, as is the continued lack of coupling to any particular ORM, and I expect to see even more loosely-coupled, easily assembled Web tools to come along. Good times.