1 |
Stuart Herbert wrote: |
2 |
> Hrm ... all the code I've seen uses: |
3 |
> |
4 |
> require_gem "<package-name>" |
5 |
> |
6 |
> with no sign of version requirements passed around. How does Gems |
7 |
> handle the versioning in the background? |
8 |
> |
9 |
> Best regards, |
10 |
> Stu |
11 |
> |
12 |
That code is implicitly saying "use the latest version of |
13 |
<package-name>". However, Gems also lets you say: |
14 |
|
15 |
require_gem '<package-name>', '>= 1.1.5' |
16 |
|
17 |
One of the most useful things you can do is say: '~> 1.1' |
18 |
|
19 |
This means, use the version closest to 1.1, but I don't care which minor |
20 |
revision you use. This will allow you to pick up new minor revisions |
21 |
that contain, for instance, a security patch, but not major revisions |
22 |
that might change the API. |
23 |
|
24 |
For more info see here: http://docs.rubygems.org/read/chapter/16 |
25 |
|
26 |
Another thing that is great about Gems is that you can stand up a gem |
27 |
server and serve your own versions of any required libraries. All a user |
28 |
would have to do is point at your gem server, and they could use your |
29 |
version. This is analogous to having your own rsync server. |
30 |
-- |
31 |
gentoo-web-user@g.o mailing list |