ruaur 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ruaur/package.rb +16 -14
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88e3564862a98b74ad791ad867e0789002740ac37f0b6b9be71fba2c9e9765df
4
- data.tar.gz: d81bd4613ccf400b761819bd55c1ee3a17981c6fcfeec87eea9b9924f51a1a3e
3
+ metadata.gz: 8f30ee3547cf8f289a463fb44b65c0301b61fa9cc1e03cebd305842c7c8fbdf8
4
+ data.tar.gz: cb7cd6303985596af02d528f82b4174286671b922d3bf650224c069c8340835c
5
5
  SHA512:
6
- metadata.gz: 9d9bf85a49f3b4c0cb7d7d3318784eb60fa37c8b5f61a0d39a0c2d2811d28013ba1799ccd18bd88b2393e0d2424d96c815d32238e31e70fb8b89489042eab54c
7
- data.tar.gz: 7f0a328c0303396dcc3338837bb4a6bcce770e72a979877b01eb782bd10208dac6dd3e0e6dd72fc238cfd05dbcf7a6cc9ce9bc18fe9f5ee2745147f130680c69
6
+ metadata.gz: 479c0e1c0fed696eef6dd3e52351fd365f26e561f0cf890b2f908cc856625c26b352e09a7d61e0da3ce5968d70ba6aa5ba512c4a17a3fce69c29621032c8d851
7
+ data.tar.gz: d8dcb6eab55ec4a9598af8e241532514825416f68b41e44dad729359d93a5d6d5ac313a52cf094a72d85f03fcec670ce206ff2d53e7cf138ae72c1f523804dd4
data/lib/ruaur/package.rb CHANGED
@@ -79,25 +79,27 @@ class RuAUR::Package
79
79
  end
80
80
 
81
81
  def newer?(ver)
82
- self_version = @version.split(/\D+/).map(&:to_i)
83
- other_version = ver.split(/\D+/).map(&:to_i)
84
-
85
- [self_version.size, other_version.size].max.times do |i|
86
- if (self_version[i] > other_version[i])
87
- return true
88
- end
82
+ pkg_version = @version.split(/\D+/).map(&:to_i)
83
+ installed_version = ver.split(/\D+/).map(&:to_i)
84
+
85
+ [pkg_version.size, installed_version.size].max.times do |i|
86
+ return false if (pkg_version[i].nil?)
87
+ return true if (installed_version[i].nil?)
88
+ return true if (pkg_version[i] > installed_version[i])
89
+ return false if (pkg_version[i] < installed_version[i])
89
90
  end
90
91
  return false
91
92
  end
92
93
 
93
94
  def older?(version)
94
- self_version = @version.split(/\D+/).map(&:to_i)
95
- other_version = version.split(/\D+/).map(&:to_i)
96
-
97
- [self_version.size, other_version.size].max.times do |i|
98
- if (self_version[i] < other_version[i])
99
- return true
100
- end
95
+ pkg_version = @version.split(/\D+/).map(&:to_i)
96
+ installed_version = version.split(/\D+/).map(&:to_i)
97
+
98
+ [pkg_version.size, installed_version.size].max.times do |i|
99
+ return true if (pkg_version[i].nil?)
100
+ return false if (installed_version[i].nil?)
101
+ return true if (pkg_version[i] < installed_version[i])
102
+ return false if (pkg_version[i] > installed_version[i])
101
103
  end
102
104
  return false
103
105
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruaur
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-23 00:00:00.000000000 Z
11
+ date: 2018-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake