github-backups 0.1.0 → 0.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -0,0 +1,70 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "github-backups"
8
+ s.version = "0.2.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["hbt"]
12
+ s.date = "2012-05-24"
13
+ s.description = "Command-line tool designed to back up repos from github"
14
+ s.email = "hassenbentanfous@gmail.com"
15
+ s.executables = ["github-backup"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.mkd"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE.txt",
25
+ "README.mkd",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "bin/github-backup",
29
+ "github-backup.gemspec",
30
+ "github-backups.gemspec",
31
+ "lib/github-backup.rb",
32
+ "lib/github/repos.rb",
33
+ "lib/utils/options.rb",
34
+ "test/helper.rb",
35
+ "test/test_github-backup.rb"
36
+ ]
37
+ s.homepage = "http://github.com/hbt/github-backup"
38
+ s.licenses = ["MIT"]
39
+ s.require_paths = ["lib"]
40
+ s.rubygems_version = "1.8.15"
41
+ s.summary = "Backup all repos, wiki, issues, forks, branches from github"
42
+
43
+ if s.respond_to? :specification_version then
44
+ s.specification_version = 3
45
+
46
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
48
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
49
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
50
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
51
+ s.add_development_dependency(%q<json>, [">= 0"])
52
+ s.add_development_dependency(%q<httparty>, [">= 0"])
53
+ else
54
+ s.add_dependency(%q<shoulda>, [">= 0"])
55
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
56
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
57
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
58
+ s.add_dependency(%q<json>, [">= 0"])
59
+ s.add_dependency(%q<httparty>, [">= 0"])
60
+ end
61
+ else
62
+ s.add_dependency(%q<shoulda>, [">= 0"])
63
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
64
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
65
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
66
+ s.add_dependency(%q<json>, [">= 0"])
67
+ s.add_dependency(%q<httparty>, [">= 0"])
68
+ end
69
+ end
70
+
data/lib/github/repos.rb CHANGED
@@ -72,8 +72,10 @@ module GitHubBackup
72
72
  Dir.chdir(opts[:bakdir])
73
73
  wiki_path = "#{opts[:bakdir]}/#{repo['name']}.wiki"
74
74
  %x{git clone git@github.com:#{repo['owner']['login']}/#{repo['name']}.wiki.git} unless File.exists?(wiki_path)
75
- Dir.chdir(wiki_path)
76
- %x{git fetch origin}
75
+ if File.exists? wiki_path
76
+ Dir.chdir(wiki_path)
77
+ %x{git fetch origin}
78
+ end
77
79
  end
78
80
 
79
81
  def json(url)
data/lib/utils/options.rb CHANGED
@@ -9,13 +9,9 @@ module GitHubBackup
9
9
 
10
10
  optparse = OptionParser.new do|opts|
11
11
 
12
- # TODO: update usage
13
12
  opts.banner = "Usage: github-backup -u [username] -o [dir]
14
13
  e.g
15
14
  github-backup -u hbt -o /tmp \n\n"
16
- # backup.rb *githubUsername* *githubPassword* [--github-user=XXX] [--repo=XXX] [--all-branches] [--all-forks] [--issues] [--wiki]
17
- # backup.rb [--github-user=XXX] [--repo=XXX] [--all-branches] [--all-forks] [--issues] [--wiki]
18
- # backup.rb --username=XXX --password=XXX [--github-user=XXX] --repo=XXX --all-branches --all-forks --issues --wiki
19
15
 
20
16
  opts.on( '-e', '--email EMAIL', 'Optional: GitHub email/username. Required for private repos') do |f|
21
17
  self.options[:email] = f
@@ -49,10 +45,6 @@ github-backup -u hbt -o /tmp \n\n"
49
45
  self.options[:issues] = true
50
46
  end
51
47
 
52
- opts.on( nil, '--dump-issues-filename FILENAME', 'Optional: dump issues filename' ) do |f|
53
- self.options[:issues_filename] = f
54
- end
55
-
56
48
  opts.on( '-w', '--wiki', 'Optional: dump wiki' ) do
57
49
  self.options[:wiki] = true
58
50
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: github-backups
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.2.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - hbt
@@ -97,6 +97,7 @@ files:
97
97
  - VERSION
98
98
  - bin/github-backup
99
99
  - github-backup.gemspec
100
+ - github-backups.gemspec
100
101
  - lib/github-backup.rb
101
102
  - lib/github/repos.rb
102
103
  - lib/utils/options.rb
@@ -115,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
116
  requirements:
116
117
  - - ">="
117
118
  - !ruby/object:Gem::Version
118
- hash: -385962001
119
+ hash: -954207121
119
120
  segments:
120
121
  - 0
121
122
  version: "0"