oliver 0.1.8 → 1.0
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/README.md +4 -55
- data/lib/oliver/main.rb +3 -35
- data/lib/oliver/methods.rb +19 -28
- data/lib/oliver/version.rb +1 -1
- data/lib/oliver.rb +5 -27
- data/oliver.gemspec +3 -2
- metadata +19 -10
- data/Gemfile.lock +0 -21
- data/IDEAS.md +0 -48
- data/bin/oliver +0 -6
- data/lib/oliver/arguments.rb +0 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7430fbfa0f21e51ca5eb9148880759b553850b69
|
|
4
|
+
data.tar.gz: fb21c3d4c3c41d2e40444e43ebcf887dfb2c1d21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8f376a707e02a713aba211d8e302aab9e4f1176f4367c4704117c2fa994ebe4115913c751027956bddd7289a697ce19d139e6c4a0a0a56d6d01d5fa6f74f6b2
|
|
7
|
+
data.tar.gz: 61f9417b5173f78f3eef5f2a4a665a85629d35fa03f7f389375da367ea0d27a352729a3bdced9aabba2109bba801c87bd8b441ad89b3eb7b36f85f3afd136eba
|
data/README.md
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
oliver
|
|
2
2
|
======
|
|
3
3
|
|
|
4
|
-
[](http://badge.fury.io/rb/oliver)
|
|
5
|
-
|
|
6
4
|
oliver manages your local GitHub
|
|
7
5
|
repositories for you with a simple `Olivefile`.
|
|
8
6
|
|
|
9
|
-
> "like podfiles, but for git repositories"
|
|
10
|
-
-- [@istx25](https://github.com/istx25)
|
|
11
|
-
|
|
12
7
|
installation
|
|
13
8
|
------------
|
|
14
9
|
|
|
15
10
|
oliver is a CLI that you can install
|
|
16
|
-
through [RubyGems](https://rubygems.org
|
|
11
|
+
through [RubyGems](https://rubygems.org)
|
|
17
12
|
|
|
18
13
|
```bash
|
|
19
14
|
$ gem install oliver
|
|
@@ -130,18 +125,14 @@ and in the `Olivefile`
|
|
|
130
125
|
|
|
131
126
|
```vim
|
|
132
127
|
repos:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
# use 3 spaces for indentation, not tabs!
|
|
137
|
-
# I spent, like, an hour trying to fix a nonexistant bug becuase of this
|
|
138
|
-
# smh so hard
|
|
128
|
+
- "trommel/oliver"
|
|
129
|
+
- "istx25/dotfiles"
|
|
139
130
|
```
|
|
140
131
|
|
|
141
132
|
you can then run
|
|
142
133
|
|
|
143
134
|
```bash
|
|
144
|
-
$ olive
|
|
135
|
+
$ olive
|
|
145
136
|
```
|
|
146
137
|
|
|
147
138
|
### start tracking a repo
|
|
@@ -188,48 +179,6 @@ append `colour=off` to any statement
|
|
|
188
179
|
|
|
189
180
|
don't forget to spell *"colour"* **the proper way**.
|
|
190
181
|
|
|
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
|
-
|
|
197
|
-
branches
|
|
198
|
-
========
|
|
199
|
-
|
|
200
|
-
I kept fixing bugs and then I would frantically
|
|
201
|
-
push the fixes because I was worried people, if anyone actually
|
|
202
|
-
uses oliver, would experience problems with it if I didn't push
|
|
203
|
-
the fix immediately. the problem, obviously, with this
|
|
204
|
-
is that I didn't catch other things I needed to fix, and now I have,
|
|
205
|
-
like, a billion commits, even though most of them are just me changing
|
|
206
|
-
the version variable.
|
|
207
|
-
|
|
208
|
-
anyways, there's an [unstable](https://github.com/trommel/oliver/tree/unstable)
|
|
209
|
-
branch, if you want to check it out.
|
|
210
|
-
the official gem that's hosted on rubygems, though, is
|
|
211
|
-
the gem of the master branch, and that's how it's going to stay.
|
|
212
|
-
|
|
213
|
-
ideas
|
|
214
|
-
=====
|
|
215
|
-
|
|
216
|
-
refer to
|
|
217
|
-
[IDEAS.md](https://github.com/trommel/oliver/blob/master/spec/IDEAS.md).
|
|
218
|
-
|
|
219
|
-
versions
|
|
220
|
-
========
|
|
221
|
-
|
|
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.
|
|
227
|
-
|
|
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.
|
|
230
|
-
|
|
231
|
-
sorry about doing that silly thing.
|
|
232
|
-
|
|
233
182
|
testing
|
|
234
183
|
=======
|
|
235
184
|
|
data/lib/oliver/main.rb
CHANGED
|
@@ -1,41 +1,9 @@
|
|
|
1
|
-
require 'awesome_print'
|
|
2
1
|
# Main oliver file
|
|
2
|
+
require 'awesome_print'
|
|
3
3
|
def run_main
|
|
4
|
-
|
|
5
|
-
# Back up your files, man
|
|
6
|
-
if !File.directory?('.backup')
|
|
7
|
-
Dir.mkdir '.backup'
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
# The buggiest code in the world (that's probably totally untrue)
|
|
11
4
|
body = File.read(Name::OLIVER.chomp)
|
|
12
5
|
final = YAML.load("---\n#{body}\n---")
|
|
13
|
-
final["repos"].each do |
|
|
14
|
-
|
|
15
|
-
# Split the url in half
|
|
16
|
-
splitted = url.split '/'
|
|
17
|
-
username = splitted[0]
|
|
18
|
-
repo = splitted[1]
|
|
19
|
-
current_repos = Dir.entries '.'
|
|
20
|
-
['.', '..', '.backup', Name::OLIVER].each do |i|
|
|
21
|
-
current_repos.delete(i)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# Clone the repo if it doesn't already exist
|
|
25
|
-
if !File.directory?(repo)
|
|
26
|
-
%x(git clone git://github.com/#{url} --quiet)
|
|
27
|
-
puts "#{Rainbow(repo).green}/ has been successfully cloned."
|
|
28
|
-
else
|
|
29
|
-
puts "#{Rainbow(repo).red}/ already exists."
|
|
30
|
-
end
|
|
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
|
-
|
|
6
|
+
final["repos"].each do |repo|
|
|
7
|
+
%x(git clone git://github.com/#{repo} --quiet)
|
|
40
8
|
end
|
|
41
9
|
end
|
data/lib/oliver/methods.rb
CHANGED
|
@@ -1,45 +1,36 @@
|
|
|
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
|
+
|
|
1
12
|
# Help the user with their heavy troubles
|
|
2
13
|
def help
|
|
3
14
|
|
|
4
15
|
helper = [
|
|
5
|
-
[
|
|
6
|
-
"init",
|
|
7
|
-
"initializes the main directory by creating a base #{Name::OLIVER}"
|
|
8
|
-
],
|
|
9
|
-
|
|
10
|
-
[
|
|
11
|
-
"install",
|
|
12
|
-
"clones / removes directories if they're listed on the #{Name::OLIVER}"
|
|
13
|
-
],
|
|
14
|
-
|
|
15
16
|
[
|
|
16
17
|
"add username/repo",
|
|
17
|
-
"clone repo and add it to
|
|
18
|
+
"clone repo and add it to tracking list",
|
|
18
19
|
],
|
|
19
20
|
|
|
20
21
|
[
|
|
21
22
|
"remove username/repo",
|
|
22
|
-
"delete repo and remove it from
|
|
23
|
+
"delete repo and remove it from tracking list",
|
|
23
24
|
],
|
|
24
25
|
|
|
25
26
|
[
|
|
26
27
|
"list",
|
|
27
|
-
"list repos currently on
|
|
28
|
+
"list repos currently on tracking list"
|
|
28
29
|
],
|
|
29
30
|
|
|
30
31
|
[
|
|
31
32
|
"update",
|
|
32
|
-
"pull updates from each tracked repo
|
|
33
|
-
],
|
|
34
|
-
|
|
35
|
-
[
|
|
36
|
-
"-v",
|
|
37
|
-
"return oliver's version"
|
|
38
|
-
],
|
|
39
|
-
|
|
40
|
-
[
|
|
41
|
-
"-h",
|
|
42
|
-
"return this help menu"
|
|
33
|
+
"pull updates from each tracked repo"
|
|
43
34
|
]
|
|
44
35
|
]
|
|
45
36
|
|
|
@@ -53,19 +44,19 @@ def help
|
|
|
53
44
|
puts "#{Rainbow(line).green} # => #{Rainbow(blurb).blue}"
|
|
54
45
|
end
|
|
55
46
|
|
|
56
|
-
Jib.exit
|
|
57
|
-
|
|
58
47
|
end
|
|
59
48
|
|
|
60
49
|
# Be totally ready if the user asks
|
|
61
50
|
# a question like "what version is oliver?"
|
|
62
51
|
# or "I need some help"
|
|
63
52
|
def other_things
|
|
64
|
-
|
|
53
|
+
are_you_serious?
|
|
54
|
+
case ARGV[0].to_s.downcase
|
|
65
55
|
when '-v' || '--version'
|
|
66
56
|
puts "#{Rainbow('oliver').red} #{Rainbow("v#{Oliver::VERSION}").green}"
|
|
67
|
-
Jib.exit
|
|
68
57
|
when '-h' || '--help'
|
|
69
58
|
help
|
|
59
|
+
else
|
|
60
|
+
help
|
|
70
61
|
end
|
|
71
62
|
end
|
data/lib/oliver/version.rb
CHANGED
data/lib/oliver.rb
CHANGED
|
@@ -1,45 +1,23 @@
|
|
|
1
1
|
# holy shit, this is massive
|
|
2
2
|
# twss
|
|
3
|
+
require 'launchy'
|
|
3
4
|
require 'jibry'
|
|
4
5
|
require 'rainbow'
|
|
5
6
|
require 'YAML'
|
|
6
|
-
|
|
7
|
-
require_relative "oliver/arguments"
|
|
7
|
+
require 'git'
|
|
8
8
|
require_relative "oliver/version"
|
|
9
9
|
require_relative "oliver/methods"
|
|
10
|
+
require_relative "oliver/oliver_file_name"
|
|
10
11
|
require_relative "oliver/main"
|
|
11
12
|
|
|
12
13
|
# if the user doesn't want to use rainbow
|
|
13
14
|
# just disable it completely
|
|
14
15
|
Rainbow.enabled = false if ARGV[-1] == 'colour=off'
|
|
15
16
|
|
|
16
|
-
# Right off the bat,
|
|
17
|
-
# if the user doesn't specify even one argument
|
|
18
|
-
# just give him some help and quit oliver
|
|
19
|
-
if ARGV[0].nil?
|
|
20
|
-
help
|
|
21
|
-
Jib.exit
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# (Literally) different arguments
|
|
25
|
-
different_arguments
|
|
26
|
-
|
|
27
|
-
# (Literally) other things
|
|
28
|
-
other_things
|
|
29
|
-
|
|
30
17
|
# if `Name::OLIVER` (string)
|
|
31
18
|
# exists as a file continue with oliver
|
|
32
19
|
if File.file? Name::OLIVER
|
|
33
|
-
|
|
34
|
-
run_main
|
|
35
|
-
Jib.exit
|
|
36
|
-
else
|
|
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."
|
|
40
|
-
Jib.exit
|
|
41
|
-
end
|
|
20
|
+
run_main
|
|
42
21
|
else
|
|
43
|
-
|
|
44
|
-
Jib.exit
|
|
22
|
+
other_things
|
|
45
23
|
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']
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
14
14
|
gem.name = 'oliver'
|
|
15
15
|
gem.require_paths = ['oliver']
|
|
@@ -17,6 +17,7 @@ Gem::Specification.new do |gem|
|
|
|
17
17
|
|
|
18
18
|
gem.add_development_dependency "bundler", "~> 1.6"
|
|
19
19
|
gem.add_development_dependency "rake"
|
|
20
|
-
gem.add_dependency '
|
|
20
|
+
gem.add_dependency 'launchy', '>= 2.4'
|
|
21
|
+
gem.add_dependency 'jibry', '>= 0.0.1'
|
|
21
22
|
gem.add_dependency 'rainbow', '>= 2.0.0'
|
|
22
23
|
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:
|
|
4
|
+
version: '1.0'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Josh
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-07-
|
|
11
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -38,20 +38,34 @@ dependencies:
|
|
|
38
38
|
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: launchy
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '2.4'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '2.4'
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
56
|
name: jibry
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
44
58
|
requirements:
|
|
45
59
|
- - ">="
|
|
46
60
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 0.0.
|
|
61
|
+
version: 0.0.1
|
|
48
62
|
type: :runtime
|
|
49
63
|
prerelease: false
|
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
65
|
requirements:
|
|
52
66
|
- - ">="
|
|
53
67
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 0.0.
|
|
68
|
+
version: 0.0.1
|
|
55
69
|
- !ruby/object:Gem::Dependency
|
|
56
70
|
name: rainbow
|
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -71,21 +85,16 @@ email:
|
|
|
71
85
|
- joshception@icloud.com
|
|
72
86
|
executables:
|
|
73
87
|
- olive
|
|
74
|
-
- oliver
|
|
75
88
|
extensions: []
|
|
76
89
|
extra_rdoc_files: []
|
|
77
90
|
files:
|
|
78
91
|
- ".gitignore"
|
|
79
92
|
- CONTRIBUTING.md
|
|
80
93
|
- Gemfile
|
|
81
|
-
- Gemfile.lock
|
|
82
|
-
- IDEAS.md
|
|
83
94
|
- README.md
|
|
84
95
|
- Rakefile
|
|
85
96
|
- bin/olive
|
|
86
|
-
- bin/oliver
|
|
87
97
|
- lib/oliver.rb
|
|
88
|
-
- lib/oliver/arguments.rb
|
|
89
98
|
- lib/oliver/main.rb
|
|
90
99
|
- lib/oliver/methods.rb
|
|
91
100
|
- lib/oliver/oliver_file_name.rb
|
|
@@ -111,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
111
120
|
version: '0'
|
|
112
121
|
requirements: []
|
|
113
122
|
rubyforge_project:
|
|
114
|
-
rubygems_version: 2.4.
|
|
123
|
+
rubygems_version: 2.4.0
|
|
115
124
|
signing_key:
|
|
116
125
|
specification_version: 4
|
|
117
126
|
summary: Manage your Git(Hub) easier.
|
data/Gemfile.lock
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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/bin/oliver
DELETED
data/lib/oliver/arguments.rb
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Different arguments
|
|
2
|
-
# (Make this into a case statement asap)
|
|
3
|
-
# (It'll be way easier and cleaner to work with later)
|
|
4
|
-
def different_arguments
|
|
5
|
-
if ARGV[0].downcase == 'init'
|
|
6
|
-
|
|
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."
|
|
12
|
-
end
|
|
13
|
-
else
|
|
14
|
-
puts "#{Rainbow(Name::OLIVER).red} already exists."
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
Jib.exit
|
|
18
|
-
end
|
|
19
|
-
end
|