gitlab_clone 0.13.1 → 0.14.0

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
  SHA256:
3
- metadata.gz: 45f68d75709f10ad3fa2ed04d4e444c86e5003fe155ba128e5f750e31edd3d81
4
- data.tar.gz: 21ed3a6981eb59f8add5025cacc9044b7f32cdda1485340ae767de4944a7253a
3
+ metadata.gz: 116f77beb52daa9eae0d5aabb67016b60a15ad2d5809395dc23899fd8498a2f3
4
+ data.tar.gz: 79a2f4d3a6a765e6dde8a227f6e8b735b2a034db279c18cd0950826c84e791a3
5
5
  SHA512:
6
- metadata.gz: f5cdeaf46ff875e4416f723c005066583b7611a7c871ff75de906f9ee9395c890e394d188c77288f7e141437d2a14b0458643461b3c7795bf5a5ad3462783413
7
- data.tar.gz: 7318a1f73247aecae0a8e5651583b4ed7fecacb8fbca9271bf2754044fa3c67de4f1782a6c56abb2e9b424b6f160b25226086b166d2274b9cff565196e9213b6
6
+ metadata.gz: e671acdc03eeb53640b3052ba9a11247282953ade79a812bc8112edbe020b86232b3eeeb4e08151e235721f37f11281034bb7e2b4b5da2631ab5d03e1df920ce
7
+ data.tar.gz: 3bc0521bd4caf4f2f88db604bec3a0f012c0ac5150d93c31f60edb58ae233fd8536ef26e01d3b5d6f3b8feae33f7c47752da038aba5d72c97c38f22aab562bf9
@@ -12,76 +12,85 @@ require "slop"
12
12
  require "httparty"
13
13
  require "rainbow"
14
14
 
15
- opts = Slop.parse do
16
- on :h, :help, 'help'
17
- on :c, :clone, 'clone'
18
- on :w, :web, 'web'
19
- on :l, :list, 'list'
20
- on :v, :version, 'version'
21
- on :g, :group=, 'group'
22
- on :o, :github, 'github'
23
- on :n, :config, 'print config'
24
- on :r, :reconfigure, 'reconfigure gitlab server and token settings'
25
- end
26
-
27
- # If no arugments are passed, or none of approved ones, give help information
28
- if ARGV[0].nil?
29
- Gitlab.printhelp
30
- end
15
+ class GitlabClone
16
+ def self.dothething
17
+ opts = Slop.parse do |o|
18
+ o.bool '-h', '--help', 'help'
19
+ o.bool '-c', '--clone', 'clone'
20
+ o.bool '-w', '--web', 'web'
21
+ o.bool '-l', '--list', 'list'
22
+ o.bool '-v', '--version', 'version'
23
+ o.string '-g', '--group', 'group'
24
+ o.bool '-o', '--github', 'github'
25
+ o.bool '-n', '--config', 'print config'
26
+ o.bool '-r', '--reconfigure', 'reconfigure gitlab server and token settings'
27
+ end
31
28
 
32
- if opts[:o] && !Setup.github_precheck
33
- puts Rainbow("Whoops looks like you have not set your Github token yet. Would you like to do so now?").yellow
34
- answer = STDIN.gets.chomp.downcase
35
- if answer == "y" or answer == "yes"
36
- Setup.github_configure
37
- end
38
- exit
39
- end
29
+ # If no arugments are passed, or none of approved ones, give help information
30
+ if ARGV[0].nil?
31
+ Gitlab.printhelp
32
+ end
40
33
 
34
+ if opts[:github] && !Setup.github_precheck
35
+ puts Rainbow("Whoops looks like you have not set your Github token yet. Would you like to do so now?").yellow
36
+ answer = STDIN.gets.chomp.downcase
37
+ if answer == "y" or answer == "yes"
38
+ Setup.github_configure
39
+ end
40
+ exit;
41
+ end
41
42
 
42
- opts.to_hash
43
+ if opts[:clone] && opts[:web]
44
+ puts Rainbow("\n\t############################################").red
45
+ puts Rainbow("\t You can't web clone and ssh clone").red
46
+ puts Rainbow("\t gitlab-clone -h for more information").red
47
+ puts Rainbow("\t############################################\n").red
48
+ else
43
49
 
44
- if opts[:c] && opts[:w]
45
- puts Rainbow("\n\t############################################").red
46
- puts Rainbow("\t You can't web clone and ssh clone").red
47
- puts Rainbow("\t gitlab-clone -h for more information").red
48
- puts Rainbow("\t############################################\n").red
49
- else
50
+ if opts[:github] && !opts[:group]
51
+ puts Rainbow("Github option requiers you to enter a organizational name.\n\n").red
52
+ end
50
53
 
51
- if opts[:o] && !opts[:g]
52
- puts Rainbow("Github option requiers you to enter a organizational name.\n\n").red
53
- end
54
+ if opts[:group]
55
+ clone_group = opts[:group]
56
+ elsif opts[:list] || opts[:github] || opts[:web] || opts[:clone]
57
+ puts Rainbow("\nNo organizational or group name was given. Using default of \"Cookbooks\"\n\n").purple.italic
58
+ clone_group = "Cookbooks"
59
+ end
54
60
 
55
- if opts[:g]
56
- clone_group = opts[:g]
57
- elsif opts[:l] || opts[:o] || opts[:w] || opts[:c]
58
- puts Rainbow("\nNo organizational or group name was given. Using default of \"Cookbooks\"\n\n").purple.italic
59
- clone_group = "Cookbooks"
60
- end
61
+ if opts[:github]
62
+ class_to_use = Github
63
+ else
64
+ class_to_use = Gitlab
65
+ end
61
66
 
62
- if opts[:o]
63
- class_to_use = Github
64
- else
65
- class_to_use = Gitlab
67
+ begin
68
+ if opts[:help]
69
+ Gitlab.printhelp
70
+ elsif opts[:reconfigure]
71
+ Setup.configure
72
+ elsif opts[:clone]
73
+ class_to_use.clone(0, clone_group)
74
+ elsif opts[:web]
75
+ class_to_use.clone(1, clone_group)
76
+ elsif opts[:version]
77
+ Version::version
78
+ elsif opts[:config]
79
+ Gitlab.config
80
+ elsif opts[:list]
81
+ class_to_use.list_repos(clone_group)
82
+ end
83
+ rescue
84
+ puts Rainbow("Looks like there was an issue. Please verify host and api version with \"#{File.basename($0)} -n\" to show configuration.").red.italic
85
+ end
86
+ end
87
+ end
66
88
  end
67
89
 
68
90
  begin
69
- if opts[:h]
70
- Gitlab.printhelp
71
- elsif opts[:r]
72
- Setup.configure
73
- elsif opts[:c]
74
- class_to_use.clone(0, clone_group)
75
- elsif opts[:w]
76
- class_to_use.clone(1, clone_group)
77
- elsif opts[:v]
78
- Version::version
79
- elsif opts[:n]
80
- Gitlab.config
81
- elsif opts[:l]
82
- class_to_use.list_repos(clone_group)
83
- end
84
- rescue
85
- puts Rainbow("Looks like there was an issue. Please verify host and api version with \"#{File.basename($0)} -n\" to show configuration.").red.italic
86
- end
91
+ GitlabClone.dothething
92
+ rescue Interrupt
93
+ puts Rainbow("\n\nStopping...").yellow.bright
94
+ rescue
95
+ puts Rainbow("\nUnknown options. Wanna try that again?").red.bright
87
96
  end
@@ -5,7 +5,7 @@ require 'version'
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'gitlab_clone'
7
7
  s.version = Version::current
8
- s.date = '2019-01-22'
8
+ s.date = '2019-01-30'
9
9
  s.summary = "Pulls down the latest repos from a group in gitlab or a organization group in Github."
10
10
  s.description = "Clones All Repos In A Gitlab Group Or Github Org."
11
11
  s.authors = ["Nestor N. Camacho III"]
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.files = `git ls-files`.split($/)
14
14
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
15
15
  s.add_dependency("git", "~> 1.2.6")
16
- s.add_dependency("slop", "~> 3.5.0")
16
+ s.add_dependency("slop", ">= 4.0.0")
17
17
  s.add_dependency("httparty", "~> 0.13.1")
18
18
  s.add_dependency("rainbow", "~> 3.0.0")
19
19
  s.homepage = 'https://github.com/ncamacho/gitlab_clone'
@@ -1 +1 @@
1
- 0.13.1
1
+ 0.14.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_clone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nestor N. Camacho III
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-22 00:00:00.000000000 Z
11
+ date: 2019-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: slop
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 3.5.0
33
+ version: 4.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 3.5.0
40
+ version: 4.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: httparty
43
43
  requirement: !ruby/object:Gem::Requirement