ruby - Understanding the tilde operator in Gemfile.lock -
i have dependency of following
i18n (~> 0.6, >= 0.6.4)
i've been having read through of ruby gems - declaring dependency guide
and i've found out '~> 0.6' part means between 0.6 , 1.0 - correct me if that's wrong.
but i'm still confused, mean second comma separated value?
a colleague believes means
>= 0.6.4, <= 0.7
but i'm not sure.
short answer: pointed holger in comments, ~> 0.6, >= 0.6.4
means >= 0.6.4 , < 1.0
.
the ~>
operator called pessimistic operator (or twiddle-wakka), , objective guard gems potential bugs/failures in future releases.
when you're building gem, must create special specification class , put in .gemspec
file or in rakefile. class contains information gem, name, version, license , dependencies.
and practice specify dependencies following pessimistic version constraint. therefore, notations ~> 0.6, >= 0.6.4
common.
you can find more information here.
Comments
Post a Comment