repo_man 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +11 -0
- data/bin/repo +47 -0
- data/lib/repo_man.rb +5 -0
- data/lib/repo_man/version.rb +3 -0
- data/repo_man.gemspec +25 -0
- data/spec/repo_man_spec.rb +9 -0
- metadata +113 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: de9b504d1d623da71e247e41cb2fd388ae7fa732
|
4
|
+
data.tar.gz: 1970072837fefc9cde889903d215d86e7ad9e38e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b5ad8149437de0e715f519637e3bd9949f4add4c6be4ebdae4dcf0980d134d2486ebb43d7c2939c7dcceec6fee4f256cb95cbb686d2afa4afc937f344f6ab005
|
7
|
+
data.tar.gz: d8d65404cf829342c4cc5daa3333a4629a4894d21f6a20d2357e9962ceba596f86489bb7a207803b1f06ae178777c2bf27ad59e7cb177dc02fb6fdf3a4d6483d
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Brook Riggio
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# RepoMan
|
2
|
+
|
3
|
+
Get all the repos for a GitHub user under one roof.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install it from the command line with:
|
8
|
+
|
9
|
+
$ gem install repo_man
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
Use the binary from any directory that has a name matching a github user:
|
14
|
+
|
15
|
+
$ mkdir whymirror && cd whymirror
|
16
|
+
$ repo fetch
|
17
|
+
|
18
|
+
When you want those repos all refreshed with the latest:
|
19
|
+
|
20
|
+
$ cd whymirror
|
21
|
+
$ repo update
|
22
|
+
|
23
|
+
The directory name (in which the `repo` command is executed) is taken as the GitHub account name whose repos you want to manipulate.
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it ( https://github.com/brookr/repo_man/fork )
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/repo
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'thor'
|
3
|
+
require 'github_api'
|
4
|
+
|
5
|
+
class RepoMan < Thor
|
6
|
+
class_option :pretend, type: :boolean, desc: "Don't actually make any changes"
|
7
|
+
|
8
|
+
desc 'fetch', 'Fetches all repos into the current directory'
|
9
|
+
def fetch
|
10
|
+
puts "Now cloning #{repos.size} repos from #{username}..."
|
11
|
+
|
12
|
+
repos.each do |r|
|
13
|
+
run("git clone #{r.ssh_url}") unless Dir.exists?(r.name)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
desc 'update', 'Updates all existing repos in the current directory'
|
18
|
+
def update
|
19
|
+
puts 'Checking all current repos for updates...'
|
20
|
+
|
21
|
+
repos.each do |r|
|
22
|
+
run("cd #{r.name} && pwd && git pull --all") if Dir.exists?(r.name)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
private
|
26
|
+
|
27
|
+
def repos
|
28
|
+
@repos ||= github.repos.list user: username
|
29
|
+
end
|
30
|
+
|
31
|
+
def username
|
32
|
+
@username ||= Dir.pwd.split(File::Separator).last
|
33
|
+
end
|
34
|
+
|
35
|
+
def github
|
36
|
+
@github ||= Github.new(
|
37
|
+
auto_pagination: true,
|
38
|
+
oauth_token: '184614cd99a078b2ecd8e8ba21f85f83b4746d7d')
|
39
|
+
end
|
40
|
+
|
41
|
+
def run(cmd)
|
42
|
+
puts cmd
|
43
|
+
puts `#{cmd}` unless options[:pretend]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
RepoMan.start
|
data/lib/repo_man.rb
ADDED
data/repo_man.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'repo_man/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "repo_man"
|
8
|
+
spec.version = RepoMan::VERSION
|
9
|
+
spec.authors = ["Brook Riggio"]
|
10
|
+
spec.email = ["brook@codefellows.org"]
|
11
|
+
spec.summary = %q{Keep the repos under one roof.}
|
12
|
+
spec.description = %q{Track all the repos for a GitHub user from one parent directory}
|
13
|
+
spec.homepage = "https://github.com/brookr/repo_man"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "thor", "~> 0.19"
|
24
|
+
spec.add_development_dependency "github_api", "~> 0.12"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: repo_man
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Brook Riggio
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-10-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: thor
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.19'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.19'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: github_api
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.12'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.12'
|
69
|
+
description: Track all the repos for a GitHub user from one parent directory
|
70
|
+
email:
|
71
|
+
- brook@codefellows.org
|
72
|
+
executables:
|
73
|
+
- repo
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/repo
|
83
|
+
- lib/repo_man.rb
|
84
|
+
- lib/repo_man/version.rb
|
85
|
+
- repo_man.gemspec
|
86
|
+
- spec/repo_man_spec.rb
|
87
|
+
homepage: https://github.com/brookr/repo_man
|
88
|
+
licenses:
|
89
|
+
- MIT
|
90
|
+
metadata: {}
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 2.2.2
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: Keep the repos under one roof.
|
111
|
+
test_files:
|
112
|
+
- spec/repo_man_spec.rb
|
113
|
+
has_rdoc:
|