backup_repos 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/backup_repos/cli/setup.rb +4 -4
- data/lib/backup_repos/config.rb +5 -1
- data/lib/backup_repos/performers/base_git.rb +7 -5
- data/lib/backup_repos/version.rb +1 -1
- data/lib/core_ext/string.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32a5ffad8547fa6ed19c81979465bbd1dcf279fa
|
4
|
+
data.tar.gz: 18bcf3f355d1e0ef4810573493d0cbdae7fc81b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94150793705d7f6b0cf7d54a95ddf893e54f888b563e4270d58ddfa1ece017cd3fc6e13a392e76f2a6ee0f1bbe7bdc02fcae7863bb62b17ce9984349d5b8a406
|
7
|
+
data.tar.gz: 5add763bc6f28038068cf784ba05cb9a91e98b52a9fd1fdcef971e851ba20ea63305cfd11530b70e6be08f15121d2f1c4a4fe960924d890e6b6c4489b955cfab
|
@@ -67,11 +67,11 @@ module BackupRepos
|
|
67
67
|
|
68
68
|
cli.say ' What is your GitHub access token?'
|
69
69
|
access_token = cli.ask ' Access Token: '
|
70
|
-
exclude_repositories = cli.ask(
|
70
|
+
exclude_repositories = cli.ask(
|
71
|
+
' Exclude repositories (separate by space): ', Array
|
72
|
+
)
|
71
73
|
|
72
|
-
if access_token.present?
|
73
|
-
@config[:github][:access_token] = access_token
|
74
|
-
end
|
74
|
+
@config[:github][:access_token] = access_token if access_token.present?
|
75
75
|
|
76
76
|
if exclude_repositories.present?
|
77
77
|
@config[:github][:exclude] = exclude_repositories
|
data/lib/backup_repos/config.rb
CHANGED
@@ -28,7 +28,11 @@ module BackupRepos
|
|
28
28
|
# ===
|
29
29
|
|
30
30
|
def method_missing(name, *_args)
|
31
|
-
options.send(name) || config[name.to_s]
|
31
|
+
options.send(name) || config[name.to_s] || super
|
32
|
+
end
|
33
|
+
|
34
|
+
def respond_to_missing?(name, include_private = false)
|
35
|
+
options.respond_to?(name) || config.key?(name.to_s) || super
|
32
36
|
end
|
33
37
|
|
34
38
|
def config_file
|
@@ -19,22 +19,24 @@ module BackupRepos
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def clone_url
|
22
|
-
|
22
|
+
raise 'Not implemented'
|
23
23
|
end
|
24
24
|
|
25
25
|
def backup_path
|
26
|
-
|
26
|
+
raise 'Not implemented'
|
27
27
|
end
|
28
28
|
|
29
29
|
def provider
|
30
|
-
|
30
|
+
raise 'Not implemented'
|
31
31
|
end
|
32
32
|
|
33
33
|
private
|
34
34
|
|
35
35
|
def clone_repo
|
36
36
|
success, _output = BackupRepos.shell.run(
|
37
|
-
"git clone --mirror -n #{clone_url} #{full_backup_path}"
|
37
|
+
"git clone --mirror -n #{clone_url} #{full_backup_path}"
|
38
|
+
)
|
39
|
+
|
38
40
|
puts success ? 'Successfuly cloned'.green : 'Failed to clone'.red
|
39
41
|
end
|
40
42
|
|
@@ -47,7 +49,7 @@ module BackupRepos
|
|
47
49
|
|
48
50
|
def full_backup_path
|
49
51
|
backup_root = BackupRepos.config.backup_root
|
50
|
-
|
52
|
+
raise 'Backup root is not specified!' if backup_root.blank?
|
51
53
|
|
52
54
|
File.join(backup_root, provider, backup_path)
|
53
55
|
end
|
data/lib/backup_repos/version.rb
CHANGED
data/lib/core_ext/string.rb
CHANGED