ddollar-github-backup 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/github-backup +6 -3
- data/github-backup.gemspec +2 -2
- data/lib/github-backup.rb +4 -3
- metadata +3 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/bin/github-backup
CHANGED
@@ -5,10 +5,13 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
5
5
|
require 'octopi'
|
6
6
|
require 'github-backup'
|
7
7
|
|
8
|
-
unless ARGV.length ==
|
9
|
-
puts "usage: github-backup <local backup root>"
|
8
|
+
unless ARGV.length == 2
|
9
|
+
puts "usage: github-backup <username> <local backup root>"
|
10
10
|
exit 1
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
username = ARGV.shift
|
14
|
+
root = ARGV.shift
|
15
|
+
|
16
|
+
backup = Github::Backup.new(username, root)
|
14
17
|
backup.execute
|
data/github-backup.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{github-backup}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David Dollar"]
|
12
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-09-03}
|
13
13
|
s.default_executable = %q{github-backup}
|
14
14
|
s.email = %q{<ddollar@gmail.com>}
|
15
15
|
s.executables = ["github-backup"]
|
data/lib/github-backup.rb
CHANGED
@@ -7,9 +7,10 @@ class Github::Backup
|
|
7
7
|
|
8
8
|
include Octopi
|
9
9
|
|
10
|
-
attr_reader :backup_root, :debug
|
10
|
+
attr_reader :backup_root, :debug, :username
|
11
11
|
|
12
|
-
def initialize(backup_root)
|
12
|
+
def initialize(username, backup_root)
|
13
|
+
@username = username
|
13
14
|
@backup_root = backup_root
|
14
15
|
@debug = false
|
15
16
|
end
|
@@ -17,7 +18,7 @@ class Github::Backup
|
|
17
18
|
def execute
|
18
19
|
FileUtils::mkdir_p(backup_root)
|
19
20
|
authenticated do |api|
|
20
|
-
repositories = User.find(
|
21
|
+
repositories = User.find(username).repositories.sort_by { |r| r.name }
|
21
22
|
repositories.each do |repository|
|
22
23
|
puts "Backing up: #{repository.name}"
|
23
24
|
backup_repository repository
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddollar-github-backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Dollar
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-03 00:00:00 -07:00
|
13
13
|
default_executable: github-backup
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -45,7 +45,6 @@ files:
|
|
45
45
|
- test/test_helper.rb
|
46
46
|
has_rdoc: false
|
47
47
|
homepage: http://github.com/ddollar/github-backup
|
48
|
-
licenses:
|
49
48
|
post_install_message:
|
50
49
|
rdoc_options:
|
51
50
|
- --charset=UTF-8
|
@@ -66,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
65
|
requirements: []
|
67
66
|
|
68
67
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.
|
68
|
+
rubygems_version: 1.2.0
|
70
69
|
signing_key:
|
71
70
|
specification_version: 3
|
72
71
|
summary: Backup your Github repositories
|