oliver 1.5.5.2 → 1.5.5.3

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: 3687471fd017dec51585702807f53b02cbc290e5
4
- data.tar.gz: 5ba14601debdd4eaef5eea5618652e8f1921b804
3
+ metadata.gz: 718119f26160876ed08c73e056c6c6a6fac928d4
4
+ data.tar.gz: 4ab87dc3f02770f23a464839c1103b202d8734d7
5
5
  SHA512:
6
- metadata.gz: 5aece35f71de5f5a1d3c4c3a091287c2a77b644946f03c8bd3aab4d2d3c85ee6eb5a5d8ba4eda4849a9c016a1b0d344fa2bb828b2d712ceff138c651107cf56a
7
- data.tar.gz: c504c81f7fe8933de2f3b6df27b6b197fa9abb171260bf37d7aa624c08806a77a80c0717dcd371d38025e688c07421353224aaa51cae51fed882700572b17034
6
+ metadata.gz: 78717d85e30cd944a62a5ff52124a10fa4f0c2d97816a6c6d986b4a207f4b54bd405dc49e205e843215c4260dab03d12b4c10d68fce36cbdd8df8dc248bc5925
7
+ data.tar.gz: cc97d7773f5d4eb4c0332d5577cc57749dc05ba55897c4e2704c11915823ae2387767dd669e9a50f78257370e968c534e386e3dbd0f08f059b71e89029b13450
data/.gitignore CHANGED
@@ -18,6 +18,9 @@
18
18
  .repl_history
19
19
  build/
20
20
 
21
+ # I don't want Gemfile.lock
22
+ Gemfile.lock
23
+
21
24
  ## Documentation cache and generated files:
22
25
  /.yardoc/
23
26
  /_yardoc/
@@ -35,4 +38,4 @@ build/
35
38
  # .ruby-gemset
36
39
 
37
40
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
38
- .rvmrc
41
+ .rvmrc
data/Rakefile CHANGED
@@ -1,2 +1 @@
1
- require "bundler/gem_tasks"
2
-
1
+ require 'bundler/gem_tasks'
@@ -1,58 +1,55 @@
1
1
  # Help the user with their heavy troubles
2
2
  def help
3
-
4
3
  helper = [
5
4
  [
6
- "init",
5
+ 'init',
7
6
  "initializes the main directory by creating a base #{Name::OLIVER}"
8
7
  ],
9
8
 
10
9
  [
11
- "install",
10
+ 'install',
12
11
  "clones / removes directories if they're listed on the #{Name::OLIVER}"
13
12
  ],
14
13
 
15
14
  [
16
- "add username/repo",
17
- "clone repo and add it to the #{Name::OLIVER}",
15
+ 'add username/repo',
16
+ "clone repo and add it to the #{Name::OLIVER}"
18
17
  ],
19
18
 
20
19
  [
21
- "remove username/repo",
22
- "delete repo and remove it from the #{Name::OLIVER}",
20
+ 'remove username/repo',
21
+ "delete repo and remove it from the #{Name::OLIVER}"
23
22
  ],
24
23
 
25
24
  [
26
- "list",
25
+ 'list',
27
26
  "list repos currently on the #{Name::OLIVER}"
28
27
  ],
29
28
 
30
29
  [
31
- "update",
30
+ 'update',
32
31
  "pull updates from each tracked repo on the #{Name::OLIVER}"
33
32
  ],
34
33
 
35
34
  [
36
- "-v",
37
- "return oliver's version"
35
+ '-h',
36
+ 'return oliver\'s version'
38
37
  ],
39
38
 
40
39
  [
41
- "-h",
42
- "return this help menu"
40
+ '-h',
41
+ 'return this help menu'
43
42
  ]
44
43
  ]
45
44
 
46
45
  top_message = 'oliver - help / usage'
47
46
 
48
47
  puts Rainbow(top_message).red
49
- (top_message.length + 1).times { print Rainbow("=").yellow }
48
+ (top_message.length + 1).times { print Rainbow('=').yellow }
50
49
  puts
51
50
 
52
51
  helper.map do |line, blurb|
53
52
  puts "#{Rainbow(line).green} # => #{Rainbow(blurb).blue}"
54
53
  end
55
-
56
54
  exit
57
-
58
55
  end
@@ -1,6 +1,5 @@
1
1
  def init
2
-
3
- if !ARGV[1].nil?
2
+ unless ARGV[1].nil?
4
3
  if ARGV[2].nil?
5
4
  dir_name = 'olives'
6
5
  else
@@ -9,7 +8,7 @@ def init
9
8
  if ARGV[1].downcase == '--directory'
10
9
  Dir.mkdir dir_name
11
10
  Dir.chdir(dir_name)
12
- random_text = Rainbow("Changed directory").blue
11
+ random_text = Rainbow('Changed directory').blue
13
12
  puts "#{Rainbow(dir_name).green}/ has been created."
14
13
  puts "#{random_text} into #{Rainbow(dir_name).green}/."
15
14
  end
@@ -1,13 +1,12 @@
1
1
  def install
2
- if !File.file? Name::OLIVER
2
+ unless File.file? Name::OLIVER
3
3
  puts "#{Rainbow('Olivefile').red} does not exist."
4
4
  init
5
5
  end
6
6
 
7
7
  # Back up your files, man
8
- if !File.directory?('.backup')
9
- Dir.mkdir '.backup'
10
- end
8
+ backup_directory_name = '.backup'
9
+ Dir.mkdir backup_directory_name unless File.directory? backup_directory_name
11
10
 
12
11
  # The buggiest code in the world
13
12
  # (that's probably totally untrue)
@@ -15,7 +14,7 @@ def install
15
14
  final = YAML.load("---\n#{body}\n---")
16
15
 
17
16
  # Fix this ASAP
18
- if final["repos"].nil?
17
+ if final['repos'].nil?
19
18
  message = "This will normally return a bug, so I'm just not going to do it.
20
19
  You have an empty repos list, though, and that's what's causing this bug.
21
20
  Try adding something to the list for the time being."
@@ -25,14 +24,13 @@ Try adding something to the list for the time being."
25
24
 
26
25
  listed_repos = []
27
26
 
28
- final["repos"].each do |what|
27
+ final['repos'].each do |what|
29
28
  listed_repos.push(what)
30
29
  end
31
- final["repos"].each do |url|
30
+ final['repos'].each do |url|
32
31
 
33
32
  # Split the url in half
34
33
  splitted = url.split '/'
35
- username = splitted[0]
36
34
  repo = splitted[1]
37
35
  current_repos = Dir.entries '.'
38
36
  ['.', '..', '.backup', Name::OLIVER].each do |i|
@@ -41,7 +39,7 @@ Try adding something to the list for the time being."
41
39
 
42
40
  # Clone the repo if it doesn't already exist
43
41
  if !File.directory?(repo)
44
- %x(git clone git://github.com/#{url} --quiet)
42
+ `git clone git://github.com/#{url} --quiet`
45
43
  if File.directory?(repo)
46
44
  puts "#{Rainbow(repo).green}/ has been successfully cloned."
47
45
  else
@@ -54,14 +52,13 @@ Try adding something to the list for the time being."
54
52
  # If the directory doesn't exist
55
53
  # in `Name::OLIVER`, move it to .backup
56
54
  current_repos.each do |directory_thing|
57
- if !listed_repos.to_s.include? directory_thing
58
- if !File.directory?(directory_thing)
59
- %x(mv #{directory_thing} .backup)
60
- else
61
- backup_color = Rainbow('.backup/').red
62
- repo_color = Rainbow(repo).red
63
- puts "There was an error moving #{repo_color}/ to #{backup_color}"
64
- end
55
+ if !listed_repos.to_s.include?(directory_thing) &&
56
+ File.directory?(directory_thing)
57
+ `mv #{directory_thing} .backup`
58
+ else
59
+ backup_color = Rainbow('.backup/').red
60
+ repo_color = Rainbow(repo).red
61
+ puts "There was an error moving #{repo_color}/ to #{backup_color}"
65
62
  end
66
63
  end
67
64
  end
@@ -1,3 +1,3 @@
1
1
  def list
2
- puts "todo: list repos currently in the Olivefile"
2
+ puts 'todo: list repos currently in the Olivefile'
3
3
  end
@@ -1,5 +1,4 @@
1
1
  def remove
2
2
  argument?(1)
3
3
  puts "todo: remove (#{ARGV[1]}) to #{Name::OLIVER}"
4
- # puts "removed #{Rainbow(ARGV[1]).red} from #{Rainbow('Olivefile').green}."
5
4
  end
@@ -1,3 +1,3 @@
1
1
  def update
2
- puts "todo: pull updates from each tracked repo on the Olivefile"
2
+ puts 'todo: pull updates from each tracked repo on the Olivefile'
3
3
  end
@@ -34,9 +34,9 @@ def arguments
34
34
  help
35
35
  when '-v' || '--version'
36
36
  puts "#{Rainbow('oliver').red} #{Rainbow("v#{Oliver::VERSION}").green}"
37
- help
37
+ exit
38
38
  else
39
- help
39
+ help
40
40
  end
41
41
  exit
42
42
  end
data/lib/oliver/main.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  # Main oliver file
2
2
  def run_main
3
- end
3
+ end
@@ -1,3 +1,5 @@
1
+ # The main module for whatever [you]
2
+ # want the main (YAML) file to be called
1
3
  module Name
2
4
  OLIVER = 'Olivefile'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # The main module for
2
+ # Oliver's version
1
3
  module Oliver
2
- VERSION = "1.5.5.2"
4
+ VERSION = '1.5.5.3'
3
5
  end
data/lib/oliver.rb CHANGED
@@ -2,10 +2,9 @@
2
2
  # twss
3
3
  require 'rainbow'
4
4
  require 'YAML'
5
- require_relative "oliver/oliver_file_name"
6
- require_relative "oliver/arguments"
7
- require_relative "oliver/version"
8
- require_relative "oliver/main"
5
+ %w(oliver_file_name arguments version main).each do |file|
6
+ require_relative "oliver/#{file}"
7
+ end
9
8
 
10
9
  # if the user doesn't want to use rainbow
11
10
  # just disable it completely
data/oliver.gemspec CHANGED
@@ -4,18 +4,18 @@ require File.expand_path('../lib/oliver/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ['Josh']
6
6
  gem.email = ['joshception@icloud.com']
7
- gem.description = %q{Local Git(Hub) made easy.}
8
- gem.summary = %q{Manage your Git(Hub) easier.}
7
+ gem.description = 'Local Git(Hub) made easy.'
8
+ gem.summary = 'Manage your Git(Hub) easier.'
9
9
  gem.homepage = 'https://github.com/trommel/oliver'
10
10
 
11
- gem.files = `git ls-files`.split($\)
12
- gem.executables = ['olive', 'oliver']
11
+ gem.files = `git ls-files`.split($ORS)
12
+ gem.executables = %w(olive oliver)
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = 'oliver'
15
- gem.require_paths = ['oliver']
15
+ gem.require_paths = %w(oliver)
16
16
  gem.version = Oliver::VERSION
17
17
 
18
- gem.add_development_dependency "bundler", "~> 1.6"
19
- gem.add_development_dependency "rake"
18
+ gem.add_development_dependency 'bundler', '~> 1.6'
19
+ gem.add_development_dependency 'rake'
20
20
  gem.add_dependency 'rainbow', '>= 2.0.0'
21
21
  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: 1.5.5.2
4
+ version: 1.5.5.3
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-30 00:00:00.000000000 Z
11
+ date: 2014-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -64,7 +64,6 @@ files:
64
64
  - ".gitignore"
65
65
  - CONTRIBUTING.md
66
66
  - Gemfile
67
- - Gemfile.lock
68
67
  - IDEAS.md
69
68
  - LICENSE
70
69
  - README.md
data/Gemfile.lock DELETED
@@ -1,19 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- oliver (1.5.5.1)
5
- rainbow (>= 2.0.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- rainbow (2.0.0)
11
- rake (10.3.2)
12
-
13
- PLATFORMS
14
- ruby
15
-
16
- DEPENDENCIES
17
- bundler (~> 1.6)
18
- oliver!
19
- rake