In these tutorial, I am going discuss how Bundler works in a Rails application.
What is bundler?
Bundler is a gem for managing dependencies of Ruby (and Rails) applications. While using RVM, Bundler is always installed in global gemset. For example, on my machine, bundler is installed inside folder /home/sanjiv/.rvm/gems/ruby-2.0.0-p247@global/gems/. Usually common gems are installed in @global gemset as they may be required into multiple applications. Now, lets see what’s inside the bundler binary.
What is Signal.trap?
Operating systems send various signals to running processes. Some signals can be trapped by code. In the code above, Signal.trap catches the “Interrupt” signal when the user presses Ctrl-c to stop the process. It then exits the bundler with an exit status of 1. Here is the list of signals that can by caught by the trap function.
When we require ‘bundler’, the lib/bundler.rb inside bundler gem get loaded and a lot of modules…
View original post 623 more words