github-backups 0.3.2 → 0.3.3
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.
- data/README.mkd +4 -1
- data/VERSION +1 -1
- data/github-backups.gemspec +1 -1
- data/lib/github/repos.rb +6 -1
- data/lib/utils/options.rb +0 -4
- metadata +1 -1
data/README.mkd
CHANGED
@@ -17,7 +17,6 @@ Usage: github-backup -u [username] -o [dir]
|
|
17
17
|
e.g
|
18
18
|
github-backup -u hbt -o /tmp
|
19
19
|
|
20
|
-
-e, --email EMAIL Optional: GitHub email/username. Required for private repos
|
21
20
|
-p, --password PASSWORD Optional: GitHub password. Required for private repos
|
22
21
|
-u, --username USERNAME *Required: GitHub username
|
23
22
|
-o, --output-dir DIR *Required: Backup directory
|
@@ -36,3 +35,7 @@ github-backup -u hbt -o /tmp
|
|
36
35
|
Copyright (c) 2012 hbt. See LICENSE.txt for
|
37
36
|
further details.
|
38
37
|
|
38
|
+
|
39
|
+
|
40
|
+
[](https://bitdeli.com/free "Bitdeli Badge")
|
41
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
data/github-backups.gemspec
CHANGED
data/lib/github/repos.rb
CHANGED
@@ -11,7 +11,12 @@ module GitHubBackup
|
|
11
11
|
def backup_repos()
|
12
12
|
# get all repos
|
13
13
|
(1..100).each do |i|
|
14
|
-
|
14
|
+
if opts[:passwd]
|
15
|
+
url ="/user/repos"
|
16
|
+
else
|
17
|
+
url = "/users/#{opts[:username]}/repos"
|
18
|
+
end
|
19
|
+
repos = json("#{url}?page=#{i}per_page=100")
|
15
20
|
repos.each do |f|
|
16
21
|
# do we limit to a specific repo?
|
17
22
|
next unless f['name'] == opts[:reponame] if opts[:reponame]
|
data/lib/utils/options.rb
CHANGED
@@ -13,10 +13,6 @@ module GitHubBackup
|
|
13
13
|
e.g
|
14
14
|
github-backup -u hbt -o /tmp \n\n"
|
15
15
|
|
16
|
-
opts.on( '-e', '--email EMAIL', 'Optional: GitHub email/username. Required for private repos') do |f|
|
17
|
-
self.options[:email] = f
|
18
|
-
end
|
19
|
-
|
20
16
|
opts.on( '-p', '--password PASSWORD', 'Optional: GitHub password. Required for private repos') do |f|
|
21
17
|
self.options[:passwd] = f
|
22
18
|
end
|