gitlab_clone 0.12.1 → 0.13.0
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 +5 -5
- data/README.md +4 -4
- data/bin/gitlab-clone +20 -16
- data/gitlab_clone.gemspec +2 -1
- data/lib/gitlab.rb +1 -1
- data/lib/setup.rb +13 -3
- data/lib/version +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9743a5c8d36d2578395cdb3d883e0a2e914d1254deb30841c8dca6bf10c15b22
|
4
|
+
data.tar.gz: 8311fc1ec87bb71dca9efec52bb14bd3e68a64b3f5b64a43b3b07a74d395ba10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21921ed0e4ebac829adb2ad8441c9878da473810742e8ed4ad79fa6e701f0e5a1f6f17e8180df2dd9fe9c2f49c1f18fa3ddc1e76f69c69231337e3b7f9d47f6f
|
7
|
+
data.tar.gz: 79b9157e33fd3abcefb0f24c7cc05f42abe8d498853347fe83b69c6a14bf02ca348393630898a2e7d6d3a4049fe485863101f8ee460c80fab0d6f223d0a7084b
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
#
|
1
|
+
# gitlab-clone [](http://badge.fury.io/rb/gitlab_clone)
|
2
2
|
|
3
3
|
## Description
|
4
|
-
|
4
|
+
gitlab-clone allows you to clone repositories from a gitlab server's group using the gitlab api.
|
5
5
|
|
6
6
|
The itch I was scratching by writing this was that I was writing cookbooks for home and work. I wanted an easier way to download all of my cookbooks so that I could work with all of them at once and not have to break my flow by having to download depended cookbooks later. Anyone that has worked with chef knows that you can have a lot of repos comporising all of your cookbooks...
|
7
7
|
|
@@ -19,7 +19,7 @@ For github it will be:
|
|
19
19
|
https://github.com/settings/applications
|
20
20
|
|
21
21
|
## Features
|
22
|
-
|
22
|
+
gitlab-clone currently features the following:
|
23
23
|
* Github organization supprt. You can bring down all the repos in an organization that you have access to.
|
24
24
|
* Default cloning of all repos that are in a group called Cookbooks.
|
25
25
|
* Can pick what group you can download all the repos in that group from.
|
@@ -78,5 +78,5 @@ gitlab_clone currently features the following:
|
|
78
78
|
|
79
79
|
## Installation
|
80
80
|
|
81
|
-
gem install
|
81
|
+
gem install gitlab-clone
|
82
82
|
Will give you a command named gitlab-clone to use.
|
data/bin/gitlab-clone
CHANGED
@@ -24,8 +24,8 @@ opts = Slop.parse do
|
|
24
24
|
on :r, :reconfigure, 'reconfigure gitlab server and token settings'
|
25
25
|
end
|
26
26
|
|
27
|
-
# If no arugments are passed, give help information
|
28
|
-
if ARGV[0].nil?
|
27
|
+
# If no arugments are passed, or none of approved ones, give help information
|
28
|
+
if ARGV[0].nil? || !(/h|c|w|l|v|g|o|n|r/)
|
29
29
|
Gitlab.printhelp
|
30
30
|
end
|
31
31
|
|
@@ -65,19 +65,23 @@ else
|
|
65
65
|
class_to_use = Gitlab
|
66
66
|
end
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
68
|
+
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
|
82
86
|
end
|
83
87
|
end
|
data/gitlab_clone.gemspec
CHANGED
@@ -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 = '
|
8
|
+
s.date = '2019-01-22'
|
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"]
|
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.add_dependency("git", "~> 1.2.6")
|
16
16
|
s.add_dependency("slop", "~> 3.5.0")
|
17
17
|
s.add_dependency("httparty", "~> 0.13.1")
|
18
|
+
s.add_dependency("rainbow", "~> 3.0.0")
|
18
19
|
s.homepage = 'https://github.com/ncamacho/gitlab_clone'
|
19
20
|
s.license = 'MIT'
|
20
21
|
s.post_install_message = "\n\n\tGitlab Clone is now installed!\n\n"
|
data/lib/gitlab.rb
CHANGED
@@ -8,7 +8,7 @@ class Gitlab
|
|
8
8
|
|
9
9
|
def self.printhelp
|
10
10
|
puts Rainbow("---------------------------------------------------------------------------------------\n").green
|
11
|
-
puts Rainbow("\t\t###### Options for
|
11
|
+
puts Rainbow("\t\t###### Options for #{File.basename($0)} ######\n\n").green
|
12
12
|
puts Rainbow("\t-h, --help: shows this help message").green
|
13
13
|
puts Rainbow("\t-c, --clone: clones all repos from https://gitlab_server/groups/Cookbooks
|
14
14
|
into a ~/code/Cookbooks directory by default").green
|
data/lib/setup.rb
CHANGED
@@ -68,9 +68,19 @@ class Setup
|
|
68
68
|
params = {}
|
69
69
|
end
|
70
70
|
puts Rainbow("What is the name of your gitlab server?\nExample: http[s]://server.domain.tld:\nServer: ").purple
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
host = STDIN.gets.chomp.downcase
|
72
|
+
|
73
|
+
### Lets get/set the version we are going to use for the API
|
74
|
+
puts Rainbow("What Gitlab API version are you using: v3 or v4? Press enter if unsure (default is v4).").purple
|
75
|
+
check = STDIN.gets.chomp.downcase
|
76
|
+
if check == ""
|
77
|
+
ver = "v4"
|
78
|
+
else
|
79
|
+
ver = check
|
80
|
+
end
|
81
|
+
|
82
|
+
gitlab_host = "#{host}/api/#{ver}"
|
83
|
+
params["gitlab_server"] = gitlab_host
|
74
84
|
params["gitlab_server"]
|
75
85
|
puts Rainbow("What is your token?\nExample: 3pe14gZfap:\nToken: ").purple
|
76
86
|
params["gitlab_token"] = STDIN.gets.chomp
|
data/lib/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.13.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.
|
4
|
+
version: 0.13.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:
|
11
|
+
date: 2019-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.13.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rainbow
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.0.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 3.0.0
|
55
69
|
description: Clones All Repos In A Gitlab Group Or Github Org.
|
56
70
|
email: ncamacho@nnc3.com.to
|
57
71
|
executables:
|
@@ -88,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
102
|
version: '0'
|
89
103
|
requirements: []
|
90
104
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.7.7
|
92
106
|
signing_key:
|
93
107
|
specification_version: 4
|
94
108
|
summary: Pulls down the latest repos from a group in gitlab or a organization group
|