How does a satellite work?

This question relates to ligaments, rubigems, and how it determines which method I call. It's quite a long time, so please bear with me.

According to my understanding, Bundler is a dependency management tool for managing ruby ​​gemstones. He sets all the gems and their dependencies listed in Gemfile.

The question I want to ask can be best illustrated with an example. so here -> In my rails application, I do this in my controller: -

module SurveyorControllerCustomMethods
  def create
    super
  end
end
class SurveyorController < ApplicationController
   include Surveyor::SurveyorControllerMethods
end

Here I do two things:

  • Turn on SurveyorControllerMethodsfrom Surveyor camcorder.
  • Since I used super here, it would call a method createfrom SurveyorControllerMethodsthat works fine, but I do not understand this.

and the gem is set to

$ bundle show surveyor
/home/gaurish/.rvm/gems/ruby-1.9.3-p194/gems/surveyor-0.22.0

ruby ​​$LOAD_PATH. :

  • ?
  • , ?
  • gems ex jquery-rails, / , jQuery JavaScript . , , ?
+5
1

, Rails . , Rails . [1]

boot.rb :

require 'bunder/setup'

application.rb :

Bundler.require(:default, :development)

Gemfile, , (:default :development ). , , gem, :require. Bundler , "-" "_".

Bundler , , () .

'bundler/setup' Bundler.setup, . (unshifts) $LOAD_PATH . , rubygems.

:

https://github.com/carlhuda/bundler/blob/master/lib/bundler/setup.rb https://github.com/carlhuda/bundler/blob/master/lib/bundler/runtime.rb

[1]: Rails, , , , , Bundler.require .

+2

All Articles