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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edb6b44ba23dd1481ffbf6f258d045199811e0c4
4
- data.tar.gz: 2f2146e0d6badc1744de2c4eaf1c087285b90146
3
+ metadata.gz: c041fd887390fe14c2105874c29871320872be44
4
+ data.tar.gz: 255a4728ff3a6e9afd5b37abdc636f69176c6b1e
5
5
  SHA512:
6
- metadata.gz: 5de60ad7830b232f1e5e0bcae0f12481320ca0737296e63cb84e3cd4d40b9ea9f142ee2390af1601d6d02fdf284df13cf76a263384ad82836fd90ad06e093529
7
- data.tar.gz: 76dd7644a760d64eec0291f49cc1009cfd077e6d3e2bb2bf681924060fd44b3a89c82d106d9a27c1ad6b8b8ea89be2454494190aa801b9c30ed8ba5edd83bf26
6
+ metadata.gz: 920346ed6d820f7ec4d85f9876498a92a98cae168749ef55cb1b7c2a8ad07c1cc897276e4a6bb3f775791e4b52355c398f7ee5798e5b9c04cef5b5f6d61a2b64
7
+ data.tar.gz: d7fd5fae927d359a8763bf79557161c688833b4a1fe2f7356a18d1bdbdd13e7c9d76bc2e4dc2d2318d39f0ebbd009592a5d43de94eded447103702d17d4624ba
data/CHANGES.md CHANGED
@@ -1,6 +1,10 @@
1
+ # 0.0.6
2
+
3
+ * Fix `Version#>=` partially.
4
+
1
5
  # 0.0.5
2
6
 
3
- Add `Uber::Version` for simple gem version deciders.
7
+ * Add `Uber::Version` for simple gem version deciders.
4
8
 
5
9
  # 0.0.4
6
10
 
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
- When writing gems against other gems involves checking for versions and loading appropriate version strategies (e.g. "is Rails >= 4.0?". Uber gives you `Version` for easy, semantic version deciders.
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 `>=` and `~`.
144
+ The API currently gives you `#>=` and `#~`.
145
145
 
146
146
  ```ruby
147
147
  version >= "1.1" #=> true
@@ -1,3 +1,3 @@
1
1
  module Uber
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -12,7 +12,8 @@ module Uber
12
12
  def >=(version)
13
13
  major, minor, patch = parse(version)
14
14
 
15
- self[:major] >= major and self[:minor] >= minor and self[:patch] >= patch
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)
@@ -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 }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer