uber 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -1
- data/README.md +2 -2
- data/lib/uber/uber_version.rb +1 -1
- data/lib/uber/version.rb +2 -1
- data/test/version_test.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c041fd887390fe14c2105874c29871320872be44
|
4
|
+
data.tar.gz: 255a4728ff3a6e9afd5b37abdc636f69176c6b1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 920346ed6d820f7ec4d85f9876498a92a98cae168749ef55cb1b7c2a8ad07c1cc897276e4a6bb3f775791e4b52355c398f7ee5798e5b9c04cef5b5f6d61a2b64
|
7
|
+
data.tar.gz: d7fd5fae927d359a8763bf79557161c688833b4a1fe2f7356a18d1bdbdd13e7c9d76bc2e4dc2d2318d39f0ebbd009592a5d43de94eded447103702d17d4624ba
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -135,13 +135,13 @@ Evaluating an options hash can be time-consuming. When `Options` contains static
|
|
135
135
|
|
136
136
|
# Version
|
137
137
|
|
138
|
-
|
138
|
+
Writing gems against other gems often involves checking for versions and loading appropriate version strategies - e.g. _"is Rails >= 4.0?"_. Uber gives you `Version` for easy, semantic version deciders.
|
139
139
|
|
140
140
|
```ruby
|
141
141
|
version = Uber::Version.new("1.2.3")
|
142
142
|
```
|
143
143
|
|
144
|
-
The API currently gives you
|
144
|
+
The API currently gives you `#>=` and `#~`.
|
145
145
|
|
146
146
|
```ruby
|
147
147
|
version >= "1.1" #=> true
|
data/lib/uber/uber_version.rb
CHANGED
data/lib/uber/version.rb
CHANGED
@@ -12,7 +12,8 @@ module Uber
|
|
12
12
|
def >=(version)
|
13
13
|
major, minor, patch = parse(version)
|
14
14
|
|
15
|
-
self[:major]
|
15
|
+
self[:major] > major or
|
16
|
+
(self[:major] == major and self[:minor] >= minor and self[:patch] >= patch)
|
16
17
|
end
|
17
18
|
|
18
19
|
def ~(*versions)
|
data/test/version_test.rb
CHANGED
@@ -13,6 +13,13 @@ class VersionTest < MiniTest::Spec
|
|
13
13
|
it { subject.~("1.0", "1.1", "1.2").must_equal true }
|
14
14
|
it { subject.~("1.2", "1.3").must_equal true }
|
15
15
|
|
16
|
+
it { (subject >= "1.2.4").must_equal false }
|
17
|
+
it { (subject >= "1.2.2").must_equal true }
|
18
|
+
it { (subject >= "0.3.1").must_equal true }
|
19
|
+
it { (subject >= "0.3.6").must_equal true }
|
20
|
+
it { (subject >= "0.3").must_equal true }
|
21
|
+
it { (subject >= "0.2.4").must_equal true }
|
22
|
+
it { (subject >= "0.2").must_equal true }
|
16
23
|
it { (subject >= "1.2").must_equal true }
|
17
24
|
it { (subject >= "1.1").must_equal true }
|
18
25
|
it { (subject >= "1.3").must_equal false }
|