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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4274fe00e060a7eb7285f2929c7a469056f6a7f8
4
- data.tar.gz: 92c92bd0c3b8d04369bd470d65084818e7cc9180
3
+ metadata.gz: b0ebd91dd16a2181c6c68ef9f9d1a9c5599592ad
4
+ data.tar.gz: c9a4fc35197293f0b11bb2a5c1258c9879d8c7e5
5
5
  SHA512:
6
- metadata.gz: 891caaf7896809d7ac4472b6a68da63fd51a375953970a287add8ef24aebb7aee75b74f639e45e1c16e10c54a0d98ac9b2908f40c9c89caaad0652fa9d081a6c
7
- data.tar.gz: d3f1ad75f35b5aa96e704184ece768e6777fd08f87819a01f2347300d4b8e09205fc8a686401c3cd1009efc40af58f7d6c8df6dbb34c0f7ffc8a5d31e181121d
6
+ metadata.gz: 5536874b634726d1a2f1c6d17ee584b4c278cfc7ab997b357fef9dc8a71e5ff18e2415fa0a7ae71c4c5d4dff14d897e30ec8f4c56be085e26764f28ce5fb95a7
7
+ data.tar.gz: 2d6e540f9d8d66553e3c6eae6c6e198a55377e0efb814b1e921bbd222e3d9f10b72c707de145dc4b7a61580ffdf0e33d299d04c05cdab301fb9d948e0d6852dd
@@ -2,7 +2,10 @@ Lint/Void:
2
2
  Enabled: false
3
3
 
4
4
  Metrics/AbcSize:
5
- Max: 20
5
+ Max: 27
6
+
7
+ Metrics/CyclomaticComplexity:
8
+ Max: 7
6
9
 
7
10
  Metrics/LineLength:
8
11
  Max: 100
@@ -1,5 +1,7 @@
1
1
  language: ruby
2
- rvm: 2.0.0-p598
2
+ rvm:
3
+ - 2.3.1
4
+ - 2.0.0-p598
3
5
  cache: bundler
4
6
  script:
5
7
  - bundle exec rake spec
data/Rakefile CHANGED
@@ -10,4 +10,4 @@ task :spec do
10
10
  sh "bundle exec bacon #{specs('**')}"
11
11
  end
12
12
 
13
- task default: :specs
13
+ task default: :spec
@@ -1,3 +1,3 @@
1
1
  module Liferaft
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.6'.freeze
3
3
  end
@@ -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.length == 0
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
- return "#{@major}.#{@minor}.#{@patch} Build #{@build}"
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 ==(other)
51
- other.instance_of?(self.class) &&
52
- major == other.major && minor == other.minor &&
53
- patch == other.patch && build == other.build
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
@@ -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/neonichu/liferaft'
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")
@@ -49,7 +49,7 @@ module Liferaft
49
49
  version.major.should == 6
50
50
  version.minor.should == 3
51
51
  version.patch.should == 1
52
- version.build.should == 002
52
+ version.build.should == 0o02
53
53
  end
54
54
 
55
55
  it 'parses 6E7 correctly' do
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
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: 2015-06-25 00:00:00.000000000 Z
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/neonichu/liferaft
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.0.14
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: