oliver 1.5.5.4 → 1.6

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: 0da3f48fc45c3de9ac3dcfcde1422c03def26b49
4
- data.tar.gz: 7429404cf832f5c19c7bf549c81ca74368b7eef0
3
+ metadata.gz: 4af3688c06c34ba541101275bb794e4d8f1b7ee8
4
+ data.tar.gz: 94916f75e4089d6c0e6ed0ca62c9f7ea4d6ab4ec
5
5
  SHA512:
6
- metadata.gz: 545b4a58c8e305032e18f1f914510630a33c572bb9889e9b34a48938ac2cc60cb4c33acb517ec54aef03d0f4aed0beb0adda9349a7b8fd5ecb357575f4a3d01e
7
- data.tar.gz: 4e7819be1707880c01a1b0a121cac61f01d0b7dcca85bc62ac38d9b0e54469e675c65478182e0c0e8866619b795697477ce5424fef86592ec75a19f23d2c4b0f
6
+ metadata.gz: ffe7cfa88565830732dbef384f9a065279b86976784e9d6fb18641f5293929fd5b08ca90a1b8f0324702e7f36f85f3baf75d18b03a7387dd1a14532c3bce19f0
7
+ data.tar.gz: 441ad35e2ae3e18a51b4817920f4761bb684eafe1f90dd169fb525ab45a544d8c1c93e03c3dd95c657cfc57dba0c2df46808e7fcae4338718ae23c428ee5b53a
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in ramona.gemspec
3
+ # Specify your gem's dependencies in oliver.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -194,6 +194,13 @@ of the project, `olive` is the name of the CLI.
194
194
  is defaulted), just use the full git URL instead of the simple
195
195
  `username/repo-name`, for example `git://projects.josh.com/oliver.git`.
196
196
 
197
+ - arguments after the actual arguments will be ignored, i.e.:
198
+
199
+ ```bash
200
+ # everything after -d will be ignored
201
+ $ olive init -d hey here are more arguments
202
+ ```
203
+
197
204
  branches
198
205
  ========
199
206
 
@@ -213,13 +220,22 @@ branch, if you want to check it out.
213
220
  the official gem that's hosted on rubygems, though, is
214
221
  the gem of the master branch, and that's how it's going to stay.
215
222
 
216
- also, the unstable branch probably won't work.
223
+ also, the unstable branch probably maybe won't work.
224
+
225
+ there also might be a "clean" branch, which is basically a (possibly) outdated
226
+ version of oliver that'll backup your directories when you run `olive install`
227
+ (if the repo isn't on the list of repos to track). the master branch
228
+ is now considered "unsafe", meaning that it will simply delete the repo
229
+ if it's not on the list when `olive install` is run.
230
+
231
+ this is probably maybe a bad idea, but it's a lot easier to maintain.
232
+ if you don't like this, fix it, and make it work properly :)
217
233
 
218
234
  ideas
219
235
  -----
220
236
 
221
237
  refer to
222
- [IDEAS.md](https://github.com/trommel/oliver/blob/master/spec/IDEAS.md).
238
+ [IDEAS.md](https://github.com/trommel/oliver/blob/master/LICENSE).
223
239
 
224
240
  versions
225
241
  --------
@@ -16,7 +16,7 @@ def init
16
16
  File.open(Name::OLIVER, 'w') do |file|
17
17
  file.write("repos:\n")
18
18
  file.write(" - \"trommel/oliver\"\n")
19
- puts "#{Rainbow(Name::OLIVER).green} has been created."
19
+ puts "#{Rainbow(dir_name).green}/#{Rainbow(Name::OLIVER).green} has been created."
20
20
  end
21
21
  else
22
22
  puts "#{Rainbow(Name::OLIVER).red} already exists."
@@ -1,20 +1,11 @@
1
1
  def install
2
- unless File.file? Name::OLIVER
3
- puts "#{Rainbow('Olivefile').red} does not exist."
4
- init
5
- end
6
2
 
7
3
  # Back up your files, man
8
- backup_directory_name = '.backup'
9
- Dir.mkdir backup_directory_name unless File.directory? backup_directory_name
10
-
11
- # The buggiest code in the world
12
- # (that's probably totally untrue)
13
- body = File.read(Name::OLIVER.chomp)
14
- final = YAML.load("---\n#{body}\n---")
4
+ # backup_directory_name = '.backup'
5
+ # Dir.mkdir backup_directory_name unless File.directory? backup_directory_name
15
6
 
16
7
  # Fix this ASAP
17
- if final['repos'].nil?
8
+ if $final['repos'].nil?
18
9
  message = "This will normally return a bug, so I'm just not going to do it.
19
10
  You have an empty repos list, though, and that's what's causing this bug.
20
11
  Try adding something to the list for the time being."
@@ -24,10 +15,10 @@ Try adding something to the list for the time being."
24
15
 
25
16
  listed_repos = []
26
17
 
27
- final['repos'].each do |what|
18
+ $final['repos'].each do |what|
28
19
  listed_repos.push(what)
29
20
  end
30
- final['repos'].each do |url|
21
+ $final['repos'].each do |url|
31
22
 
32
23
  # Split the url in half
33
24
  splitted = url.split '/'
@@ -54,11 +45,12 @@ Try adding something to the list for the time being."
54
45
  current_repos.each do |directory_thing|
55
46
  if !listed_repos.to_s.include?(directory_thing) &&
56
47
  File.directory?(directory_thing)
57
- `mv #{directory_thing} .backup`
48
+ `yes | rm -r #{directory_thing}`
49
+ # `mv #{directory_thing} .backup`
58
50
  else
59
- backup_color = Rainbow('.backup/').red
51
+ backup_color = Rainbow('.backup').red
60
52
  repo_color = Rainbow(repo).red
61
- puts "There was an error moving #{repo_color}/ to #{backup_color}"
53
+ puts "There was an error moving #{repo_color}/ to #{backup_color}/"
62
54
  end
63
55
  end
64
56
  end
@@ -1,3 +1,30 @@
1
+ # For later (possible) Hash implementation
2
+ # def list
3
+ # listed_repos = []
4
+ # # todo: if user has multiple repos,
5
+ # # have one user key with an array of
6
+ # # the user's repos
7
+ # $final['repos'].each do |thing|
8
+ # new_thing = thing.split('/')
9
+ # listed_repos.push(new_thing)
10
+ # end
11
+ # puts listed_repos.to_h
12
+ # end
13
+
14
+ # Simple enough :P
1
15
  def list
2
- puts 'todo: list repos currently in the Olivefile'
16
+ counter = 0
17
+ $final['repos'].each do |thing|
18
+ repo = thing.split('/')[1] # might as well discard the username
19
+ if File.directory?(repo)
20
+ print Rainbow(repo).green
21
+ else
22
+ print Rainbow(repo).red
23
+ end
24
+ if counter % 4 == 0
25
+ print "\t"
26
+ end
27
+ counter =+ 1
28
+ end
29
+ puts
3
30
  end
@@ -19,16 +19,22 @@ end
19
19
  def arguments
20
20
  case ARGV[0].downcase
21
21
  when 'install'
22
+ file_manager
22
23
  install
23
24
  when 'init'
25
+ file_manager
24
26
  init
25
27
  when 'list'
28
+ file_manager
26
29
  list
27
30
  when 'update'
31
+ file_manager
28
32
  update
29
33
  when 'add'
34
+ file_manager
30
35
  add
31
36
  when 'remove'
37
+ file_manager
32
38
  remove
33
39
  when 'help'
34
40
  help
@@ -36,7 +42,7 @@ def arguments
36
42
  puts "#{Rainbow('oliver').red} #{Rainbow("v#{Oliver::VERSION}").green}"
37
43
  exit
38
44
  else
39
- help
45
+ puts "#{Rainbow('Error').underline.red}: Unknown argument: #{ARGV[0]}"
40
46
  end
41
47
  exit
42
48
  end
@@ -0,0 +1,10 @@
1
+ def file_manager
2
+ unless ARGV.nil?
3
+ if File.file? Name::OLIVER
4
+ body = File.read(Name::OLIVER.chomp)
5
+ $final = YAML.load("---\n#{body}\n---")
6
+ else
7
+ puts "#{Rainbow(Name::OLIVER).red} does not exist."
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # The main module for
2
2
  # Oliver's version
3
3
  module Oliver
4
- VERSION = '1.5.5.4'
4
+ VERSION = '1.6'
5
5
  end
data/lib/oliver.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # twss
3
3
  require 'rainbow'
4
4
  require 'YAML'
5
- %w(oliver_file_name arguments version main).each do |file|
5
+ %w(oliver_file_name file_manager arguments version main).each do |file|
6
6
  require_relative "oliver/#{file}"
7
7
  end
8
8
 
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: 1.5.5.4
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-01 00:00:00.000000000 Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,6 +79,7 @@ files:
79
79
  - lib/oliver/argument_files/remove.rb
80
80
  - lib/oliver/argument_files/update.rb
81
81
  - lib/oliver/arguments.rb
82
+ - lib/oliver/file_manager.rb
82
83
  - lib/oliver/main.rb
83
84
  - lib/oliver/oliver_file_name.rb
84
85
  - lib/oliver/version.rb