Quantcast
Channel: What does the "$" character mean in Ruby? - Stack Overflow
Viewing all articles
Browse latest Browse all 6

What does the "$" character mean in Ruby?

$
0
0

Been playing with Ruby on Rails for awhile and decided to take a look through the actual source. Grabbed the repo from GitHub and started looking around. Came across some code that I am not sure what it does or what it references.

I saw this code in actionmailer/test/abstract_unit.rb

root = File.expand_path('../../..', __FILE__) begin require "#{root}/vendor/gems/environment" rescue LoadError $:.unshift("#{root}/activesupport/lib") $:.unshift("#{root}/actionpack/lib")endlib = File.expand_path("#{File.dirname(__FILE__)}/../lib")$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)require 'rubygems'require 'test/unit'require 'action_mailer'require 'action_mailer/test_case'

Can someone tell me what the $: (a.k.a. "the bling") is referencing?


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>