oliver 2.2.2 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -5
- data/lib/oliver/commands.rb +42 -23
- data/lib/oliver/version.rb +2 -2
- data/lib/oliver.rb +5 -9
- 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: dab3aaf89df3b265a927670055cf2c94e97f07d5
|
4
|
+
data.tar.gz: 54a12a48d5046fa4b1639f143775879636f3da63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6d07f6a59895912ee9c053218ea9b15b9e953e1f2cd2d452b32b250cdf90d2ecd07b3cc283c6062701f628aeceb82bd5ae0170a449977eae3ca21cdb9730f26
|
7
|
+
data.tar.gz: c5c3e23ecee75830a3171db3a554a973ed2c83004dacbe9800e518a5b54956e42a8279518344e699f98b70405d3b1f154d029bae4de9e9cfb2055eae288596a5
|
data/README.md
CHANGED
@@ -44,15 +44,10 @@ and then add whatever you'd like to the file (write in JSON)
|
|
44
44
|
],
|
45
45
|
"Braeden-Mayer": [
|
46
46
|
"Top-Hat"
|
47
|
-
],
|
48
|
-
"misc": [
|
49
|
-
"https://exampleserver.com/repo"
|
50
47
|
]
|
51
48
|
}
|
52
49
|
```
|
53
50
|
|
54
|
-
- Use `Misc` for URLs that aren't hosted on GitHub
|
55
|
-
|
56
51
|
### Initializing the root
|
57
52
|
|
58
53
|
Creates the base `.oliver` file
|
data/lib/oliver/commands.rb
CHANGED
@@ -8,10 +8,26 @@ require_relative 'file_manager'
|
|
8
8
|
module Oliver
|
9
9
|
module_function
|
10
10
|
|
11
|
+
def get_local_repos
|
12
|
+
temp = []
|
13
|
+
temp = Dir.entries('.').reject do |f|
|
14
|
+
f['.'] || f['..'] || f[Oliver::NAME]
|
15
|
+
end
|
16
|
+
return temp.sort
|
17
|
+
end
|
18
|
+
|
19
|
+
def get_tracked_repos
|
20
|
+
temp = []
|
21
|
+
FileManager::BODY.map do |user, repo|
|
22
|
+
temp << repo
|
23
|
+
end
|
24
|
+
return temp.first.sort
|
25
|
+
end
|
26
|
+
|
11
27
|
def init
|
12
28
|
unless File.exists?(Oliver::NAME)
|
13
29
|
File.open(Oliver::NAME, 'w') do |file|
|
14
|
-
tempHash = {
|
30
|
+
tempHash = { probablyjosh: ["oliver"] }
|
15
31
|
file.write(JSON.pretty_generate(tempHash))
|
16
32
|
puts "#{Oliver::NAME} created sucessfully" if @options[:verbose]
|
17
33
|
end
|
@@ -54,23 +70,18 @@ module Oliver
|
|
54
70
|
end
|
55
71
|
end
|
56
72
|
|
57
|
-
dirRepos =
|
58
|
-
|
59
|
-
end
|
60
|
-
dirRepos.sort!
|
61
|
-
|
62
|
-
trackedRepos ||= []
|
63
|
-
FileManager::BODY.each do |user|
|
64
|
-
user[1].each { |repo| trackedRepos << repo }
|
65
|
-
end
|
66
|
-
trackedRepos.sort!
|
73
|
+
dirRepos = get_local_repos
|
74
|
+
trackedRepos = get_tracked_repos
|
67
75
|
|
68
76
|
unless dirRepos == trackedRepos
|
69
77
|
dirRepos ||= []
|
70
78
|
trackedRepos ||= []
|
71
79
|
dirRepos -= trackedRepos
|
72
80
|
unless dirRepos.empty?
|
73
|
-
dirRepos.each
|
81
|
+
dirRepos.each do |dirRepo|
|
82
|
+
puts "Removing #{dirRepo}" if @options[:verbose]
|
83
|
+
FileUtils.rm_rf(dirRepo)
|
84
|
+
end
|
74
85
|
end
|
75
86
|
end
|
76
87
|
|
@@ -78,17 +89,25 @@ module Oliver
|
|
78
89
|
end
|
79
90
|
|
80
91
|
def list
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
+
dirRepos = get_local_repos
|
93
|
+
trackedRepos = get_tracked_repos
|
94
|
+
|
95
|
+
# If repo exists in
|
96
|
+
# - .oliver and in directory, print "#" (neutral)
|
97
|
+
# - only .oliver, print "+" (clone)
|
98
|
+
# - only directory, print "-" (remove)
|
99
|
+
|
100
|
+
# If repos and directories are identical, just print # next to repo name
|
101
|
+
dirRepos.each {|repo| puts "# #{repo}" } if dirRepos == trackedRepos
|
102
|
+
|
103
|
+
# If repo only exists in .oliver, print '+'
|
104
|
+
dirRepos.each do |repo|
|
105
|
+
puts "+ #{repo}" unless trackedRepos.include? repo
|
106
|
+
end
|
107
|
+
|
108
|
+
# If repo only exists in directory, print '-'
|
109
|
+
trackedRepos.each do |repo|
|
110
|
+
puts "- #{repo}" unless dirRepos.include? repo
|
92
111
|
end
|
93
112
|
end
|
94
113
|
|
data/lib/oliver/version.rb
CHANGED
data/lib/oliver.rb
CHANGED
@@ -65,21 +65,17 @@ module Oliver
|
|
65
65
|
advice.map { |key, value| puts "#{key} \t#{value}" }
|
66
66
|
end
|
67
67
|
|
68
|
-
advice #
|
68
|
+
advice # Return advice
|
69
69
|
end
|
70
70
|
|
71
71
|
def build(commands)
|
72
72
|
require_relative 'oliver/commands'
|
73
73
|
@command = @command.split(' ')
|
74
74
|
case @command.first
|
75
|
-
when 'init'
|
76
|
-
|
77
|
-
when '
|
78
|
-
|
79
|
-
when 'list'
|
80
|
-
list
|
81
|
-
when 'pull', 'update'
|
82
|
-
pull
|
75
|
+
when 'init' then init
|
76
|
+
when 'install' then install
|
77
|
+
when 'list' then list
|
78
|
+
when 'pull', 'update' then pull
|
83
79
|
else end
|
84
80
|
end
|
85
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oliver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Trommel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|