liferaft 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/.travis.yml +3 -1
- data/Rakefile +1 -1
- data/lib/liferaft/gem_version.rb +1 -1
- data/lib/liferaft/version.rb +8 -28
- data/liferaft.gemspec +1 -1
- data/spec/version_spec.rb +1 -1
- metadata +13 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0ebd91dd16a2181c6c68ef9f9d1a9c5599592ad
|
4
|
+
data.tar.gz: c9a4fc35197293f0b11bb2a5c1258c9879d8c7e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5536874b634726d1a2f1c6d17ee584b4c278cfc7ab997b357fef9dc8a71e5ff18e2415fa0a7ae71c4c5d4dff14d897e30ec8f4c56be085e26764f28ce5fb95a7
|
7
|
+
data.tar.gz: 2d6e540f9d8d66553e3c6eae6c6e198a55377e0efb814b1e921bbd222e3d9f10b72c707de145dc4b7a61580ffdf0e33d299d04c05cdab301fb9d948e0d6852dd
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
data/lib/liferaft/gem_version.rb
CHANGED
data/lib/liferaft/version.rb
CHANGED
@@ -4,13 +4,15 @@ module Liferaft
|
|
4
4
|
end
|
5
5
|
|
6
6
|
class Version
|
7
|
+
include Comparable
|
8
|
+
|
7
9
|
attr_reader :major, :minor, :patch, :build
|
8
10
|
|
9
11
|
def initialize(version_string)
|
10
12
|
components = version_string.downcase.split(/[a-z]/)
|
11
13
|
character = version_string.downcase.gsub(/[^a-z]/, '')
|
12
14
|
|
13
|
-
if character.length > 2 || character.
|
15
|
+
if character.length > 2 || character.empty?
|
14
16
|
@major = @minor = @patch = @build = 0
|
15
17
|
return
|
16
18
|
end
|
@@ -22,35 +24,13 @@ module Liferaft
|
|
22
24
|
end
|
23
25
|
|
24
26
|
def to_s
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
def >(other)
|
29
|
-
other < self
|
30
|
-
end
|
31
|
-
|
32
|
-
def >=(other)
|
33
|
-
other < self || other == self
|
34
|
-
end
|
35
|
-
|
36
|
-
def <(other)
|
37
|
-
return true if major < other.major
|
38
|
-
return false if major != other.major
|
39
|
-
return true if minor < other.minor
|
40
|
-
return false if minor != other.minor
|
41
|
-
return true if patch < other.patch
|
42
|
-
return false if patch != other.patch
|
43
|
-
build < other.build
|
44
|
-
end
|
45
|
-
|
46
|
-
def <=(other)
|
47
|
-
self < other || other == self
|
27
|
+
"#{@major}.#{@minor}.#{@patch} Build #{@build}"
|
48
28
|
end
|
49
29
|
|
50
|
-
def
|
51
|
-
|
52
|
-
|
53
|
-
|
30
|
+
def <=>(other)
|
31
|
+
%i(major minor patch build).lazy.map do |component|
|
32
|
+
send(component) <=> other.send(component)
|
33
|
+
end.find(&:nonzero?) || 0
|
54
34
|
end
|
55
35
|
end
|
56
36
|
end
|
data/liferaft.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ['Boris Bügling']
|
10
10
|
spec.email = ['boris@icculus.org']
|
11
11
|
spec.summary = 'Liferaft parses Apple build numbers, like 6D1002'
|
12
|
-
spec.homepage = 'https://github.com/
|
12
|
+
spec.homepage = 'https://github.com/segiddins/liferaft'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
data/spec/version_spec.rb
CHANGED
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Bügling
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
description:
|
@@ -45,9 +45,9 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- .gitignore
|
49
|
-
- .rubocop.yml
|
50
|
-
- .travis.yml
|
48
|
+
- ".gitignore"
|
49
|
+
- ".rubocop.yml"
|
50
|
+
- ".travis.yml"
|
51
51
|
- Gemfile
|
52
52
|
- LICENSE.txt
|
53
53
|
- README.md
|
@@ -59,7 +59,7 @@ files:
|
|
59
59
|
- spec/comparison_spec.rb
|
60
60
|
- spec/spec_helper.rb
|
61
61
|
- spec/version_spec.rb
|
62
|
-
homepage: https://github.com/
|
62
|
+
homepage: https://github.com/segiddins/liferaft
|
63
63
|
licenses:
|
64
64
|
- MIT
|
65
65
|
metadata: {}
|
@@ -69,17 +69,17 @@ require_paths:
|
|
69
69
|
- lib
|
70
70
|
required_ruby_version: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
- -
|
77
|
+
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
82
|
+
rubygems_version: 2.6.7
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Liferaft parses Apple build numbers, like 6D1002
|
@@ -87,4 +87,3 @@ test_files:
|
|
87
87
|
- spec/comparison_spec.rb
|
88
88
|
- spec/spec_helper.rb
|
89
89
|
- spec/version_spec.rb
|
90
|
-
has_rdoc:
|