Notifications of updates is something that works quite well already with desktop and mobile applications, specially in the Apple environment. I always wondered if we could have something similar for Gems.

After seeing a tweet from a friend raising the same question, and while having some spare time to hack on it, I decided to tackle and make something.

So I came up with Gem Attack!, a Sinatra application that allows developers to create Gem update notifications.

The workflow simplest as possible:

  1. Go to Gem Attack!
  2. Sign up with your GitHub account
  3. Create a project hold the notifications
  4. Create the notifications
  5. Add the 5 lines snippet to your Gem

And that’s it, you’re done. Now users will get notifications whenever they require your gem.

The snippet doesn’t add any new dependency to your gem.

By the way, although I’ve come up only with a Ruby snippet, it can be used in any project using any language. If you came up with a snippet for any other language, let me know in the comments or anywhere else and I’ll add it to to the application.

The Sinatra code is open-source and lives in Gem Attack! GitHub repository.

Mongoid Search: Full text search for your mongoid models

If you are using Mongoid in your projects, probably you’ve already came across a situation where you need to do some kind of searching. Mongoid Search is a simple full text search implementation for Mongoid ORM.


In your Gemfile:

source ''

gem 'mongoid_search'


bundle install



class Product
  include Mongoid::Document
  include Mongoid::Search
  field :brand
  field :name

  references_many :tags

  search_in :brand, :name, :tags => :name

class Tag
  include Mongoid::Document
  field :name

  referenced_in :product

Now when you save a product, you get a _keywords field automatically:

p = :brand => "Apple", :name => "iPhone"
p.tags << => "Amazing")
p.tags << => "Awesome")
p.tags << => "Superb")
=> true
=> ["apple", "iphone", "amazing", "awesome", "superb"]

Now you can run search, which will look in the _keywords field and return all matching results:"apple iphone").size
=> 1

Note that the search is case insensitive, and accept partial searching too:"ipho").size
=> 1



:match :any – match any occurrence :all – match all ocurrences Default is :any.

search_in :brand, :name, { :tags => :name }, { :match => :any }"apple motorola").size
=> 1

search_in :brand, :name, { :tags =>> :name }, { :match => :all }"apple motorola").size
=> 0



If you want to contribute, found any bug or have any suggestions, this is the github page of the project: