Its all about Ruby On Rails
ruby-script
Ruby script to install bulk gems
Dec 8th
Recently I had to setup many rails servers and for that I had to install some gems again and again by issuing traditional “gem install xyz” command several times. This was actually very annoying.
To avoid issuing “gem install xyz” command again and again, while setting up new machine, I wrote a utility script in ruby. This script read a list of gems and install them by avoiding ri and rdoc installation for gem.
This script saved lots of my time. Here is the Ruby script to install bulk gems, if you would like to give it a try.
Download this script and save as .rb. Run this script by “ruby install_gems.rb” and follow the instructions on screen.
Ruby Script for SVN commit notification with log message, list of updated files and readable colored SVN Diff
Jan 14th
Some days ago I wrote a post about “SVN commit notification” which uses a perl script for sending commit notification with svn diff by mail. In this mail you can find svn diff from the last committed revision. I used to love this mail, soon I realized that it is a bit ugly and difficult to read. Also there were some important information missing. Like the name of user committing the code, the log message etc…
And then I started writing my own ruby script for same purpose but with some addition and modification. Commit Notification Script is that script, you can download and configure it with your SVN post commit hook as follows.
Add following line at the bottom of your post-commit file:
/usr/bin/ruby /var/www/repositories/project/hooks/commit-email.rb "$1" "$2"
* Please remember to change the path of you commit-email ruby script.
Now open commit-email ruby file and modify the following section according to your requirement:
# You can edit below
# Subject prefix
sub = "[test_project@vinsol]" # A project 'test_project' is maitained at vinsol
#list of users who will recieve commit notification
recipients = ["bansalakhil30.10@gmail.com", "akhil@vinsol.com"]
# email which will appear in from email field
from_user = "svn-notify@somedomain.com"
# your smtp settings here
ActionMailer::Base.smtp_settings = { :address => 'localhost', :port => 25, :domain => 'domain.com'}
# Do not edit below this line
You are done with that, now onwards whenever someone commits the code, you’ll get the commit notification mail like:
Ruby script for creating new rails project and initial SVN import (with ignoring/removing log/other files)
Feb 8th
Some days go I wrote a bash script for creating new rails project and initial SVN import (with ignoring/removing log/other files). And I received many comments if I could write a ruby script for this stuff. Hence here is the ruby script for creating new rails project and initial SVN import (with ignoring/removing log/other files). Copy this script to any of your directory as “create_rails_with_subversion.rb” and execute by issuing “ruby create_rails_with_subversion.rb ”
You may need command line subversion for windows.
I have tested it at my windows and linux machine, if it not work for you please let me know.
Also I love to have your comments….
