oliver 1.4.2 → 1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ef0c788dae15608333f6c4b34629c6bc4467c37
4
- data.tar.gz: 5d546af001fbd1245e5859326bdd367fce5fd62b
3
+ metadata.gz: 9381f29437c38b0a0cc32e70d85763c7b4a91a4a
4
+ data.tar.gz: 9caec5420d4c832441be132ffcd7cce1f659f89b
5
5
  SHA512:
6
- metadata.gz: a0c3e1eb2b67eb67164279935432273c4bc193f5e3fa7f699e29b67c470b46579c0faee98cb3cbd70ee4b06a94cf631c6fad680bfa70868b8dff40fa36b8e745
7
- data.tar.gz: 5859887cf427ae7147f888f7b5367719a9f53e1a71586dfe10a795a0a4d60042821af7f5451d16132c167a1ca720afbcf7726a42ba84e042b7ecf602738a5a8a
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
- things to implement
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
- ```bash
215
- $ olive install
216
- ```
216
+ refer to
217
+ [IDEAS.md](https://github.com/trommel/oliver/blob/master/spec/IDEAS.md).
217
218
 
218
- it can not only install the repos on the list, but remove the repos
219
- that have been installed locally but are no longer on the list.
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
- ```bash
224
- $ olive install
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
- I spent, like, 50 minutes on this and I can't figure out a good way
228
- to do it, though, so.. yeah
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
- I'll add it as soon as I can figure it out.
231
+ sorry about doing that silly thing.
231
232
 
232
233
  testing
233
234
  =======
data/bin/oliver ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rainbow'
3
+ puts Rainbow('Use the "olive" CLI.').red
4
+ puts Rainbow('Run "olive -h" for help.').red
5
+ puts
6
+ require_relative '../lib/oliver'
@@ -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 ! ARGV[0].nil?
4
- if ARGV[0].downcase == 'init'
5
+ if ARGV[0].downcase == 'init'
5
6
 
6
- if ! File.file?(Name::OLIVER)
7
- File.open(Name::OLIVER, 'w') do |file|
8
- file.write("repos:\n")
9
- file.write(" - \"trommel/oliver\"\n")
10
- end
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
- Jib.exit
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
@@ -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
- "install",
18
- "clones / removes directories if they're listed on the #{Name::OLIVER}"
6
+ "init",
7
+ "initializes the main directory by creating a base #{Name::OLIVER}"
19
8
  ],
20
9
 
21
10
  [
22
- "init",
23
- "initializes the main directory by creating a base #{Name::OLIVER}"
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
- are_you_serious?
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
@@ -1,3 +1,3 @@
1
1
  module Oliver
2
- VERSION = "1.4.2"
2
+ VERSION = "1.5"
3
3
  end
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
- # name_install = Rainbow('oliver install')
32
- # puts "#{name_install} requires an #{Name::OLIVER} to do its magic."
33
- help
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
- other_things
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.2
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