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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4274a6ab90f801376a89a90d55b438cca9ec7d66
4
- data.tar.gz: de82161c31a999843ed27eb1028c085d18896df3
3
+ metadata.gz: 32a5ffad8547fa6ed19c81979465bbd1dcf279fa
4
+ data.tar.gz: 18bcf3f355d1e0ef4810573493d0cbdae7fc81b9
5
5
  SHA512:
6
- metadata.gz: 5975e16c635d31044ac28c8c15a3cc8bd4b4c6e4036283226414321ee104dd9df793eb70400ef40eb09e1df770cbbc849bee9a47d692cb93f4b41af85e0f342d
7
- data.tar.gz: 34bd0389d432a1846db0d58e30b00fc4ed57bf714f5a89616eaebdc8144eac557b6af94a6a030c1a66cc92801353876580170b2e2496aa52c02087ffd6fce47d
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(' Exclude repositories (separate by space): ', Array)
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
@@ -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
- fail 'Not implemented'
22
+ raise 'Not implemented'
23
23
  end
24
24
 
25
25
  def backup_path
26
- fail 'Not implemented'
26
+ raise 'Not implemented'
27
27
  end
28
28
 
29
29
  def provider
30
- fail 'Not implemented'
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
- fail 'Backup root is not specified!' if backup_root.blank?
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
@@ -1,3 +1,3 @@
1
1
  module BackupRepos
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
@@ -2,6 +2,6 @@ class String
2
2
  BLANK_RE = /\A[[:space:]]*\z/
3
3
 
4
4
  def blank?
5
- BLANK_RE === self
5
+ BLANK_RE.match(self)
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup_repos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justas Palumickas