liferaft 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -1
- data/lib/liferaft/gem_version.rb +1 -1
- data/lib/liferaft/version.rb +17 -0
- data/spec/comparison_spec.rb +20 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7326123507d7f8865f08559e3b30e8fbb8b7ed74
|
4
|
+
data.tar.gz: 1e27c01b8edeb60f87d8df604645b2d7ecfd990a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc7a98f75072cb4541a4c04642e559c289bf28eb44586c5bed6b1ee4471a1c09739cfd59191b0b9d700afd7831d0592114398c6f853a3027a40f4ef3aa48704b
|
7
|
+
data.tar.gz: f9640d871571aab359dbefcf73892c6ebc2ade105d045f123e516b6ac5f0ffffe4abbb8f5b04ec02bd54814196c2966595fcca4956286bdd319f753db9535767
|
data/Rakefile
CHANGED
data/lib/liferaft/gem_version.rb
CHANGED
data/lib/liferaft/version.rb
CHANGED
@@ -16,5 +16,22 @@ module Liferaft
|
|
16
16
|
@patch = components[1].to_i / 1000
|
17
17
|
@build = components[1].to_i % 1000
|
18
18
|
end
|
19
|
+
|
20
|
+
def >(other)
|
21
|
+
other < self
|
22
|
+
end
|
23
|
+
|
24
|
+
def <(other)
|
25
|
+
return true if major < other.major
|
26
|
+
return true if minor < other.minor
|
27
|
+
return true if patch < other.patch
|
28
|
+
build < other.build
|
29
|
+
end
|
30
|
+
|
31
|
+
def ==(other)
|
32
|
+
other.instance_of?(self.class) &&
|
33
|
+
major == other.major && minor == other.minor &&
|
34
|
+
patch == other.patch && build == other.build
|
35
|
+
end
|
19
36
|
end
|
20
37
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
module Liferaft
|
4
|
+
describe Version do
|
5
|
+
it 'compares 6D570 and 6D1002 correctly' do
|
6
|
+
v1 = Version.new('6D570')
|
7
|
+
v2 = Version.new('6D1002')
|
8
|
+
|
9
|
+
v1.should < v2
|
10
|
+
v2.should > v1
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'implements the equality operator' do
|
14
|
+
v1 = Version.new('6D570')
|
15
|
+
v2 = Version.new('6D570')
|
16
|
+
|
17
|
+
v1.should == v2
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liferaft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Bügling
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/liferaft/gem_version.rb
|
57
57
|
- lib/liferaft/version.rb
|
58
58
|
- liferaft.gemspec
|
59
|
+
- spec/comparison_spec.rb
|
59
60
|
- spec/spec_helper.rb
|
60
61
|
- spec/version_spec.rb
|
61
62
|
homepage: https://github.com/neonichu/liferaft
|
@@ -83,6 +84,7 @@ signing_key:
|
|
83
84
|
specification_version: 4
|
84
85
|
summary: Liferaft parses Apple build numbers, like 6D1002
|
85
86
|
test_files:
|
87
|
+
- spec/comparison_spec.rb
|
86
88
|
- spec/spec_helper.rb
|
87
89
|
- spec/version_spec.rb
|
88
90
|
has_rdoc:
|