Posts Tagged datamapper

Get on Merb Edge pre 1.0

Merb 1.0 is almost ready to be pushed out and you might be impatient to start playing with some of the goodies not yet available in the latest stable release. Before getting started, you should know that not everything has been ironed out yet so don’t expect to have a fully stable Edge.

The easiest way to get started requires that you have git installed as well as a gem called thor.

I let you take care of installing git on your machine, Ruby dev without git became quite challenging since GitHub started ruling the Ruby OSS world.

sudo gem install wycats-thor -s http://gems.github.com
Hops, used primarily as a flavoring and stability agent in beer, and also in other beverages and in herbal medicine.

Hops, used primarily as a flavoring and stability agent in beer, and also in other beverages and in herbal medicine.

Thor is a sort if mix between rake, sake with a better argument parser and based on Ruby classes.

Thor on its own won’t be very helpful, we need some thor tasks.

Create a folder where you want to store Merb’s source code and cd in it.

Once there download the latest merb thor tasks:

curl -L http://merbivore.com/merb.thor > merb.thor

You can now look at the available task by doing

thor -T

Read the rest of this entry »

, , ,

6 Comments

Write your own custom DataMapper adapter

If you read this blog, you probably know that Merb‘s best ORM friend is DataMapper.

compounds in basil oil have potent antioxidant and is used for supplementary treatment of stress

compounds in basil oil have potent antioxidant and is used for supplementary treatment of stress

Merb works very well with ActiveRecord and Sequel but most of the Merbivores get excited about DataMapper.

DataMapper has a lot of cool stuff going for it. I’m planning on writingi few articles about what I particularily like with DM and some of the misconceptions.

I’m going to give a talk about DataMapper during MerbCamp and something I want to cover is the fact that you can write DM adapters for virtually anything. From an adapter for couchdb (available in dm-more) to an adapter for SalesForce API. That’s the kind of stuff that gets me excited, a bit like what Ambition does but built-in in DM.

So, I decided to take some advise from Yehuda and dkubb and wrote my own adapter for Google Video. I had just finished a gem to retrieve google videos for a given google user and thought it would be a perfect exercise to mix a http-scraper with a DM adapter.

Read the rest of this entry »

, , ,

6 Comments

merbist scrapbook (sept-25)

Fennel, one of the primary ingredients of absinthe helps developers creativity.

Fennel, one of the primary ingredients of absinthe helps developers' creativity.

  • Good news regarding Merb slices: the new router allows you to mount a slice directly as: /the-slice-action (previously it had to be /the-slice/something)
  • On IRC, Nagash came up with an interesing snippet allowing you to easily serve static views (like Django’s generic views) (Merb::Template.template_for is PRIVATE so use it at your own risk) The Core team is investigating simpler/cleaner ways of achieving the same result and a built-in solution should be available in Merb 1.1
  • Merb 0.9.8 will be optimized for Ruby Enterprise Edition and will be supporting a new way of handling gems without wasting so much memory. (more news coming up soon)
  • Merb 0.9.8 has a new efficient way of dealing with clusters (more news coming soon)
  • Merb’s new caching system will make it to 1.0
  • Merb is going into a feature freeze and the team will focus solely on bug fixes and making the Merb experience more pleasant.
  • A turn key deployment solution is planned for Merb 1.x (deployment recipes plugin)
  • DataMapper benchmarks show it’s now way faster than ActiveRecord (on average) Benchmark scripts available in the dm-core repo.

, , , ,

No Comments