Wednesday, November 30, 2011

Gem Versioning

Within Gemfile you can constrain which version or versions of a gem your application is dependent upon.

Any gem inclusion without a version number indicates 'latest' version of gem should be used.

Specifying a gem as such:

gen 'foo', '=3.0'

indicates a specific version must be used.

Specifying a gem as such

gem 'foo', '>= 3.0'

indicates a version >= 3.0 is suitable. In general, you get what you expect from

= Equals version
!= Not equal to version
> Greater than version
< Less than version
>= Greater than or equal to
<= Less than or equal to

Gem versions can also be specified with the 'approximately greater than' operator. This operator increment final digit of a version up until next significant digit would turn over. So, a gem specification of

gem 'foo', '~> 3.1'

is satisfied with any version from 3.1 up to 3.9. inclusive. If three digits are specified in a version number used with ~> operator, as below

gem 'foo', '~> 3.1.1'

then the gem versions compatible with the application are 3.1.1 through 3.1.9, inclusive.

Autocomplete Details

https://github.com/crowdint/rails3-jquery-autocomplete