glub 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/glub +4 -0
  2. data/lib/glub.rb +37 -0
  3. metadata +79 -0
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'glub'
4
+ Glub.start(ARGV)
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rest_client'
4
+ require 'json'
5
+ require 'yaml'
6
+ require 'thor'
7
+
8
+ class Glub < Thor
9
+
10
+ config = YAML::load_file "#{ENV['HOME']}/.gitlab"
11
+ @@api_key = config['api_key']
12
+ @@api_endpoint = config['api_endpoint']
13
+
14
+ desc "create NAME", "Creates a new Gitlab project"
15
+ def create(project_name)
16
+
17
+ puts "Creating Gitlab project #{project_name}"
18
+ command = {
19
+ :name => project_name,
20
+ :description => 'this is a new project',
21
+ :default_branch => 'master',
22
+ :issues_enabled => 'true',
23
+ :wiki_ebabled => 'true',
24
+ :wall_enabled => 'true',
25
+ :merge_requests_enabled => 'true'
26
+ }
27
+
28
+ RestClient.post(
29
+ "#{@@api_endpoint}/projects?private_token=#{@@api_key}",
30
+ command.to_json,
31
+ :content_type => 'application/json'
32
+ )
33
+ end
34
+
35
+ end
36
+
37
+
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: glub
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - George McIntosh
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-04-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thor
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rest-client
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: A command-line client for the Gitlab API
47
+ email: george@georgemcintosh.com
48
+ executables:
49
+ - glub
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - lib/glub.rb
54
+ - bin/glub
55
+ homepage: https://github.com/georgecodes/gitlab-cli
56
+ licenses: []
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubyforge_project:
75
+ rubygems_version: 1.8.24
76
+ signing_key:
77
+ specification_version: 3
78
+ summary: glub - Gitlab from your terminal
79
+ test_files: []