Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gem dependencies versions meaning

Tags:

version

ruby

gem

Gem dependency version can be specified with prefixes =, <, >, <=, >= and ~>. I understand all except last one, what does ~> mean?

like image 979
tig Avatar asked Aug 16 '10 11:08

tig


1 Answers

The ~> operator means: match within the same version, depending on how specific you want it to be, here's some examples:

 Specification From  ... To (exclusive)
  ">= 3.0"      3.0   ... &infin;
  "~> 3.0"      3.0   ... 4.0
  "~> 3.0.0"    3.0.0 ... 3.1
  "~> 3.5"      3.5   ... 4.0
  "~> 3.5.0"    3.5.0 ... 3.6

Source

like image 54
Lolindrath Avatar answered Oct 22 '22 04:10

Lolindrath