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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWY0Y2U5YzU0ZDQyODVjZTBhZWYxMmEwMzU2ZDIyOTkzN2RkN2Q4OA==
4
+ YzM0MTI2YTgwZDhlMzk4YmVkM2Q4Y2UxOGI0NjM3N2JhZjlmNDk5YQ==
5
5
  data.tar.gz: !binary |-
6
- ZThhYTRkZDRkMzIzNzc2YTYzMzQ1MmI2ODc3MDJmNWExMDU1ODg3NA==
6
+ ZTY3MDI4ZTI3ZGRjNzRhNGMzYWVkMzA2ODNhZDY2ZmIxODgxNzExMQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZTU0ZDk3NmEzYmZiYWUxMmYwN2ZlMWI5ZGJlYmEzMTRlNDZjYTEyMmQzYzk4
10
- ZDI4MmQzMmM0NmZkMDlmNzhkMzllNjAzOTc3MGZiZTgyYjhkMDAyMTY3Mjcz
11
- YzYwMjBhY2NlOTMzZjRhNTExMWRhMzU1YzBkNzE2MjA5OTBiZDk=
9
+ NzcyZWM0NjZhY2NkYTU1YzRjMmVmODgyNjFkZDc5ZDA0MDQ4ODUxNDllYTFm
10
+ YTUyZDc2MGVhMjRlZDIzM2MyMTMxYTI5NGJhNWFmMmQ2NzU0ODUxMjQ1OWFj
11
+ OGJjOTdkMjdjMWMxZGM2ZGVhMGFkYWRhOGU2ZGY5OGFiNzRhZDY=
12
12
  data.tar.gz: !binary |-
13
- ZTJiZDg3YzU0NzY4MmFhNjM0YmRkNjlmNzc1YzM2MWJmOGM0ZDA2MjM3ZjUz
14
- MzhiMDcwOGExOGM3MGI4NTc4ZjJlMzFhNGFjNmM2ZTg3ZGYyZjk1MjQ3ZTFl
15
- MDgyODZhZjRjMTlhNjVhYTAxMjk3NGM4ZTg1NjI3MzQzNmZkODc=
13
+ ZjUyZGFiMDcyMWM3MTMwMjg4Zjk0MDEzOGJlMjNhYWM1OGY5OWMwYzRhNmNj
14
+ ODIyM2ZjMDhhOTVhMTJiMmM5ZWYzMTYzMDZhNDg0MDEzNDM5NzIzZmFiYzMz
15
+ MWFkM2Y4ZDZiMGU3OTIzNTRhNDE4N2QzMWQxODJjOGE0YjdjODM=
@@ -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
 
@@ -4,7 +4,7 @@ module BackupOnTheGo #:nodoc:#
4
4
  module VERSION
5
5
  MAJOR = 0
6
6
  MINOR = 1
7
- TINY = 4
7
+ TINY = 5
8
8
 
9
9
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup_on_the_go
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hong Xu