Project

add_gem

0.0
No commit activity in last 3 years
No release in over 3 years
"Command-line tool to append new gems to your Gemfile."
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 10.3.2
 Project Readme

AddGem

Command-line tool to append new gems to your Gemfile with pessimistic version constrain.

Problem

When adding a new gem to my Gemfile I found myself visiting http://rubygems.org/gems/GEM_NAME and checking the latest version.

I like to use pessimistic version constrain to avoid headaches. I have seen projects getting broken because major version updates, and people wasting their time trying to figure it out what it was.

I built this tool which receives the name of the gem and then adds a new entry to your Gemfile including the version with the pessimistic operator (~>).

$ cat Gemfile
source 'https://rubygems.org'

$ add_gem rails
$ Added gem "rails", "~> 3.2.8" to your Gemfile.

$ cat Gemfile
source 'https://rubygems.org'
gem "rails", "~> 3.2.8"

What's wrong with gem search rails -r you might be thinking? the answer is nothing, but why do something in more than one step when it can be done in one. :)

Usage

Install with rubygems:

gem install add_gem

And then execute on your working directory:

$ add_gem rails
$ Added gem "rails", "~> 3.2.8" to your Gemfile.

TODO

  • Take as parameter a group and then add the gem under the given group.