ruaur 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruaur/aur.rb +8 -13
- data/lib/ruaur/package.rb +2 -3
- data/lib/ruaur/pacman.rb +5 -7
- data/lib/ruaur.rb +8 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 385df0164ad380f5530a4dd147bf6313bf0106f5
|
4
|
+
data.tar.gz: 2e76d2a1c45fbce79a4732602bbf492509fe5b33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f530c6ad792184e83509aef0692fad65a4e021ead80ea7d80cd661619be209994d2cdae4f5c6cc45f5d311d9597a5b6873acbc790b0029d4e5dbb8cd5682ec6
|
7
|
+
data.tar.gz: 32a09f5facbfcf304e7f19808ca234f49666bc68702de83da6f55e43c1d8974e8396d31dee6c0e2028c4ae0f5daacbd5e9495fed69bd9b25e81641aa408bffbd
|
data/lib/ruaur/aur.rb
CHANGED
@@ -16,25 +16,25 @@ class RuAUR::AUR
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def colorize_dependency(dependency)
|
19
|
-
return dependency if (
|
19
|
+
return dependency if (!RuAUR.colorize?)
|
20
20
|
return dependency.light_magenta
|
21
21
|
end
|
22
22
|
private :colorize_dependency
|
23
23
|
|
24
24
|
def colorize_installed(installed)
|
25
|
-
return installed if (
|
25
|
+
return installed if (!RuAUR.colorize?)
|
26
26
|
return installed.light_yellow
|
27
27
|
end
|
28
28
|
private :colorize_installed
|
29
29
|
|
30
30
|
def colorize_status(status)
|
31
|
-
return status if (
|
31
|
+
return status if (!RuAUR.colorize?)
|
32
32
|
return status.light_white
|
33
33
|
end
|
34
34
|
private :colorize_status
|
35
35
|
|
36
36
|
def colorize_upgrade(old, new)
|
37
|
-
return "#{old} -> #{new}" if (
|
37
|
+
return "#{old} -> #{new}" if (!RuAUR.colorize?)
|
38
38
|
return "#{old.light_red} -> #{new.light_green}"
|
39
39
|
end
|
40
40
|
private :colorize_upgrade
|
@@ -153,18 +153,13 @@ class RuAUR::AUR
|
|
153
153
|
end
|
154
154
|
|
155
155
|
return nil if (body["results"].empty?)
|
156
|
-
return RuAUR::Package.new(body["results"], "aur"
|
156
|
+
return RuAUR::Package.new(body["results"], "aur")
|
157
157
|
end
|
158
158
|
|
159
|
-
def initialize(
|
160
|
-
pacman,
|
161
|
-
cache = "/tmp/ruaur-#{ENV["USER"]}",
|
162
|
-
colorize = false
|
163
|
-
)
|
159
|
+
def initialize(pacman, cache = "/tmp/ruaur-#{ENV["USER"]}")
|
164
160
|
cache = "/tmp/ruaur-#{ENV["USER"]}" if (cache.nil?)
|
165
161
|
@cache = Pathname.new(cache).expand_path
|
166
162
|
FileUtils.mkdir_p(@cache)
|
167
|
-
@colorize = colorize
|
168
163
|
@installed = pacman.query_aur
|
169
164
|
@pacman = pacman
|
170
165
|
@rpc_url = "https://aur.archlinux.org/rpc.php"
|
@@ -239,7 +234,7 @@ class RuAUR::AUR
|
|
239
234
|
end
|
240
235
|
|
241
236
|
body["results"].each do |result|
|
242
|
-
results.push(RuAUR::Package.new(result, "aur"
|
237
|
+
results.push(RuAUR::Package.new(result, "aur"))
|
243
238
|
end
|
244
239
|
return results.sort
|
245
240
|
end
|
@@ -256,7 +251,7 @@ class RuAUR::AUR
|
|
256
251
|
end
|
257
252
|
|
258
253
|
body["results"].each do |result|
|
259
|
-
results.push(RuAUR::Package.new(result, "aur"
|
254
|
+
results.push(RuAUR::Package.new(result, "aur"))
|
260
255
|
end
|
261
256
|
|
262
257
|
results.each do |package|
|
data/lib/ruaur/package.rb
CHANGED
@@ -27,7 +27,7 @@ class RuAUR::Package
|
|
27
27
|
def colorize_header(repo, name, installed, version, votes)
|
28
28
|
header = Array.new
|
29
29
|
|
30
|
-
if (
|
30
|
+
if (!RuAUR.colorize?)
|
31
31
|
header.push("#{repo}/#{name}")
|
32
32
|
if (installed && newer?(installed))
|
33
33
|
header.push(installed)
|
@@ -57,8 +57,7 @@ class RuAUR::Package
|
|
57
57
|
end
|
58
58
|
private :colorize_header
|
59
59
|
|
60
|
-
def initialize(json, repo = "aur"
|
61
|
-
@colorize = colorize
|
60
|
+
def initialize(json, repo = "aur")
|
62
61
|
@description = json["Description"]
|
63
62
|
@description ||= ""
|
64
63
|
@installed = nil
|
data/lib/ruaur/pacman.rb
CHANGED
@@ -9,13 +9,13 @@ class RuAUR::Pacman
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def colorize_installed(installed)
|
12
|
-
return installed if (
|
12
|
+
return installed if (!RuAUR.colorize?)
|
13
13
|
return installed.light_yellow
|
14
14
|
end
|
15
15
|
private :colorize_installed
|
16
16
|
|
17
17
|
def colorize_status(status)
|
18
|
-
return status if (
|
18
|
+
return status if (!RuAUR.colorize?)
|
19
19
|
return status.light_white
|
20
20
|
end
|
21
21
|
private :colorize_status
|
@@ -24,16 +24,15 @@ class RuAUR::Pacman
|
|
24
24
|
return !%x(#{@pac_nocolor} -Ss "^#{pkg_name}$").empty?
|
25
25
|
end
|
26
26
|
|
27
|
-
def initialize
|
27
|
+
def initialize
|
28
28
|
if (ScoobyDoo.where_are_you("pacman").nil?)
|
29
29
|
raise RuAUR::Error::MissingDependencyError.new("pacman")
|
30
30
|
end
|
31
31
|
|
32
|
-
@colorize = colorize
|
33
32
|
@pac_nocolor = "pacman --color=never"
|
34
33
|
@pac_color = "pacman --color=always"
|
35
34
|
@pac_cmd = @pac_color
|
36
|
-
@pac_cmd = @pac_nocolor if (
|
35
|
+
@pac_cmd = @pac_nocolor if (!RuAUR.colorize?)
|
37
36
|
@installed = query
|
38
37
|
end
|
39
38
|
|
@@ -127,8 +126,7 @@ class RuAUR::Pacman
|
|
127
126
|
"URLPath" => nil,
|
128
127
|
"Version" => version
|
129
128
|
},
|
130
|
-
repo
|
131
|
-
@colorize
|
129
|
+
repo
|
132
130
|
)
|
133
131
|
)
|
134
132
|
if (trailing.include?("[installed]"))
|
data/lib/ruaur.rb
CHANGED
@@ -16,6 +16,11 @@ class RuAUR
|
|
16
16
|
@aur.clean
|
17
17
|
end
|
18
18
|
|
19
|
+
def self.colorize?
|
20
|
+
@@colorize ||= false
|
21
|
+
return @@colorize
|
22
|
+
end
|
23
|
+
|
19
24
|
def initialize(colorize = false)
|
20
25
|
[
|
21
26
|
"makepkg",
|
@@ -28,9 +33,9 @@ class RuAUR
|
|
28
33
|
end
|
29
34
|
end
|
30
35
|
|
31
|
-
|
32
|
-
@pacman = RuAUR::Pacman.new
|
33
|
-
@aur = RuAUR::AUR.new(@pacman, nil
|
36
|
+
@@colorize = colorize
|
37
|
+
@pacman = RuAUR::Pacman.new
|
38
|
+
@aur = RuAUR::AUR.new(@pacman, nil)
|
34
39
|
@lock = Pathname.new("/tmp/ruaur.lock").expand_path
|
35
40
|
end
|
36
41
|
|
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: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|