oliver 1.4.2 → 1.5
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/Gemfile.lock +21 -0
- data/IDEAS.md +48 -0
- data/README.md +21 -20
- data/bin/oliver +6 -0
- data/lib/oliver/arguments.rb +12 -11
- data/lib/oliver/main.rb +14 -0
- data/lib/oliver/methods.rb +18 -19
- data/lib/oliver/version.rb +1 -1
- data/lib/oliver.rb +10 -4
- data/oliver.gemspec +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9381f29437c38b0a0cc32e70d85763c7b4a91a4a
|
4
|
+
data.tar.gz: 9caec5420d4c832441be132ffcd7cce1f659f89b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50d0bbc92625e80c98d6a3e20e3ab2050c90c96858491905f360a798547d671dd4b0c9c362badd11aa472ba9d1f67740ae699ba539b69a85a1632a7a1970cb8c
|
7
|
+
data.tar.gz: 14113d28f2e5b8dc638390001364213666951dcf1c7a6374aa4d4b2282fada36ff62329964384cafdec06623344a8e8c8f69264bc760cd6fa7bfba8f65ad8bb8
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
oliver (0.1.7)
|
5
|
+
jibry (>= 0.0.3)
|
6
|
+
rainbow (>= 2.0.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
jibry (0.0.3)
|
12
|
+
rainbow (2.0.0)
|
13
|
+
rake (10.3.2)
|
14
|
+
|
15
|
+
PLATFORMS
|
16
|
+
ruby
|
17
|
+
|
18
|
+
DEPENDENCIES
|
19
|
+
bundler (~> 1.6)
|
20
|
+
oliver!
|
21
|
+
rake
|
data/IDEAS.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
ideas
|
2
|
+
=====
|
3
|
+
|
4
|
+
ideas that should or have already been implemented.
|
5
|
+
|
6
|
+
- [x] make the backup directory hidden (`.backup`)
|
7
|
+
|
8
|
+
- [ ] add verbose mode (`--verbose`) so things like `olive install` will have output like
|
9
|
+
|
10
|
+
```bash
|
11
|
+
olive/ already exists.
|
12
|
+
dotfiles was cloned.
|
13
|
+
```
|
14
|
+
|
15
|
+
etc, etc. otherwise, this should be defaulted to silent.
|
16
|
+
|
17
|
+
this should also be able to be set through the Olivefile
|
18
|
+
|
19
|
+
```bash
|
20
|
+
repos:
|
21
|
+
- "trommel/oliver"
|
22
|
+
|
23
|
+
prefs:
|
24
|
+
- "verbose"
|
25
|
+
- "no colour" # this too :P
|
26
|
+
```
|
27
|
+
|
28
|
+
- [ ] [Douglas](https://twitter.com/istx25) gave me this cool
|
29
|
+
idea that [CocoaPods](https://github.com/CocoaPods/CocoaPods) uses, where
|
30
|
+
you can run
|
31
|
+
|
32
|
+
```bash
|
33
|
+
$ olive install
|
34
|
+
```
|
35
|
+
|
36
|
+
it can not only install the repos on the list, but remove the repos
|
37
|
+
that have been installed locally but are no longer on the list.
|
38
|
+
this way, if you want to delete a bunch of repositories, you can simply
|
39
|
+
remove them from the list and run
|
40
|
+
|
41
|
+
```bash
|
42
|
+
$ olive install
|
43
|
+
```
|
44
|
+
|
45
|
+
I spent, like, 50 minutes on this and I can't figure out a good way
|
46
|
+
to do it, though, so.. yeah
|
47
|
+
|
48
|
+
I'll add it as soon as I can figure it out.
|
data/README.md
CHANGED
@@ -141,7 +141,7 @@ repos:
|
|
141
141
|
you can then run
|
142
142
|
|
143
143
|
```bash
|
144
|
-
$ olive
|
144
|
+
$ olive install # installs / removes listed repos
|
145
145
|
```
|
146
146
|
|
147
147
|
### start tracking a repo
|
@@ -188,6 +188,12 @@ append `colour=off` to any statement
|
|
188
188
|
|
189
189
|
don't forget to spell *"colour"* **the proper way**.
|
190
190
|
|
191
|
+
things to remember
|
192
|
+
==================
|
193
|
+
|
194
|
+
- run everything with `olive`, not `oliver`. "oliver" is the name
|
195
|
+
of the project, `olive` is the name of the CLI.
|
196
|
+
|
191
197
|
branches
|
192
198
|
========
|
193
199
|
|
@@ -204,30 +210,25 @@ branch, if you want to check it out.
|
|
204
210
|
the official gem that's hosted on rubygems, though, is
|
205
211
|
the gem of the master branch, and that's how it's going to stay.
|
206
212
|
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
[Douglas](https://twitter.com/istx25) gave me this cool
|
211
|
-
idea that [CocoaPods](https://github.com/CocoaPods/CocoaPods) uses, where
|
212
|
-
when we run
|
213
|
+
ideas
|
214
|
+
=====
|
213
215
|
|
214
|
-
|
215
|
-
|
216
|
-
```
|
216
|
+
refer to
|
217
|
+
[IDEAS.md](https://github.com/trommel/oliver/blob/master/spec/IDEAS.md).
|
217
218
|
|
218
|
-
|
219
|
-
|
220
|
-
this way, if you want to delete a bunch of repositories, you can simply
|
221
|
-
remove them from the list and run
|
219
|
+
versions
|
220
|
+
========
|
222
221
|
|
223
|
-
|
224
|
-
|
225
|
-
|
222
|
+
for some reason, I was using things like "1.5" as oliver's
|
223
|
+
version for a bit, even though oliver isn't even finished (to
|
224
|
+
even the help menu), so if you check the previous gem versions,
|
225
|
+
the newest gem version is probably (maybe) smaller / below
|
226
|
+
previous gem versions. this was me being silly and not thinking.
|
226
227
|
|
227
|
-
|
228
|
-
|
228
|
+
as of right now (July 18, 2014, 6:19 PM), oliver's version
|
229
|
+
is 0.1.5, and it will continue to build off from there.
|
229
230
|
|
230
|
-
|
231
|
+
sorry about doing that silly thing.
|
231
232
|
|
232
233
|
testing
|
233
234
|
=======
|
data/bin/oliver
ADDED
data/lib/oliver/arguments.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
# Different arguments
|
2
|
+
# (Make this into a case statement asap)
|
3
|
+
# (It'll be way easier and cleaner to work with later)
|
2
4
|
def different_arguments
|
3
|
-
if
|
4
|
-
if ARGV[0].downcase == 'init'
|
5
|
+
if ARGV[0].downcase == 'init'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
else
|
12
|
-
puts "#{Rainbow(Name::OLIVER).red} already exists."
|
7
|
+
if !File.file?(Name::OLIVER)
|
8
|
+
File.open(Name::OLIVER, 'w') do |file|
|
9
|
+
file.write("repos:\n")
|
10
|
+
file.write(" - \"trommel/oliver\"\n")
|
11
|
+
puts "#{Rainbow(Name::OLIVER.green)} has been created."
|
13
12
|
end
|
14
|
-
|
15
|
-
|
13
|
+
else
|
14
|
+
puts "#{Rainbow(Name::OLIVER).red} already exists."
|
16
15
|
end
|
16
|
+
|
17
|
+
Jib.exit
|
17
18
|
end
|
18
19
|
end
|
data/lib/oliver/main.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'awesome_print'
|
1
2
|
# Main oliver file
|
2
3
|
def run_main
|
3
4
|
|
@@ -15,13 +16,26 @@ def run_main
|
|
15
16
|
splitted = url.split '/'
|
16
17
|
username = splitted[0]
|
17
18
|
repo = splitted[1]
|
19
|
+
current_repos = Dir.entries '.'
|
20
|
+
['.', '..', '.backup', Name::OLIVER].each do |i|
|
21
|
+
current_repos.delete(i)
|
22
|
+
end
|
18
23
|
|
19
24
|
# Clone the repo if it doesn't already exist
|
20
25
|
if !File.directory?(repo)
|
21
26
|
%x(git clone git://github.com/#{url} --quiet)
|
27
|
+
puts "#{Rainbow(repo).green}/ has been successfully cloned."
|
22
28
|
else
|
23
29
|
puts "#{Rainbow(repo).red}/ already exists."
|
24
30
|
end
|
25
31
|
|
32
|
+
# If the directory doesn't exist
|
33
|
+
# in `Name::OLIVER`, move it to .backup
|
34
|
+
current_repos.each do |directory_thing|
|
35
|
+
if !final["repos"].to_s.include? directory_thing
|
36
|
+
%x(mv #{directory_thing} .backup)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
26
40
|
end
|
27
41
|
end
|
data/lib/oliver/methods.rb
CHANGED
@@ -1,26 +1,15 @@
|
|
1
|
-
# If the user can't even
|
2
|
-
# specify basic arguments
|
3
|
-
# just give him/her some help
|
4
|
-
# and heavy medication
|
5
|
-
def are_you_serious?
|
6
|
-
if ARGV[0].nil?
|
7
|
-
help
|
8
|
-
Jib.exit
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
1
|
# Help the user with their heavy troubles
|
13
2
|
def help
|
14
3
|
|
15
4
|
helper = [
|
16
5
|
[
|
17
|
-
"
|
18
|
-
"
|
6
|
+
"init",
|
7
|
+
"initializes the main directory by creating a base #{Name::OLIVER}"
|
19
8
|
],
|
20
9
|
|
21
10
|
[
|
22
|
-
"
|
23
|
-
"
|
11
|
+
"install",
|
12
|
+
"clones / removes directories if they're listed on the #{Name::OLIVER}"
|
24
13
|
],
|
25
14
|
|
26
15
|
[
|
@@ -41,6 +30,16 @@ def help
|
|
41
30
|
[
|
42
31
|
"update",
|
43
32
|
"pull updates from each tracked repo on the #{Name::OLIVER}"
|
33
|
+
],
|
34
|
+
|
35
|
+
[
|
36
|
+
"-v",
|
37
|
+
"return oliver's version"
|
38
|
+
],
|
39
|
+
|
40
|
+
[
|
41
|
+
"-h",
|
42
|
+
"return this help menu"
|
44
43
|
]
|
45
44
|
]
|
46
45
|
|
@@ -54,19 +53,19 @@ def help
|
|
54
53
|
puts "#{Rainbow(line).green} # => #{Rainbow(blurb).blue}"
|
55
54
|
end
|
56
55
|
|
56
|
+
Jib.exit
|
57
|
+
|
57
58
|
end
|
58
59
|
|
59
60
|
# Be totally ready if the user asks
|
60
61
|
# a question like "what version is oliver?"
|
61
62
|
# or "I need some help"
|
62
63
|
def other_things
|
63
|
-
|
64
|
-
case ARGV[0].to_s.downcase
|
64
|
+
case ARGV[0].downcase
|
65
65
|
when '-v' || '--version'
|
66
66
|
puts "#{Rainbow('oliver').red} #{Rainbow("v#{Oliver::VERSION}").green}"
|
67
|
+
Jib.exit
|
67
68
|
when '-h' || '--help'
|
68
69
|
help
|
69
|
-
else
|
70
|
-
help
|
71
70
|
end
|
72
71
|
end
|
data/lib/oliver/version.rb
CHANGED
data/lib/oliver.rb
CHANGED
@@ -13,6 +13,9 @@ require_relative "oliver/main"
|
|
13
13
|
# just disable it completely
|
14
14
|
Rainbow.enabled = false if ARGV[-1] == 'colour=off'
|
15
15
|
|
16
|
+
# Right off the bat,
|
17
|
+
# if the user doesn't specify even one argument
|
18
|
+
# just give him some help and quit oliver
|
16
19
|
if ARGV[0].nil?
|
17
20
|
help
|
18
21
|
Jib.exit
|
@@ -21,6 +24,9 @@ end
|
|
21
24
|
# (Literally) different arguments
|
22
25
|
different_arguments
|
23
26
|
|
27
|
+
# (Literally) other things
|
28
|
+
other_things
|
29
|
+
|
24
30
|
# if `Name::OLIVER` (string)
|
25
31
|
# exists as a file continue with oliver
|
26
32
|
if File.file? Name::OLIVER
|
@@ -28,12 +34,12 @@ if File.file? Name::OLIVER
|
|
28
34
|
run_main
|
29
35
|
Jib.exit
|
30
36
|
else
|
31
|
-
|
32
|
-
|
33
|
-
|
37
|
+
name_install = Rainbow('oliver install').red
|
38
|
+
name_color = Rainbow(Name::OLIVER).red
|
39
|
+
puts "#{name_install} requires an #{name_color} to do its magic."
|
34
40
|
Jib.exit
|
35
41
|
end
|
36
42
|
else
|
37
|
-
|
43
|
+
help
|
38
44
|
Jib.exit
|
39
45
|
end
|
data/oliver.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |gem|
|
|
9
9
|
gem.homepage = 'https://github.com/trommel/oliver'
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
|
-
gem.executables = ['olive']
|
12
|
+
gem.executables = ['olive', 'oliver']
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = 'oliver'
|
15
15
|
gem.require_paths = ['oliver']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oliver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh
|
@@ -71,15 +71,19 @@ email:
|
|
71
71
|
- joshception@icloud.com
|
72
72
|
executables:
|
73
73
|
- olive
|
74
|
+
- oliver
|
74
75
|
extensions: []
|
75
76
|
extra_rdoc_files: []
|
76
77
|
files:
|
77
78
|
- ".gitignore"
|
78
79
|
- CONTRIBUTING.md
|
79
80
|
- Gemfile
|
81
|
+
- Gemfile.lock
|
82
|
+
- IDEAS.md
|
80
83
|
- README.md
|
81
84
|
- Rakefile
|
82
85
|
- bin/olive
|
86
|
+
- bin/oliver
|
83
87
|
- lib/oliver.rb
|
84
88
|
- lib/oliver/arguments.rb
|
85
89
|
- lib/oliver/main.rb
|