you are here: codestackercodes [RSS] → tag gem [RSS]

hirb example

to install:
gem install cldwalker-hirb --source http://gems.github.com

>> require 'hirb'
=> []
>> Hirb.enable
=> nil
>> Exam.find(:all, :limit => 5)
+----+----------+----------+----------+----------+---------+----------+------+
| id | title    | exam     | creat... | updat... | user_id | categ... | hits |
+----+----------+----------+----------+----------+---------+----------+------+
| 1  | Simul... | Simul... | 2009-... | 2009-... | 1       | 1        | 152  |
| 2  | Simul... | Simul... | 2009-... | 2009-... | 1       | 1        | 143  |
| 3  | Espec... | Espec... | 2009-... | 2009-... | 1       | 1        | 1089 |
| 4  | Espec... | Espec... | 2009-... | 2009-... | 1       | 1        | 80   |
| 5  | Espec... | Espec... | 2009-... | 2009-... | 1       | 1        | 40   |
+----+----------+----------+----------+----------+---------+----------+------+
5 rows in set
>>

Google::Translate, A Simple API In Ruby

install:
sudo gem install google_translate

require 'rubygems'
require 'google_translate'

tr = Google::Translate.new

# from English to Spanish

tr.translate :from => "en", :to => "es", :text => "Hello, World!"
 => Hola, Mundo!

all cheats avaliable

for install: sudo gem install cheat
+ info: http://cheat.errtheblog.com/

cheat sheets

gem cheat

http://cheat.errtheblog.com/

sudo gem install cheat

gem guide

http://docs.rubygems.org/read/book/2

gem outdated # give list of gems which are outdate

gem list # list of all gems in the system with thier version number.if there was 2 version then it would give them in descending order

gem cleanup # clean the older version when there are 2 version available

gem dependency rails # list all the dependencies for a gem

gem install rails –no-rdoc # skips documentation

gem server # run in localhost:8808 rdoc documentation

gem query --remote --name-matches rails # find a gem

gem sources # list repositories

find a gem to install

gem query --remote --name-matches rails
Displaying all 6 Code