backup_on_the_go 0.1.4 → 0.1.5
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.
- checksums.yaml +8 -8
- data/lib/backup_on_the_go.rb +6 -3
- data/lib/backup_on_the_go/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzM0MTI2YTgwZDhlMzk4YmVkM2Q4Y2UxOGI0NjM3N2JhZjlmNDk5YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTY3MDI4ZTI3ZGRjNzRhNGMzYWVkMzA2ODNhZDY2ZmIxODgxNzExMQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzcyZWM0NjZhY2NkYTU1YzRjMmVmODgyNjFkZDc5ZDA0MDQ4ODUxNDllYTFm
|
10
|
+
YTUyZDc2MGVhMjRlZDIzM2MyMTMxYTI5NGJhNWFmMmQ2NzU0ODUxMjQ1OWFj
|
11
|
+
OGJjOTdkMjdjMWMxZGM2ZGVhMGFkYWRhOGU2ZGY5OGFiNzRhZDY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjUyZGFiMDcyMWM3MTMwMjg4Zjk0MDEzOGJlMjNhYWM1OGY5OWMwYzRhNmNj
|
14
|
+
ODIyM2ZjMDhhOTVhMTJiMmM5ZWYzMTYzMDZhNDg0MDEzNDM5NzIzZmFiYzMz
|
15
|
+
MWFkM2Y4ZDZiMGU3OTIzNTRhNDE4N2QzMWQxODJjOGE0YjdjODM=
|
data/lib/backup_on_the_go.rb
CHANGED
@@ -12,6 +12,7 @@ module BackupOnTheGo #:nodoc:#
|
|
12
12
|
DEFAULT_CONFIG = {
|
13
13
|
:backup_fork => false,
|
14
14
|
:git_cmd => 'git',
|
15
|
+
:github_repos_max => '200',
|
15
16
|
:is_private => true,
|
16
17
|
:no_public_forks => true,
|
17
18
|
:repo_prefix => 'backup-on-the-go-',
|
@@ -26,6 +27,7 @@ module BackupOnTheGo #:nodoc:#
|
|
26
27
|
# * <tt>:bitbucket_repos_owner</tt> - Optional string - Owner of the backup repositories on BitBucket. The owner could be a team. If not specified, <tt>:bitbucket_user</tt> will be used.
|
27
28
|
# * <tt>:bitbucket_user</tt> - *Required* string if <tt>:user</tt> is not specified - The user name on BitBucket. If not specified, <tt>:user</tt> will be used.
|
28
29
|
# * <tt>:git_cmd</tt> - Optional string - The git command you want to use. Default is 'git'.
|
30
|
+
# * <tt>:github_repos_max</tt> - Optional string - The max number of your GitHub repos, since GitHub API requires to give a repo number upper limit. Usually you don't need to set up this number unless you have more than 200 repositories. Default is <tt>"200"</tt>.
|
29
31
|
# * <tt>:github_repos_owner</tt> - Optional string - The owner of the repositories that need to be backed up. The owner could be an organization. If not specified, <tt>:github_user</tt> will be used.
|
30
32
|
# * <tt>:github_user</tt> - *Required* string if <tt>:user</tt> is not specified - The user name on GitHub. If not specified, <tt>:user</tt> will be used.
|
31
33
|
# * <tt>:is_private</tt> - Optional boolean - <tt>true</tt> to make the backup repositories private, <tt>false</tt> to make them public. Default is <tt>true</tt>.
|
@@ -80,9 +82,6 @@ module BackupOnTheGo #:nodoc:#
|
|
80
82
|
config[:bitbucket_password] = ask("Enter your BitBucket password: ") { |q| q.echo = false }
|
81
83
|
end
|
82
84
|
|
83
|
-
|
84
|
-
gh_repos = Github.repos.list :user => config[:github_repos_owner] # obtain github repos
|
85
|
-
|
86
85
|
bb = BitBucket.new :login => config[:bitbucket_user], :password => config[:bitbucket_password]
|
87
86
|
|
88
87
|
backup_repo_names = Array.new
|
@@ -93,6 +92,10 @@ module BackupOnTheGo #:nodoc:#
|
|
93
92
|
end
|
94
93
|
end
|
95
94
|
|
95
|
+
# obtain github repos
|
96
|
+
gh_repos = Github.repos.list :user => config[:github_repos_owner],
|
97
|
+
:per_page => config[:github_repos_max]
|
98
|
+
|
96
99
|
gh_repos.each do |repo|
|
97
100
|
next if repo.fork && !config[:backup_fork]
|
98
101
|
|