, concat - . unshift . , , , . <<(), , :
["a", "b"].concat(["c", "d"]) #=> ["a", "b", "c", "d"]
["a", "b"].unshift("c").unshift("d") #=> ["d", "c", "a", "b"]
["a", "b"] << "c" << "d" #=> ["a", "b", "c", "d"]
lib:
File.expand_path("../../lib", __FILE__)
#=> "/home/foo/lib/" #Note this is a string!
$:., . :
$:.
#=> ["/usr/local/lib/site_ruby/1.9.1", "/usr/lib/ruby/1.9.1/i686-linux"]
, :
$:.unshift(File.expand_path("../../lib", __FILE__))
#=> ["/home/foo/lib", "/usr/local/lib/site_ruby/1.9.1", "/usr/lib/ruby/1.9.1/i686-linux"]
concat , [] , :
$:.concat([File.expand_path("../../lib", __FILE__)])
#=> ["/usr/local/lib/site_ruby/1.9.1", "/usr/lib/ruby/1.9.1/i686-linux", "/home/lib"]