Reinstalling list of GEMs on a new server

#!/usr/bin/perl -w # We’re strict use strict; # Get list of installed gems my @gems = qx(gem list); chomp(@gems); # Create commands foreach my $gem (@gems) {     # Match gem and versions     $gem =~ m/(S+)s((.+))/i;     # Gem name     $gem = $1;     # Save them into array      my @gem_versions = split(/,/, $2);     # Print out commands […]

Export to Excel in Rails: to_xls Plugin

This gem transform an Array into a excel file using the spreadsheet gem. Usage @users = User.all @users.to_xls @users.to_xls(:headers => false) @users.to_xls(:columns => [:name, :role]) @users.to_xls(:columns => [:name, {:company => [:name, :address]}]) @users.to_xls(:columns => [:name, {:company => [:name, :address]}], :headers => [:name, :company, :address]) In order to send a file from the controller, you can […]