Alex Girard home in English en Francais

This weekend, I wanted to experiement a bit more with merb-slices, and thought it would be a good idea to use it to manage some of the gems I’ve created. It include few advantages:

I’ve tested the migration with rfeedfinder, a gem to discover feed url from any webpage. In a few easy steps, I migrated the gem into a slice:

  1. Create a slice: merb-gen slice rfeedfinder-slice
  2. Copy te class you need from your gem lib in a new file inside lib/rfeedfinder-slice/ directory. Enclose it inside ‘module RfeedfinderSlice … end
  3. In lib/rfeedfinder-slice.rb, add your gem dependencies at the end of the file
  4. Don’t forget to include your lib file into the dependencies
  5. To install the gem on your system, nothing easier than: sudo rake install

I’ll let you see the web interface, all the routes are already configure, you just need to add a form, and get fancy if you want to use the slice as a proper merb-slice to be included in a complete merb app. Then you can use it in a ruby script, or in other rails/merb applications:

See the end result on github: rfeedfinder-slice

blog comments powered by Disqus