oliver 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/oliver/commands.rb +5 -5
- data/lib/oliver/helpers.rb +13 -21
- data/lib/oliver/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ba82de7e12e49cb0a9d1c6a56b490e656dda34e2
|
|
4
|
+
data.tar.gz: 7e368ffe96d30190922fec9d8a984f1d613dc1ec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48808e5a09a1e722757c9667e359a69af6d9029119498051d4b4f4cbee2853156f14eabb7d0a5ab9d3f1ee227416ac3c5ca545f909d3a0cbc3f81034f9c1a391
|
|
7
|
+
data.tar.gz: a684b67d32689acd3ffea9a2ef9f4ebff680bbe75ede2f81aade38cc5943c533d514217347267b444cdb3a6771ef4d7488da0b9c5c3699eab91528b00a03800c
|
data/lib/oliver/commands.rb
CHANGED
|
@@ -31,11 +31,11 @@ Commands:\n
|
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
if Helpers.oliver_exists?
|
|
34
|
-
puts Helpers.log('.oliver exists',
|
|
34
|
+
puts Helpers.log('.oliver exists', :warning)
|
|
35
35
|
else
|
|
36
36
|
File.open('.oliver', 'w') do |f|
|
|
37
37
|
f.write(JSON.pretty_generate(template))
|
|
38
|
-
puts Helpers.log('.oliver created.',
|
|
38
|
+
puts Helpers.log('.oliver created.', :success)
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
end
|
|
@@ -48,7 +48,7 @@ Commands:\n
|
|
|
48
48
|
puts Helpers.log("Pulling #{dir}")
|
|
49
49
|
g.pull
|
|
50
50
|
end
|
|
51
|
-
puts Helpers.log('All repos updated successfully',
|
|
51
|
+
puts Helpers.log('All repos updated successfully', :success)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def update(args)
|
|
@@ -60,8 +60,8 @@ Commands:\n
|
|
|
60
60
|
# check if listed and local (good)
|
|
61
61
|
# star if listed but not local
|
|
62
62
|
# x if local but not listed
|
|
63
|
-
log('.oliver does not exist',
|
|
64
|
-
log('.oliver is empty',
|
|
63
|
+
log('.oliver does not exist', :error) unless Helpers.oliver_exists?
|
|
64
|
+
log('.oliver is empty', :error) if Helpers.file.empty?
|
|
65
65
|
|
|
66
66
|
Helpers.file.map do |user, repos|
|
|
67
67
|
repos.each do |repo|
|
data/lib/oliver/helpers.rb
CHANGED
|
@@ -25,27 +25,19 @@ module Helpers
|
|
|
25
25
|
File.exists?('.oliver')
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
def log(text, priority
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
when 'error'
|
|
36
|
-
message.colorize(:red) + text
|
|
37
|
-
exit
|
|
38
|
-
when 'success'
|
|
39
|
-
message.colorize(:green) + text
|
|
40
|
-
else
|
|
41
|
-
message.colorize(:blue) + text
|
|
42
|
-
end
|
|
28
|
+
def log(text, priority=:default)
|
|
29
|
+
symbol = "==>"
|
|
30
|
+
symbols = { :default => symbol.colorize(:blue),
|
|
31
|
+
:warning => symbol.colorize(:yellow),
|
|
32
|
+
:error => symbol.colorize(:red),
|
|
33
|
+
:success => symbol.colorize(:green) }
|
|
34
|
+
return "#{symbols[priority]} #{text}"
|
|
43
35
|
end
|
|
44
36
|
|
|
45
37
|
def install
|
|
46
38
|
# install all repos on the list that aren't local
|
|
47
|
-
log('.oliver does not exist',
|
|
48
|
-
log('.oliver is empty',
|
|
39
|
+
log('.oliver does not exist', :error) unless oliver_exists?
|
|
40
|
+
log('.oliver is empty', :error) if file.empty?
|
|
49
41
|
|
|
50
42
|
file.map do |user, repos|
|
|
51
43
|
repos.each do |repo|
|
|
@@ -53,13 +45,13 @@ module Helpers
|
|
|
53
45
|
endpoint = "#{user}/#{repo}"
|
|
54
46
|
|
|
55
47
|
if File.directory? repo
|
|
56
|
-
puts log("#{repo} already exists",
|
|
48
|
+
puts log("#{repo} already exists", :warning)
|
|
57
49
|
else
|
|
58
50
|
begin
|
|
59
51
|
g = Git.clone(url + endpoint, repo, :path => '.')
|
|
60
|
-
puts log("#{repo} was cloned successfully",
|
|
52
|
+
puts log("#{repo} was cloned successfully", :success) if File.directory? repo
|
|
61
53
|
rescue
|
|
62
|
-
puts log("#{repo} failed to clone",
|
|
54
|
+
puts log("#{repo} failed to clone", :warning)
|
|
63
55
|
end
|
|
64
56
|
end
|
|
65
57
|
end
|
|
@@ -72,7 +64,7 @@ module Helpers
|
|
|
72
64
|
unless tracked_repos.include? repo
|
|
73
65
|
# remove repo
|
|
74
66
|
# check w user first!! be like, yo are you sure about this buddy
|
|
75
|
-
print log("Delete #{repo}? (y/n): ",
|
|
67
|
+
print log("Delete #{repo}? (y/n): ", :warning)
|
|
76
68
|
response = STDIN.gets.chomp.downcase
|
|
77
69
|
if response == 'y'
|
|
78
70
|
puts log("Deleting #{repo}")
|
data/lib/oliver/version.rb
CHANGED