oliver 1.8.9.7 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d712fbac0d440ce68a25827e22433c32637ccdf3
4
- data.tar.gz: f5579ba2993b54e779624590458c84a2033eecb8
3
+ metadata.gz: 62310d3009d7a1fc2737c23f862a10d414e231fc
4
+ data.tar.gz: 3402e843e55371c10234c02a4509c10ba45a4989
5
5
  SHA512:
6
- metadata.gz: beddc08fef0effee882090eb5eb6d4030d9054b6ab51f3b3a284b014c2a012922e34328aeca516c2bf443f935aee6730d10c05dc22fbb6556c43c860db4cc0f4
7
- data.tar.gz: 6d73b5844c127ee0febb1e21bdcde2a993d33b559ec92bf8be34db4f7674ae8e229862dc44425ccebac4060aec0bb111d1c0d4125b2638dcdc49a016754ef212
6
+ metadata.gz: feca6d846c2f4145d64d7938898f673b65cf7730f415ea6aaace2bbffe461135e1f358d6feca8a6821530b4d0c29b7ecef62d4804fe9bca496fc8370ef6ee65a
7
+ data.tar.gz: 17135d494ae3e0d00a8481b5000136291cd433cb9b5b48199f123930938a07e31b578ea09cf544a4d7825882f742a1f76c620f52dddffcbef9f1d02667b40d64
data/IDEAS.md CHANGED
@@ -5,25 +5,7 @@ ideas that should or have already been implemented.
5
5
 
6
6
  - [x] ~~make the backup directory hidden (`.backup`)~~
7
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
- ```
8
+ - [x] add silent mode (`--silent`) so commands will hide output
27
9
 
28
10
  - [x] when running `olive list`, list the repos that are currently in the directory against
29
11
  the repos that are currently being tracked. repos that are in both (the `Olivefile` and the current directory)
data/README.md CHANGED
@@ -3,11 +3,8 @@ oliver
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/oliver.svg)](http://badge.fury.io/rb/oliver)
5
5
 
6
- oliver manages your local GitHub projects
7
- in a simple YAML file.
8
-
9
- > "Like podfiles for Git repos."
10
- -- [@istx25](https://github.com/istx25)
6
+ oliver manages your local GitHub projects in one simple file. It's like
7
+ [CocoaPod's](http://cocoapods.org/) "podfiles", but for your Git repos.
11
8
 
12
9
  Installation
13
10
  ------------
@@ -23,45 +20,44 @@ Documentation
23
20
 
24
21
  ### Example
25
22
 
26
- Create the base `.Olivefile.yml`
23
+ Create the base `.oliver`
27
24
 
28
25
  ```bash
29
26
  $ cd projects
30
27
  $ olive init
31
- $ $EDITOR .Olivefile.yml
28
+ $ $EDITOR .oliver
32
29
  ```
33
- and then add whatever you'd like to the
34
- YAML file
35
-
36
- ```yaml
37
- ---
38
- repos:
39
- trommel:
40
- - "oliver"
41
- - "textymous"
42
- istx25:
43
- - "Fluorescent"
44
- - "dotfiles"
45
- misc:
46
- - "git://github.com/trommel/calkoolator"
47
- ---
30
+ and then add whatever you'd like to the file (write in JSON)
31
+
32
+ ```json
33
+ {
34
+ "repos": {
35
+ "trommel": [
36
+ "oliver",
37
+ "textymous"
38
+ ],
39
+ "istx25": [
40
+ "Fluorescent",
41
+ "dotfiles"
42
+ ],
43
+ "misc": [
44
+ "https://exampleserver.com/repo"
45
+ ]
46
+ }
47
+ }
48
48
  ```
49
49
 
50
- - Remember to use spaces for indentation, not tabs.
51
- - `Misc` is preferred syntax for use
52
- when there's only one repo by an author in
53
- your YAML file. With `Misc`, use the full URL
54
- (for support with non-GitHub repos)
50
+ - Use `Misc` for URLs that aren't hosted on GitHub
55
51
 
56
52
  ### Initializing the root
57
53
 
58
54
  ```bash
59
- $ olive init [-d|--directory] [directory name (defaulted to 'olives')]
55
+ $ olive init
60
56
  ```
61
57
 
62
- ### Clones/Remove repos based on YAML file
58
+ ### Clones/Remove repos based on `.olive`
63
59
 
64
- Clones repos listed in the YAML file and
60
+ Clones repos listedy and
65
61
  removes ones saved locally that aren't found
66
62
  in the file
67
63
 
@@ -77,6 +73,10 @@ List all of the repos that are being tracked
77
73
  $ olive list
78
74
  ```
79
75
 
76
+ The + (plus sign) next to the repo shows that it'll be cloned on the next
77
+ `olive install`. The # (pound sign) next to the repo
78
+ means it'll remain unaffected.
79
+
80
80
  ### Update (`git pull`) each repo
81
81
 
82
82
  Essentially run `git pull` in each
@@ -86,49 +86,22 @@ individual repo
86
86
  $ olive update
87
87
  ```
88
88
 
89
- Notes
90
- -----
91
-
92
- - Arguments after the actual arguments will be ignored, for example:
93
-
94
- ```bash
95
- # everything after "repo_name" will be ignored
96
- $ olive init -d repo_name here are more arguments
97
- ```
98
-
99
- Extras
100
- ------
101
-
102
- oliver uses [rainbow](https://github.com/sickill/rainbow), a gem for colouring the Terminal prompt.
103
- If you want to use it, just prepend `colour=on` to any olive command.
104
-
105
- If you want to enable it by default you can make a `.settings.yml` file in
106
- your directory and add some settings to it:
107
-
108
- ```YAML
109
- ---
110
- colour: "on"
111
- ---
112
- ```
113
-
114
89
  To-Do
115
90
  -----
116
91
 
117
92
  - [x] Remake the help/info thing to be slimmer & look better
118
- - [ ] Expand support to any Git, not just GitHub (why didn't I do this earlier?)
119
- - [ ] Fix bugs with..
120
- - [ ] `update` (tons)
121
- - [ ] `install` (not as many)
122
- - [ ] `list` (hardly any, I think)
93
+ - [x] Expand repo support to Git in general, not just GitHub
94
+ - [ ] Add support to `olive list` so that it'll list repos that're already cloned but not on the list (so the user knows that it's being removed on the next `olive install`)
95
+ - [ ] Clean up the mess that is [`commands.rb`](https://github.com/trommel/oliver/blob/cleanup/lib/oliver/commands.rb)
123
96
 
124
97
  Ideas
125
98
  -----
126
- Refer to [ideas.md](https://github.com/trommel/oliver/blob/master/IDEAS.md).
99
+ Refer to [ideas.md](IDEAS.md).
127
100
 
128
101
  Contribution
129
102
  ------------
130
- Refer to [contribution.md](https://github.com/trommel/oliver/blob/master/spec/CONTRIBUTING.md).
103
+ Refer to [contribution.md](CONTRIBUTING.md).
131
104
 
132
105
  Licensing
133
106
  ---------
134
- Refer to [LICENSE](https://github.com/trommel/oliver/blob/master/spec/LICENSE).
107
+ Refer to [LICENSE](LICENSE).
data/bin/olive CHANGED
@@ -1,2 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- require_relative '../lib/oliver'
2
+
3
+ lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
4
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
5
+
6
+ require 'oliver'
7
+ Oliver.run(*ARGV.map(&:downcase))
data/bin/oliver CHANGED
@@ -1,5 +1,2 @@
1
1
  #!/usr/bin/env ruby
2
- require 'rainbow'
3
- puts Rainbow('Use the "olive" CLI, it\'s cleaner.').red
4
- puts
5
- require_relative '../lib/oliver'
2
+ puts "Use the 'olive' binary"
@@ -1,72 +1,74 @@
1
- ---
2
- repos:
3
- samvermette:
4
- - "UIAlertView-Blocks"
5
- - "Montreal-Collective"
6
- - "SVSegmentedControl"
7
- - "iOS-Simulator-Raindrop"
8
- - "RaptureXML"
9
- - "emphasize.js"
10
- - "objc-geohash"
11
- - "SVStatusHUD"
12
-
13
- gcamp:
14
- - "services-to-omnifocus"
15
- - "OpenTripPlanner"
16
- - "github-omnifocus-sync"
17
-
18
- TransitApp:
19
- - "SVProgressHUD"
20
- - "SVHTTPRequest"
21
- - "SVWebViewController"
22
-
23
- misc:
24
- - "stefanceriu/SCSiriWaveformView"
25
- - "KjulyKYCircleMenu"
26
- - "chillok/AnimatedCircularCollectionMenu"
27
- - "YoApp/hey"
28
- - "opentripplanner/OpenTripPlanner"
29
- - "ghvillasboas/CloudKitTest"
30
- - "lovell/sharp"
31
- - "davidluzgouveia/ParallaxScrolling"
32
- - "ellisonleao/magictools"
33
- - "buger/gor"
34
- - "OpenRA/OpenRA"
35
- - "cocos2d/cocos2d-x"
36
- - "AdamsLair/duality"
37
- - "quicksilver/Quicksilver"
38
- - "muan/github-gmail"
39
- - "AgileBits/onepassword-app-extension"
40
- - "snowshoestamp/python_sdk"
41
- - "abraham/twitteroauth"
42
- - "rs/SDWebImage"
43
- - "maddox/regexkit"
44
- - "tonymillion/Reachability"
45
- - "ole/OBGradientView"
46
- - "stig/json-framework"
47
- - "flori/json"
48
- - "crino/instagram-ios-sdk"
49
- - "dalexsoto/HardwareInfo"
50
- - "nicklockwood/FXPageControl"
51
- - "fhsjaagshs/FHSTwitterEngine"
52
- - "enormego/EGOTableViewPullRefresh"
53
- - "Darktt/DTAlertView"
54
- - "kriskowal/transcode"
55
- - "pokeb/asi-http-request"
56
- - "Cue/CueTableReloader"
57
- - "AFNetworking/AFNetworking"
58
- - "yashigani/YSViewer"
59
- - "nicklockwood/SwipeView"
60
- - "CEWendel/SWTableViewCell"
61
- - "stefanoa/SASlideMenu"
62
- - "datwelk/RDRStickyKeyboardView"
63
- - "MacMannes/MKInfoPanel"
64
- - "jdg/MBProgressHUD"
65
- - "JLZ/JZSwipeCell"
66
- - "autresphere/ASDepthModal"
67
- - "marshluca/PolylineDemo"
68
- - "wit-ai/wit-ios-sdk"
69
- - "koenbok/Framer"
70
- - "mattdonnelly/Swifter"
71
- - "cloudapp/api"
72
- ---
1
+ {
2
+ "repos": {
3
+ "samvermette": [
4
+ "UIAlertView-Blocks",
5
+ "Montreal-Collective",
6
+ "SVSegmentedControl",
7
+ "iOS-Simulator-Raindrop",
8
+ "RaptureXML",
9
+ "emphasize.js",
10
+ "objc-geohash",
11
+ "SVStatusHUD"
12
+ ],
13
+ "gcamp": [
14
+ "services-to-omnifocus",
15
+ "OpenTripPlanner",
16
+ "github-omnifocus-sync"
17
+ ],
18
+ "TransitApp": [
19
+ "SVProgressHUD",
20
+ "SVHTTPRequest",
21
+ "SVWebViewController"
22
+ ],
23
+ "misc": [
24
+ "stefanceriu/SCSiriWaveformView",
25
+ "KjulyKYCircleMenu",
26
+ "chillok/AnimatedCircularCollectionMenu",
27
+ "YoApp/hey",
28
+ "opentripplanner/OpenTripPlanner",
29
+ "ghvillasboas/CloudKitTest",
30
+ "lovell/sharp",
31
+ "davidluzgouveia/ParallaxScrolling",
32
+ "ellisonleao/magictools",
33
+ "buger/gor",
34
+ "OpenRA/OpenRA",
35
+ "cocos2d/cocos2d-x",
36
+ "AdamsLair/duality",
37
+ "quicksilver/Quicksilver",
38
+ "muan/github-gmail",
39
+ "AgileBits/onepassword-app-extension",
40
+ "snowshoestamp/python_sdk",
41
+ "abraham/twitteroauth",
42
+ "rs/SDWebImage",
43
+ "maddox/regexkit",
44
+ "tonymillion/Reachability",
45
+ "ole/OBGradientView",
46
+ "stig/json-framework",
47
+ "flori/json",
48
+ "crino/instagram-ios-sdk",
49
+ "dalexsoto/HardwareInfo",
50
+ "nicklockwood/FXPageControl",
51
+ "fhsjaagshs/FHSTwitterEngine",
52
+ "enormego/EGOTableViewPullRefresh",
53
+ "Darktt/DTAlertView",
54
+ "kriskowal/transcode",
55
+ "pokeb/asi-http-request",
56
+ "Cue/CueTableReloader",
57
+ "AFNetworking/AFNetworking",
58
+ "yashigani/YSViewer",
59
+ "nicklockwood/SwipeView",
60
+ "CEWendel/SWTableViewCell",
61
+ "stefanoa/SASlideMenu",
62
+ "datwelk/RDRStickyKeyboardView",
63
+ "MacMannes/MKInfoPanel",
64
+ "jdg/MBProgressHUD",
65
+ "JLZ/JZSwipeCell",
66
+ "autresphere/ASDepthModal",
67
+ "marshluca/PolylineDemo",
68
+ "wit-ai/wit-ios-sdk",
69
+ "koenbok/Framer",
70
+ "mattdonnelly/Swifter",
71
+ "cloudapp/api"
72
+ ]
73
+ }
74
+ }
@@ -0,0 +1,105 @@
1
+ require 'json'
2
+ require 'git'
3
+ require 'fileutils'
4
+ require_relative 'file_name'
5
+ require_relative 'file_manager'
6
+
7
+ # Main commands
8
+ module Oliver
9
+ module_function
10
+
11
+ def init(options)
12
+ options = options[:options]
13
+ unless File.exists?(Oliver::NAME)
14
+ File.open(Oliver::NAME, 'w') do |file|
15
+ tempHash = { repos: { trommel: ["oliver"] } }
16
+ file.write(JSON.pretty_generate(tempHash))
17
+ puts "#{Oliver::NAME} created sucessfully" if options[:verbose]
18
+ end
19
+ end
20
+ end
21
+
22
+ # I'm honestly ashamed of this piece of shit, it's hack as fuck
23
+ def install(options)
24
+ options = options[:options] # DRY
25
+ unless FileManager::BODY.nil?
26
+ FileManager::BODY['repos'].map do |user, repos|
27
+ user ||= ''
28
+ repos ||= []
29
+
30
+ # Add options[:verbose] support as soon as this doesn't look awful
31
+ unless user.empty? || repos.nil?
32
+ repos.each do |repo|
33
+ if File.directory?(repo)
34
+ puts "Warning: #{repo}/ already exists"
35
+ else
36
+ if user.downcase == 'misc'
37
+ cloned_repo = Git.clone(repo, repo.split('/').last, :path => '.')
38
+ else
39
+ cloned_repo = Git.clone(
40
+ "https://github.com/#{user}/#{repo}",
41
+ repo,
42
+ :path => '.'
43
+ )
44
+ end
45
+ if File.directory?(repo) || File.directory?(repo.split('/').last)
46
+ puts "Success: #{repo}/ has been cloned"
47
+ else
48
+ puts "Warning: #{repo}/ failed to clone"
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+
55
+ dirRepos = Dir.entries('.').reject do |f|
56
+ f['.'] || f['..'] || f[Oliver::NAME]
57
+ end
58
+ dirRepos.sort!
59
+
60
+ trackedRepos = FileManager::BODY['repos'].map do |user, repos|
61
+ repos.select { |repo| repo }
62
+ end
63
+ trackedRepos.sort!
64
+ trackedRepos = trackedRepos.first
65
+
66
+ unless dirRepos == trackedRepos
67
+ dirRepos ||= []
68
+ trackedRepos ||= []
69
+ dirRepos -= trackedRepos
70
+ unless dirRepos.empty?
71
+ dirRepos.each do |dirRepo|
72
+ print "Warning: Enter '#{dirRepo}' to locally delete the repo: "
73
+ FileUtils.rm_rf(dirRepo) if STDIN.gets.chomp.downcase == dirRepo
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
79
+
80
+ def list
81
+ FileManager::BODY["repos"].map do |user, repos|
82
+ repos ||= []
83
+ # Add silent shit later when it's actually working
84
+ unless repos.empty?
85
+ repos.each do |repo|
86
+ if File.directory?(repo) then print '# ' else print '+ ' end # bugs
87
+ puts repo
88
+ end
89
+ end
90
+ end
91
+ end
92
+
93
+ # Still buggy, afaik
94
+ def update(options)
95
+ options = options[:options] # DRY
96
+ dirs = Dir.glob('*').select { |f| File.directory? f }
97
+ dirs.each do |dir|
98
+ Dir.chdir(dir)
99
+ g = Git.open(Dir.pwd)
100
+ pull = g.pull
101
+ puts "#{dir}/ has been updated" unless pull.include? 'Already up-to-date'
102
+ Dir.chdir('..')
103
+ end
104
+ end
105
+ end
@@ -1,11 +1,18 @@
1
- require 'yaml'
1
+ require 'json'
2
+
3
+ # Reads and parses the .olive file
2
4
  module FileManager
3
- if File.file? Name::OLIVER
4
- body = File.read(Name::OLIVER)
5
- YAML = YAML.load(body)
5
+ if File.file?(Oliver::NAME)
6
+ body = File.read(Oliver::NAME)
7
+ BODY = JSON.parse(body)
6
8
  else
9
+ <<<<<<< HEAD
7
10
  puts "#{Rainbow(Name::OLIVER).red} does not exist."
8
11
  YAML = nil
9
12
  exit
13
+ =======
14
+ puts "#{Oliver::NAME} does not exist."
15
+ BODY = nil
16
+ >>>>>>> cleanup
10
17
  end
11
18
  end
@@ -0,0 +1,4 @@
1
+ # Oliver's file name that the user edits
2
+ module Oliver
3
+ NAME = '.oliver'
4
+ end
@@ -0,0 +1,10 @@
1
+ # Add a method to hash for easier conversion of keys to string
2
+ class Hash
3
+ def keys_to_s
4
+ commands = keys.to_s
5
+ commands.tr!(':', '')
6
+ commands.tr!('[', '')
7
+ commands.tr!(']', '')
8
+ commands.split(', ')
9
+ end
10
+ end
@@ -1,8 +1,9 @@
1
+ require 'yaml'
2
+
1
3
  # Load .settings.yml to get user settings set to default
2
4
  # For example, if the user specifies colour=on, do that by default
3
5
  # Make this short and concise if possible
4
6
 
5
- require 'yaml'
6
7
  module SettingsManager
7
8
  settingsName = '.settings.yml'
8
9
  if File.file? settingsName
@@ -1,5 +1,4 @@
1
- # The main module for
2
1
  # Oliver's version
3
2
  module Oliver
4
- VERSION = '1.8.9.7'
3
+ VERSION = '2.0'
5
4
  end
data/lib/oliver.rb CHANGED
@@ -1,5 +1,85 @@
1
- # Require files
2
- require 'rainbow'
1
+ require_relative 'oliver/hash'
2
+ require_relative 'oliver/version'
3
3
 
4
- # Arguments
5
- require_relative 'oliver/arguments'
4
+ # Main Oliver module
5
+ module Oliver
6
+ module_function
7
+
8
+ def command
9
+ @command ||= ''
10
+ end
11
+
12
+ def run(*args)
13
+ if args.empty?
14
+ advice
15
+ else
16
+ process args
17
+ end
18
+ end
19
+
20
+ def process(*args)
21
+ # Address 'passing through methods' issues (nesting arrays)
22
+ args = args.first
23
+
24
+ # Store commands
25
+ @command = ''
26
+
27
+ # Get strings of keys of commands
28
+ basicCommands = advice(silent:true).keys_to_s
29
+
30
+ # Command-line arguments
31
+ @options = { verbose: true }
32
+
33
+ # Option parsing, essentially
34
+ until args.empty?
35
+ case arg = args.shift
36
+ when '--silent' then @options[:verbose] = false
37
+ when '--directory' then @options[:directory] = true
38
+ when 'version', '--version' then puts "oliver v#{Oliver::VERSION}"
39
+ when 'help', '--help' then assist
40
+ when *basicCommands
41
+ @command << arg + ' '
42
+ else
43
+ puts "Unknown command: #{arg}"
44
+ advice
45
+ # exit
46
+ end
47
+ end
48
+
49
+ # Build the command and do what you must
50
+ build @command unless @command.empty?
51
+ end
52
+
53
+ def advice(info={}) # since help is a Ruby keyword
54
+ advice = {
55
+ init: 'initializes the main directory by creating a base dotfile',
56
+ install: 'clones/removes repos if they\'re listed',
57
+ list: 'list user repos',
58
+ update: 'pull updates from each tracked repo',
59
+ version: 'return the current version',
60
+ help: 'return this help menu'
61
+ }
62
+
63
+ unless info[:silent]
64
+ puts 'usage: olive [command] [arguments]'
65
+ advice.map { |key, value| puts "#{key} \t#{value}" }
66
+ end
67
+
68
+ advice # return advice
69
+ end
70
+
71
+ def build(commands)
72
+ require_relative 'oliver/commands'
73
+ @command = @command.split(' ')
74
+ case @command.first
75
+ when 'init'
76
+ init(options:@options)
77
+ when 'install'
78
+ install(optoins:@options)
79
+ when 'list'
80
+ list
81
+ when 'update'
82
+ update(optoins:@options)
83
+ else end
84
+ end
85
+ end
data/oliver.gemspec CHANGED
@@ -2,10 +2,10 @@
2
2
  require File.expand_path('../lib/oliver/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
- gem.authors = ['Josh']
6
- gem.email = ['joshception@icloud.com']
5
+ gem.authors = ['Josh Trommel']
6
+ gem.email = ['joshtrommel@gmail.com']
7
7
  gem.description = 'Local Git(Hub) made easy.'
8
- gem.summary = 'Manage your Git(Hub) repos / projects easier.'
8
+ gem.summary = 'Manage your Git(Hub) repos/projects easier.'
9
9
  gem.homepage = 'https://github.com/trommel/oliver'
10
10
 
11
11
  gem.files = `git ls-files`.split($ORS)
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.version = Oliver::VERSION
17
17
 
18
18
  gem.add_development_dependency 'bundler', '~> 1.6'
19
- gem.add_development_dependency 'rake'
20
- gem.add_dependency 'rainbow', '~> 2.0', '>= 2.0.0'
21
- gem.add_dependency 'git', '~> 1.2', '>= 1.2.8'
19
+ gem.add_development_dependency 'rake', '~> 0'
20
+ gem.add_dependency 'git', '~> 1.2.9', '>= 1.2.8'
21
+ gem.add_dependency 'json', '~> 1.8.2', '>= 1.8.0'
22
22
  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.8.9.7
4
+ version: '2.0'
5
5
  platform: ruby
6
6
  authors:
7
- - Josh
7
+ - Josh Trommel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-30 00:00:00.000000000 Z
11
+ date: 2015-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,59 +28,59 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rainbow
42
+ name: git
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: 1.2.9
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
- version: 2.0.0
50
+ version: 1.2.8
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
- version: '2.0'
57
+ version: 1.2.9
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 2.0.0
60
+ version: 1.2.8
61
61
  - !ruby/object:Gem::Dependency
62
- name: git
62
+ name: json
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '1.2'
67
+ version: 1.8.2
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: 1.2.8
70
+ version: 1.8.0
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - "~>"
76
76
  - !ruby/object:Gem::Version
77
- version: '1.2'
77
+ version: 1.8.2
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 1.2.8
80
+ version: 1.8.0
81
81
  description: Local Git(Hub) made easy.
82
82
  email:
83
- - joshception@icloud.com
83
+ - joshtrommel@gmail.com
84
84
  executables:
85
85
  - olive
86
86
  - oliver
@@ -99,14 +99,10 @@ files:
99
99
  - community/README.md
100
100
  - community/iOS-external-libraries-istx25.yml
101
101
  - lib/oliver.rb
102
- - lib/oliver/argument_files/help.rb
103
- - lib/oliver/argument_files/init.rb
104
- - lib/oliver/argument_files/install.rb
105
- - lib/oliver/argument_files/list.rb
106
- - lib/oliver/argument_files/update.rb
107
- - lib/oliver/arguments.rb
102
+ - lib/oliver/commands.rb
108
103
  - lib/oliver/file_manager.rb
109
- - lib/oliver/oliver_file_name.rb
104
+ - lib/oliver/file_name.rb
105
+ - lib/oliver/hash.rb
110
106
  - lib/oliver/settings.rb
111
107
  - lib/oliver/version.rb
112
108
  - oliver.gemspec
@@ -129,8 +125,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
125
  version: '0'
130
126
  requirements: []
131
127
  rubyforge_project:
132
- rubygems_version: 2.4.3
128
+ rubygems_version: 2.4.6
133
129
  signing_key:
134
130
  specification_version: 4
135
- summary: Manage your Git(Hub) repos / projects easier.
131
+ summary: Manage your Git(Hub) repos/projects easier.
136
132
  test_files: []
@@ -1,43 +0,0 @@
1
- require_relative '../oliver_file_name'
2
- # Help the user with their heavy troubles
3
- helper = [
4
- [
5
- 'init',
6
- "initializes the main directory by creating a base dotfile"
7
- ],
8
-
9
- [
10
- 'install',
11
- "clones/removes repos if they're listed"
12
- ],
13
-
14
- [
15
- 'list',
16
- "list repos currently on #{Name::OLIVER}"
17
- ],
18
-
19
- [
20
- 'update',
21
- "pull updates from each tracked repo"
22
- ],
23
-
24
- [
25
- '-v',
26
- 'return oliver\'s version'
27
- ],
28
-
29
- [
30
- '-h',
31
- 'return this help menu'
32
- ]
33
- ]
34
-
35
- top_message = 'oliver - help / usage'
36
-
37
- puts Rainbow(top_message).red
38
- (top_message.length + 1).times { print Rainbow('=').yellow }
39
- puts
40
-
41
- helper.map do |line, blurb|
42
- puts "#{Rainbow(line).green} # => #{Rainbow(blurb).blue}"
43
- end
@@ -1,31 +0,0 @@
1
- require_relative '../oliver_file_name'
2
- unless ARGV[1].nil?
3
- if ARGV[2].nil?
4
- dir_name = 'olives'
5
- else
6
- dir_name = ARGV[2]
7
- end
8
- if ARGV[1].downcase == '--directory' || ARGV[1].downcase == '-d'
9
- if !File.directory?(dir_name)
10
- Dir.mkdir(dir_name)
11
- Dir.chdir(dir_name)
12
- else
13
- puts "#{Rainbow('Error').underline.red}: #{dir_name}/ already exists."
14
- exit
15
- end
16
- puts "#{Rainbow(dir_name).green}/ has been created."
17
- end
18
- end
19
-
20
- if !File.file?(Name::OLIVER)
21
- File.open(Name::OLIVER, 'w') do |file|
22
- file.write("---\nrepos:\n")
23
- file.write(" trommel:\n - \"oliver\"\n---\n")
24
- dir_name = '.' if dir_name.nil?
25
- green_dir_name = Rainbow(dir_name).green
26
- green_oliver_file_name = Rainbow(Name::OLIVER).green
27
- puts "#{green_dir_name}/#{green_oliver_file_name} has been created."
28
- end
29
- else
30
- puts "#{Rainbow(Name::OLIVER).red} already exists."
31
- end
@@ -1,94 +0,0 @@
1
- require_relative '../file_manager'
2
- require 'fileutils'
3
- require 'git'
4
-
5
- # Success, warning and error messages
6
- # (Make these public, sometime)
7
- success = "#{Rainbow('Success').underline.green}:"
8
- warning = "#{Rainbow('Warning').underline.yellow}:"
9
- error = "#{Rainbow('Error').underline.red}:"
10
-
11
- # Fix this ASAP
12
- if FileManager::YAML['repos'].nil?
13
- message = "This will normally return a bug, so I'm just not going to do it.
14
- You have an empty repos list, though, and that's what's causing this bug.
15
- Try adding something to the list for the time being."
16
- puts Rainbow(message).red
17
- exit
18
- end
19
-
20
- # Create the empty listed_repos array for later
21
- listed_repos = []
22
-
23
- # Map out the username and repos(array)
24
- FileManager::YAML['repos'].map do |username, repos|
25
- # Exit with error if the username or repos is empty
26
- if username.nil?
27
- puts "#{error} Your usernames look a little nil."
28
- exit
29
- end
30
- if repos.nil?
31
- puts "#{error} Your repos look a little nil."
32
- exit
33
- end
34
- # Assign individual repo from repos array
35
- repos.each do |repo|
36
- # Add each repo to the listed_repos array
37
- repos.each do |repo|
38
- listed_repos.push(repo)
39
- end
40
- if username.downcase == 'misc'
41
- split = repo.split('/')
42
- last_of_url = split.last
43
- if !File.directory?(last_of_url)
44
- repo_replaced = last_of_url.gsub('/', '-')
45
- cloned_repo = Git.clone(
46
- repo,
47
- repo_replaced,
48
- :path => '.'
49
- )
50
- if File.directory?(repo_replaced)
51
- puts "#{success} #{split[1]}/ was cloned."
52
- else
53
- puts "#{error} #{split[1]} was not cloned."
54
- end
55
- end
56
- exit
57
- end
58
- if !File.directory?(repo)
59
- # Clone the repo if the directory doesn't already exist
60
- cloned_repo = Git.clone("
61
- git://github.com/#{username}/#{repo}",
62
- repo,
63
- :path => '.'
64
- )
65
- if File.directory?(repo)
66
- # If the directory exists after the repo
67
- # has been cloned, give a success message
68
- puts "#{success} #{repo}/ has been cloned."
69
- else
70
- # If the directory doesn't exist after the
71
- # has been cloned, give an error message
72
- puts "#{error} Cloning #{repo}/ failed."
73
- end
74
- else
75
- # Give a warning message if the repo already exists
76
- puts "#{warning} #{repo}/ already exists."
77
- end
78
- end
79
- end
80
-
81
- # If the directory doesn't exist
82
- # in `Name::OLIVER`, delete it
83
- # This is an extreme hack
84
- current_repos = Dir.entries '.'
85
- ['.', '..', '.backup', Name::OLIVER].each do |i|
86
- current_repos.delete(i)
87
- end
88
- current_repos.each do |directory|
89
- unless listed_repos.to_s.include?(directory) &&
90
- File.directory?(directory)
91
- print "#{warning} Enter '#{directory}' to locally delete the repo: "
92
- FileUtils.rm_rf(directory) if STDIN.gets.chomp.downcase == directory
93
- end
94
- end
@@ -1,28 +0,0 @@
1
- require_relative '../file_manager'
2
-
3
- # counter = 0
4
- begin
5
- FileManager::YAML['repos'].map do |username, repos|
6
- if repos.nil?
7
- puts "#{Rainbow('Error').red.underline}: Your repos look a little nil."
8
- exit
9
- end
10
- repos.each do |repo|
11
- if File.directory?(repo)
12
- if Rainbow.enabled
13
- puts Rainbow(repo).green
14
- else
15
- puts Rainbow("+ #{repo}").green
16
- end
17
- else
18
- if Rainbow.enabled
19
- puts Rainbow(repo).red
20
- else
21
- puts Rainbow("- #{repo}").red
22
- end
23
- end
24
- # print "\t" if counter % 4 == 0
25
- # counter += 1
26
- end
27
- end
28
- end
@@ -1,11 +0,0 @@
1
- require_relative '../oliver_file_name'
2
- require 'git'
3
- dirs = Dir.glob('*').select { |f| File.directory? f }
4
- puts 'theoretically this should work but there will be tons of bugs' # enjoy!!
5
- dirs.each do |dir|
6
- Dir.chdir(dir)
7
- g = Git.open(Dir.pwd)
8
- pull = g.pull
9
- puts "#{dir}/ has been updated." if !pull.include? 'Already up-to-date'
10
- Dir.chdir('..')
11
- end
@@ -1,48 +0,0 @@
1
- # Require files
2
- require_relative 'oliver_file_name'
3
- require_relative 'version'
4
-
5
- def help
6
- require_relative 'argument_files/help'
7
- end
8
-
9
- # Default options
10
- options = {
11
- :verbose => true,
12
- :silent => false,
13
- :directory => false,
14
- :colour => ARGV[-1] == 'colour=on'
15
- }
16
-
17
- # Enable/Disable Rainbow
18
- Rainbow.enabled = options[:colour]
19
-
20
- # Check .settings.yml
21
- require_relative 'settings'
22
-
23
- # Help if user doesn't specify proper arguments
24
- if ARGV.empty? || ARGV[0] == 'colour=on'
25
- help
26
- else
27
- # Case for arguments
28
- case ARGV[0].downcase
29
- when 'colour=on'
30
- help
31
- exit
32
- when 'install'
33
- require_relative 'argument_files/install'
34
- when 'init'
35
- require_relative 'argument_files/init'
36
- when 'list'
37
- require_relative 'argument_files/list'
38
- when 'update'
39
- require_relative 'argument_files/update'
40
- when '-h', '--help', 'help'
41
- help
42
- when '-v', '--version', 'version'
43
- puts "#{Rainbow('oliver').red} #{Rainbow("v#{Oliver::VERSION}").green}"
44
- exit
45
- else
46
- puts "#{Rainbow('Error').underline.red}: Unknown argument: #{ARGV[0]}"
47
- end
48
- end
@@ -1,5 +0,0 @@
1
- # The main module for whatever [you]
2
- # want the main (YAML) file to be called
3
- module Name
4
- OLIVER = '.Olivefile.yml'
5
- end