gitlabuddy 0.0.2 → 0.0.3
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 +4 -4
- data/lib/gitlabuddy/cli.rb +3 -3
- data/lib/gitlabuddy/project.rb +13 -6
- 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: eeeb03b7c68802d829e2e840f2121ab3a5fd2b4c
|
4
|
+
data.tar.gz: 859c5ad16cec533dee3a09cbf33c225af2ac9873
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7479349662d0e605b1693df9f3dafd3f074b217089dbb4d2613f80cd8a2bd0222e536ac2be8a9bff46154c6a648ee9079b4a765a252eb7a5a278b6f82769e8c1
|
7
|
+
data.tar.gz: cb3414700e2f3af53fc818f3970fe560c035312be6a6a6aabc3183170daf9073e7f2e53dfb2600f32ea94b4a0b1e70ac53b20c7c08527d40e8e08d6dc64ab19b
|
data/lib/gitlabuddy/cli.rb
CHANGED
@@ -14,10 +14,10 @@ module Gitlabuddy
|
|
14
14
|
Gitlabuddy::MergeRequest.all
|
15
15
|
end
|
16
16
|
|
17
|
-
desc '
|
18
|
-
def
|
17
|
+
desc 'project_type PROJECT_ID', 'This will return the project type of a certain project'
|
18
|
+
def project_type(project_id)
|
19
19
|
require 'gitlabuddy/project'
|
20
|
-
Gitlabuddy::Project.
|
20
|
+
Gitlabuddy::Project.project_type(project_id)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
data/lib/gitlabuddy/project.rb
CHANGED
@@ -14,17 +14,24 @@ module Gitlabuddy
|
|
14
14
|
projects
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.
|
18
|
-
|
19
|
-
Gitlabuddy::Request.new("https://gitlab.com/api/v3/projects/#{project_id}/repository/
|
17
|
+
def self.project_type(project_id)
|
18
|
+
files = JSON.parse(
|
19
|
+
Gitlabuddy::Request.new("https://gitlab.com/api/v3/projects/#{project_id}/repository/tree")
|
20
20
|
.send
|
21
21
|
.body
|
22
22
|
)
|
23
23
|
|
24
|
-
|
24
|
+
type = case files.to_s
|
25
|
+
when /Gemfile/
|
26
|
+
'ruby'
|
27
|
+
when /metadata.rb/
|
28
|
+
'cookbook'
|
29
|
+
else
|
30
|
+
'unknown'
|
31
|
+
end
|
25
32
|
|
26
|
-
puts
|
27
|
-
|
33
|
+
puts type
|
34
|
+
type
|
28
35
|
end
|
29
36
|
end
|
30
37
|
end
|