github-backup 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
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 == 1
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
- backup = Github::Backup.new(ARGV.first)
13
+ username = ARGV.shift
14
+ root = ARGV.shift
15
+
16
+ backup = Github::Backup.new(username, root)
14
17
  backup.execute
@@ -1,12 +1,15 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
1
4
  # -*- encoding: utf-8 -*-
2
5
 
3
6
  Gem::Specification.new do |s|
4
7
  s.name = %q{github-backup}
5
- s.version = "0.2.1"
8
+ s.version = "0.3.0"
6
9
 
7
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
11
  s.authors = ["David Dollar"]
9
- s.date = %q{2009-08-10}
12
+ s.date = %q{2009-09-03}
10
13
  s.default_executable = %q{github-backup}
11
14
  s.email = %q{<ddollar@gmail.com>}
12
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('ddollar').repositories.sort_by { |r| r.name }
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: github-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
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-08-10 00:00:00 -04:00
12
+ date: 2009-09-03 00:00:00 -04:00
13
13
  default_executable: github-backup
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency