gritano 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- = Gritano v0.1.2
1
+ = Gritano v0.1.4
2
2
 
3
3
  Gritano is the simplest way to configure a git server over ssh. You can create repositories and manage user access using this practical tool.
4
4
 
data/TODO CHANGED
@@ -1 +1,33 @@
1
- - melhorar mensagens de retorno
1
+ v0.1.5
2
+ - exibir o tipo de acesso do usuario pelo commando repo users
3
+
4
+ v0.2.0
5
+ - acesso do usuário via ssh
6
+ ssh git@host.com repos
7
+ ssh git@host.com keys
8
+ ssh git@host.com +key keyname < key.pub
9
+ ssh git@host.com -key keyname
10
+
11
+ v0.3.0
12
+ - acesso administrativo via ssh
13
+ ssh git@host.com user add username
14
+ ssh git@host.com user rm username
15
+ ssh git@host.com user +key username keyname key.pub
16
+ ssh git@host.com user -key username keyname
17
+ ssh git@host.com repo add reponame.git
18
+ ssh git@host.com repo rm reponame.git
19
+ ssh git@host.com repo +read reponame.git username
20
+ ssh git@host.com repo +write reponame.git username
21
+ ssh git@host.com repo -read reponame.git username
22
+ ssh git@host.com repo -write reponame.git username
23
+
24
+ v0.4.0
25
+ - diferentes níveis de acesso administrativo
26
+ - admin do sistema (todos os comandos)
27
+ - usuários (estender os comando de usuários):
28
+ ssh git@host.com repo add reponame.git
29
+ ssh git@host.com repo rm reponame.git
30
+ ssh git@host.com repo +read reponame.git username
31
+ ssh git@host.com repo +write reponame.git username
32
+ ssh git@host.com repo -read reponame.git username
33
+ ssh git@host.com repo -write reponame.git username
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/bin/gritano CHANGED
@@ -16,12 +16,20 @@ def help
16
16
  gritano user rm username
17
17
  gritano user +key username keyname key.pub
18
18
  gritano user -key username keyname
19
+ gritano user list
20
+ gritano user keys username
21
+ gritano user repos username
19
22
  gritano repo add reponame.git
20
23
  gritano repo rm reponame.git
21
24
  gritano repo +read reponame.git username
22
25
  gritano repo +write reponame.git username
23
26
  gritano repo -read reponame.git username
24
- gritano repo -write reponame.git username"
27
+ gritano repo -write reponame.git username
28
+ gritano repo list
29
+ gritano repo users reponame.git
30
+
31
+ --
32
+ v#{File.open(File.join(File.dirname(__FILE__), '..', 'VERSION')).readlines.join}"
25
33
  end
26
34
 
27
35
  def install
@@ -62,7 +70,7 @@ if ARGV.length == 1
62
70
  else
63
71
  help
64
72
  end
65
- elsif ARGV.length == 2 or ARGV.length == 0
73
+ elsif ARGV.length == 0
66
74
  help
67
75
  else
68
76
  check_gritano
@@ -37,16 +37,25 @@ Feature: Console operations
37
37
  | user +key igorbonadio marvin features/data/keys/igorbonadio.pub | success |
38
38
  | user -key igorbonadio eva | success |
39
39
  | user rm igorbonadio | success |
40
+ | user list | success |
41
+ | user keys igorbonadio | success |
42
+ | user repos igorbonadio | success |
40
43
  | repo add tmp/p-lang.git | success |
41
44
  | repo rm tmp/jeka.git | success |
42
45
  | repo +read tmp/gritano.git jessicaeto | success |
43
46
  | repo +write tmp/gritano.git jessicaeto | success |
44
47
  | repo -read tmp/jeka.git igorbonadio | success |
45
48
  | repo -write tmp/gritano.git igorbonadio | success |
49
+ | repo list | success |
50
+ | repo users tmp/jeka.git | success |
51
+ | repo readers tmp/jeka.git | success |
52
+ | repo writers tmp/jeka.git | success |
46
53
  | user add igorbonadio | error |
47
54
  | user rm jose | error |
48
55
  | user +key igorbonadio marvin features/data/keys/arybonadio.pub | error |
49
56
  | user -key igorbonadio marvino | error |
57
+ | user keys arybonadio | error |
58
+ | user repos arybonadio | error |
50
59
  | repo add tmp/jeka.git | error |
51
60
  | repo rm tmp/p-lang.git | error |
52
61
  | repo +read tmp/gritano.git arybonadio | error |
@@ -57,3 +66,6 @@ Feature: Console operations
57
66
  | repo -read tmp/p-lang.git igorbonadio | error |
58
67
  | repo -write tmp/gritano.git arybonadio | error |
59
68
  | repo -write tmp/p-lang.git igorbonadio | error |
69
+ | repo users tmp/ruby.git | error |
70
+ | repo readers tmp/ruby.git | error |
71
+ | repo writers tmp/ruby.git | error |
data/gritano.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gritano"
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Igor Bonadio"]
12
- s.date = "2012-09-22"
12
+ s.date = "2012-10-13"
13
13
  s.description = "Gritano is the simplest way to configure your git server over ssh. You can create repositories and manage user access."
14
14
  s.email = "igorbonadio@gmail.com"
15
15
  s.executables = ["gritano", "gritano-check"]
@@ -13,6 +13,48 @@ module Gritano
13
13
  send(argv[0..1].join('_').gsub('+', 'add_').gsub('-', 'remove_'), argv[2..-1])
14
14
  end
15
15
 
16
+ def user_list(argv)
17
+ msg = "Users:\n"
18
+ users = User.all
19
+ users.each do |user|
20
+ msg += " - #{user.login}\n"
21
+ end
22
+ msg = "there is no user registered" if users.count == 0
23
+ return [true, msg]
24
+ end
25
+
26
+ def user_keys(argv)
27
+ login, = argv
28
+ user = User.find_by_login(login)
29
+ if user
30
+ keys = user.keys
31
+ msg = "User's keys:\n"
32
+ keys.each do |key|
33
+ " - #{key.name}\n"
34
+ end
35
+ msg = "there is no key registered" if keys.count == 0
36
+ return [true, msg]
37
+ else
38
+ return [false, "User #{login} is not registered"]
39
+ end
40
+ end
41
+
42
+ def user_repos(argv)
43
+ login, = argv
44
+ user = User.find_by_login(login)
45
+ if user
46
+ repos = user.repositories
47
+ msg = "User's repositories:\n"
48
+ repos.each do |repo|
49
+ " - #{repo.name}\n"
50
+ end
51
+ msg = "there is no repository registered" if repos.count == 0
52
+ return [true, msg]
53
+ else
54
+ return [false, "User #{login} is not registered"]
55
+ end
56
+ end
57
+
16
58
  def user_add(argv)
17
59
  login, = argv
18
60
  user = User.new(login: login)
@@ -31,6 +73,16 @@ module Gritano
31
73
  return [false, "User #{login} could not be removed."]
32
74
  end
33
75
 
76
+ def repo_list(argv)
77
+ msg = "Repositories:\n"
78
+ repos = Repository.all
79
+ repos.each do |repo|
80
+ msg += " - #{repo.name}\n"
81
+ end
82
+ msg = "there is no repository registered" if repos.count == 0
83
+ return [true, msg]
84
+ end
85
+
34
86
  def repo_add(argv)
35
87
  name, = argv
36
88
  repo = Repository.new(name: name, path: @repo_path)
@@ -38,6 +90,21 @@ module Gritano
38
90
  return [false, "Repository #{name} could not be created."]
39
91
  end
40
92
 
93
+ def repo_users(argv)
94
+ name, = argv
95
+ repo = Repository.find_by_name(name)
96
+ if repo
97
+ users = repo.users
98
+ msg = "Users:\n"
99
+ users.each do |user|
100
+ msg += " - #{user.login}\n"
101
+ end
102
+ msg = "No user have access to this repository" if users.count == 0
103
+ return [true, msg]
104
+ end
105
+ return [false, "Repository #{name} doesn't exist."]
106
+ end
107
+
41
108
  def repo_rm(argv)
42
109
  name, = argv
43
110
  repo = Repository.find_by_name(name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gritano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-22 00:00:00.000000000 Z
12
+ date: 2012-10-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -245,7 +245,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
245
245
  version: '0'
246
246
  segments:
247
247
  - 0
248
- hash: 4053165706733328578
248
+ hash: 1207246342986126643
249
249
  required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  none: false
251
251
  requirements: