glub 0.0.1 → 0.0.2
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.
- data/lib/glub.rb +9 -3
- metadata +2 -2
data/lib/glub.rb
CHANGED
|
@@ -7,9 +7,10 @@ require 'thor'
|
|
|
7
7
|
|
|
8
8
|
class Glub < Thor
|
|
9
9
|
|
|
10
|
-
config = YAML::load_file "#{ENV['HOME']}/.
|
|
10
|
+
config = YAML::load_file "#{ENV['HOME']}/.glub"
|
|
11
11
|
@@api_key = config['api_key']
|
|
12
|
-
@@
|
|
12
|
+
@@gitlab_host = config['gitlab_host']
|
|
13
|
+
@@api_endpoint = "http://#{@@gitlab_host}/api/v3"
|
|
13
14
|
|
|
14
15
|
desc "create NAME", "Creates a new Gitlab project"
|
|
15
16
|
def create(project_name)
|
|
@@ -25,11 +26,16 @@ class Glub < Thor
|
|
|
25
26
|
:merge_requests_enabled => 'true'
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
RestClient.post(
|
|
29
|
+
response = RestClient.post(
|
|
29
30
|
"#{@@api_endpoint}/projects?private_token=#{@@api_key}",
|
|
30
31
|
command.to_json,
|
|
31
32
|
:content_type => 'application/json'
|
|
32
33
|
)
|
|
34
|
+
|
|
35
|
+
response = JSON.parse response.body
|
|
36
|
+
|
|
37
|
+
puts "Repository #{project_name} created. Add it as a remote using: "
|
|
38
|
+
puts " git remote add origin git@#{@@gitlab_host}:#{response['path_with_namespace']}.git"
|
|
33
39
|
end
|
|
34
40
|
|
|
35
41
|
end
|
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.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -52,7 +52,7 @@ extra_rdoc_files: []
|
|
|
52
52
|
files:
|
|
53
53
|
- lib/glub.rb
|
|
54
54
|
- bin/glub
|
|
55
|
-
homepage: https://github.com/georgecodes/
|
|
55
|
+
homepage: https://github.com/georgecodes/glub
|
|
56
56
|
licenses: []
|
|
57
57
|
post_install_message:
|
|
58
58
|
rdoc_options: []
|