glub 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/RELEASE_NOTES.md +7 -0
- data/VERSION +1 -1
- data/lib/glub.rb +18 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bfcd3b02fd5169fe935b82ca32f3cdcc6635890
|
4
|
+
data.tar.gz: 1bf30b0eac40e38b9e37318e565efd07c6322d70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c894a914cf34f4744b2a0af3f08d9368b08b58be6cb9af6e2495dd8d8d58ccc802d3f2eafaca9e88522df25142b0af682da208aa419ea19b8cda018084910d73
|
7
|
+
data.tar.gz: d9df910bc79ac1ed2b53571ed959aea1b4d321c7b0728cb1c2daedbc346c659395f1d7254211bfe6b655a7bca497c2793c3a032cf252da08639a717caefd266e
|
data/RELEASE_NOTES.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/glub.rb
CHANGED
@@ -49,19 +49,21 @@ class Glub < Sif::Loader
|
|
49
49
|
|
50
50
|
desc "list", "Lists all projects"
|
51
51
|
def list
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
response = []
|
53
|
+
per_page = 100
|
54
|
+
page = 0
|
55
|
+
while response.length == page * per_page do
|
56
|
+
page += 1
|
57
|
+
url = "#{@api_endpoint}/projects/all?private_token=#{@api_key}&page=#{page}&per_page=#{per_page}"
|
58
|
+
git_lab_data = RestClient.get(url)
|
59
|
+
response.concat JSON.parse(git_lab_data.body)
|
60
|
+
end
|
58
61
|
|
59
62
|
projects = []
|
60
63
|
response.each { |project| projects << "Name:#{project['name']} / ID:#{project['id']}" }
|
61
64
|
puts "Projects: "
|
62
65
|
projects.each { |project| puts " #{project}" }
|
63
66
|
"#{projects}"
|
64
|
-
|
65
67
|
end
|
66
68
|
|
67
69
|
desc "list_groups", "Lists all groups"
|
@@ -171,12 +173,16 @@ class Glub < Sif::Loader
|
|
171
173
|
|
172
174
|
desc "clone", "Clone from a list of projects"
|
173
175
|
def clone
|
176
|
+
response = []
|
177
|
+
per_page = 100
|
178
|
+
page = 0
|
179
|
+
while response.length == page * per_page do
|
180
|
+
page += 1
|
181
|
+
url = "#{@api_endpoint}/projects/all?private_token=#{@api_key}&page=#{page}&per_page=#{per_page}"
|
182
|
+
git_lab_data = RestClient.get(url)
|
183
|
+
response.concat JSON.parse(git_lab_data.body)
|
184
|
+
end
|
174
185
|
|
175
|
-
response = RestClient.get(
|
176
|
-
"#{@api_endpoint}/projects/all?private_token=#{@api_key}&per_page=1000000"
|
177
|
-
)
|
178
|
-
|
179
|
-
response = JSON.parse response.body
|
180
186
|
response = response.sort_by {|r| r['name']}
|
181
187
|
|
182
188
|
projects = []
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George McIntosh
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-02-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: webmock
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
170
|
rubyforge_project:
|
171
|
-
rubygems_version: 2.
|
171
|
+
rubygems_version: 2.4.5
|
172
172
|
signing_key:
|
173
173
|
specification_version: 3
|
174
174
|
summary: Command-line Gitlab client
|