Posts

Showing posts from February, 2012

Install Debugger in Ruby 1.9.3

Download newer versions linecache19-0.5.13.gem and ruby-debug-base19-0.11.26.gem from http://rubyforge.org/frs/?group_id=8883

$ gem install ~/Downloads/linecache19-0.5.13.gem -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p0 Building native extensions. This could take a while... Successfully installed linecache19-0.5.13 1 gem installed$ gem install ~/Downloads/ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p0 Building native extensions. This could take a while... Successfully installed ruby-debug-base19-0.11.26 1 gem installedAdd these in your gemfile

gem 'linecache19', '0.5.13' gem 'ruby-debug-base19' gem 'ruby-debug19', :require => 'ruby-debug'if this doesn't work try this

gem 'linecache19', '0.5.13', :path => "~/.rvm/gems/ruby-1.9.3-p0/gems/linecache19-0.5.13/" gem 'ruby-debug-base19', '0.11.26', :path => "~/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-base1…

Automating Tasks with Rake

Rake is available as the rake gem; if you've installed Rails, you already have it. Unlike most gems, it doesn't just install libraries: it installs a command-line program called rake, which contains the logic for actually performing Rake tasks.

A Rakefile is just a Ruby source file that has access to some special methods: task, file, directory, and a few others. Calling one of these methods defines a task, which can be run by the command-line rake  program, or called as a dependency by other tasks.

The most commonly used method is the generic one: task. This method takes the name of the task to define, and a code block that implements the task. Here's a simple Rakefile that defines two tasks, cross_bridge  and build_bridge, one of which depends on the other. It designates cross_bridge as the default task by defining a third task called default which does nothing except depend on cross_bridge.

# Rakefile

desc "Cross the bridge." task :cross_bridge => [:build_…

Stashing in Git

The Below are the basic commands along with there description
git stashgit stash save <optional-name> save your local modifications to a new stash (so you can for example
"git svn rebase" or "git pull")

git stash apply restore the changes recorded in the stash on top of the current working tree
state

git stash pop restore the changes from the most recent stash, and remove it from the stack
of stashed changes

git stash list list all current stashes

git stash show <stash-name> -p show the contents of a stash - accepts all diff args

git stash drop [<stash-name>] delete the stash

git stash clear delete all current stashes