Monday, November 8, 2010
How to: write rcov test
You can use it in any of your projects and check your test effectiveness.
First install the gem
$gem install rcov
Next generate the rcov documents like below
$rcov -I lib spec/*.rb --exclude ^spec,/gems/ -T --no-html
The above parameters tell rcov to include lib directory as well as all files inside spec dir and exclude all the gems.
Also, it displays the output in terminal and doesn't generate the html file. You can take the --no-html flag off if you like an interactive html view which is inside the coverage folder.
You can achieve the same with rake task also like below:
Include the 'rcov_custom' file in the rake file.
# In Rake
require File.expand_path(File.dirname(__FILE__) + '/lib/tasks/rcov_custom')
Next you write the following in the file.
# rcov_test.rb
desc "Custom rcov"
RSpec::Core::RakeTask.new(:rcov_custom) do |t|
t.rcov = true
t.rcov_opts = %w{--exclude gems\/,spec\/ -T}
end
In terminal, check the rake tasks.
$Rake -T
You should see a custom rake task named 'Custom rcov'.
Finally, generate the rcov test whenever you feel like with the rake command.
$rake rcov_custom
Hope your code is 100% covered up by your test. :)
Wednesday, September 1, 2010
mySysGit and Pik -- Git and RVM for Windows
1) mySysGit - Git for Windows:
Git is almost inseparable from Rails as they both go hand in hand. The Rails development process suddenly becomes professional, managed and easy with Git. To get it working on windows, we need a windows version of Git i.e. mySysGit.
Watch the video below on installing and using Git On Windows from gitcasts.com then just download and install mySysGit from http://code.google.com/p/msysgit/downloads/list.
2) Pik – RVM for Windows:
If you would like to manage multiple versions of ruby on windows, just download the latest pik-0.2.8.msi from http://github.com/vertiginous/pik/downloads and install it.
Pik is an excellent windows tool by Gordon Thiesfeld in the place of Ruby Version Manager (RVM). You can find more about pik on Github at http://github.com/vertiginous/pik and try installing ree and ruby 1.8.7 along with 1.9.2 with ‘pik add’ command.
>pik add C:\ruby\IronRuby-091\bin
Adding: 091: IronRuby 0.9.1.0 on .NET 2.0.0.0
Located at: C:/ruby/IronRuby-091/bin
If pik is not working, you may need to add path to your installed directory in Windows enviroment by following this guide. Assuming, the directory C:\bin is in my path:
path
PATH=c:\bin;c:\ruby\Ruby-186-p383\bin;
Tuesday, August 31, 2010
Cut & Paste in Mac OS X
As recently, I started working with Mac and at once realized that a simple functionality was missing in the Snow Leopard OS X Finder, and that’s Cut & Paste. With googling I found this app, moveAddict which solves this basic problem for free. This means you no longer have the hassle to arrange the two windows and drag n’ drop the item to accomplish the feat.
moveAddict provides a systemwide menu, Finder-window toolbar buttons, and customizable keyboard shortcuts for cutting and pasting files—along with a few useful extras.
MoveAddict provides cut and paste commands in the menu bar (left) and in Finder-window toolbars (right); you can also use keyboard shortcuts.
Features:
- It works with the usual keyboard shortcuts for cut and paste (cmd-x/cmd-v) as default.
- A notification window and Finder file labels provide user-friendly feedback at every stage.
- Original data remains untouched until the move gets safely registered by the Finder.
- moveAddict does not modify the Mac system in any way, it is just a small (5 MB) application.
- Hide moveAddict’s icon which will only show again when you cut a file.
The free version can only move one item at a time and doesnot have the feature of merging folders priced $4.99.
Monday, August 30, 2010
Ruby on Rails on Windows
Steps:
Thursday, June 10, 2010
FIFA World Cup 2010 Schedule in Nepali Standard Time
FIFA 2010 World Cup Venues
Image | City | Stadium | Capacity |
---|---|---|---|
Johannesburg | Soccer City | 91,141 | |
Durban | Moses Mabhida Stadium | 70,000 | |
Cape Town | Cape Town Stadium | 69,070 | |
Johannesburg | Ellis Park Stadium | 62,567 | |
Pretoria | Loftus Versfeld Stadium | 51,760 | |
Port Elizabeth | Nelson Mandela Bay Stadium | 48,000 | |
Bloemfontein | Free State Stadium | 48,000 | |
Polokwane | Peter Mokaba Stadium | 46,000 | |
Rustenburg | Royal Bafokeng Stadium | 44,530 | |
Nelspruit | Mbombela Stadium | 43,589 |
Hope you catch the flu... and may Argentina win..
(Source: wikipedia.org, fifa.com, soccerinnepal.blogspot, ktm2day)
Sunday, March 21, 2010
Register for Visual Studio 2010 Beta Exams for Free
source: http://blogs.msdn.com/gerryo/archive/2010/03/17/register-for-visual-studio-2010-beta-exams.aspxYou are invited to take part in one or more beta exams for Visual Studio 2010 and the Microsoft .NET Framework 4.
If you pass one of the beta exams, the exam credit will be added to your transcript and you will not need to take the exam in its released form. The 71-xxx identifier is used for registering for beta versions of MCP exams, when the exam is released in its final form the 70-xxx identifier is used for registration.
By participating in beta exams, you have the opportunity to provide the Microsoft Certification program with feedback about exam content, which is integral to development of exams in their released version. We depend on the contributions of experienced IT professionals and developers as we continually improve exam content and maintain the value of Microsoft certifications. The following exams are a part of this beta offering.
Exam 71-511, TS: Windows Applications Development with Microsoft .NET Framework 4
Exam 71-515, TS: Web Applications Development with Microsoft .NET Framework 4
Exam 71-513: TS: Windows Communication Foundation Development with Microsoft .NET Framework 4
Exam 71-516: TS: Accessing Data with Microsoft .NET Framework 4
Exam 71-518: Pro: Designing and Developing Windows Applications Using Microsoft .NET Framework 4
Exam 71-519: Pro: Designing and Developing Web Applications Using Microsoft .NET Framework 4
Availability
Registration begins: March 17, 2010
Beta exam period runs: April 5, 2010 – April 30, 2010
Receiving this invitation does not guarantee you a seat in the beta; we recommend that you register as soon as registration opens. Beta exams have limited availability and are operated under a first-come-first-served basis. Once all beta slots are filled, no additional seats will be offered. If you register, please ensure you are committed to attend.
Testing is held at Prometric testing centers worldwide, although this exam may not be available in all countries (see Regional Restrictions). All testing centers will have the capability to offer this exam in its live version.
Regional Restrictions: India, Pakistan, China
Registration Information
You must register at least 24 hours prior to taking the exam.
Please use the following promotional codes when registering for your chosen exam(s):
To register in North America, please call:
Exam Number Beta Code 71-511 511BC 71-515 515AA 71-513 513CD 71-516 516B1 71-518 518PE 71-519 519ZS
Outside the U.S./Canada, please contact:
• Prometric: (800) 755-EXAM (800-755-3926)
• Prometric: http://www.register.prometric.com/ClientInformation.asp
Test Information and Support
You are invited to take this beta exam at no charge.
You will be given four hours to complete the beta exam. Please plan accordingly.
Find exam preparation information:
Exam 70-511, TS: Windows Applications Development with Microsoft .NET Framework 4
Exam 70-515, TS: Web Applications Development with Microsoft .NET Framework 4
Exam 70-513: TS: Windows Communication Foundation Development with Microsoft .NET Framework 4
Exam 70-516: TS: Accessing Data with Microsoft .NET Framework 4
Exam 70-518: Pro: Designing and Developing Windows Applications Using Microsoft .NET Framework 4
Exam 70-519: Pro: Designing and Developing Web Applications Using Microsoft .NET Framework 4
Frequently Asked Questions
For Microsoft Certified Professional (MCP) help and information, you may log in to the MCP Web site at http://www.microsoft.com/learning/mcp/or contact your Regional Service Center: http://www.microsoft.com/learning/support/worldsites.asp.