gritano 0.9.0 → 0.9.1

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.9.0
1
+ = Gritano v0.9.1
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,6 +1,14 @@
1
- v0.9.1
2
- - criação de usuários automática
3
- gritano user:add igorbonadio igorbonadio@gmail.com admin
1
+ v0.9.1:
2
+ mostar admin -> gritano user:admin igorbonadio @done (13-03-25 21:28)
3
+ ✔ mostrar admin no user:list @done (13-03-25 21:28)
4
+
5
+ v0.9.2:
6
+ ☐ permitir ao usuario mudar seu email
7
+ ☐ arrumar specs
8
+ ☐ travis-cl
4
9
 
5
- v0.10.0
6
- - recuperação de senha via email
10
+ v0.10.0:
11
+ recuperação de senha via email
12
+
13
+ v1.0.0:
14
+ ☐ refatorar e preparar para o lançamento oficial!!!!
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.0
1
+ 0.9.1
@@ -1,6 +1,6 @@
1
- +-------------+-----------------+
2
- | user | email |
3
- +-------------+-----------------+
4
- | igorbonadio | - |
5
- | jessicaeto | jessica@eto.com |
6
- +-------------+-----------------+
1
+ +-------------+-----------------+-------+
2
+ | user | email | admin |
3
+ +-------------+-----------------+-------+
4
+ | igorbonadio | - | true |
5
+ | jessicaeto | jessica@eto.com | false |
6
+ +-------------+-----------------+-------+
@@ -13,7 +13,7 @@
13
13
  gritano user:list
14
14
  gritano user:key:list username
15
15
  gritano user:repo:list username
16
- gritano user:add username
16
+ gritano user:add username [email admin]*
17
17
  gritano user:rm username
18
18
  gritano user:email:add username email@server.com
19
19
  gritano user:email username
@@ -21,6 +21,7 @@
21
21
  gritano user:key:rm username keyname
22
22
  gritano user:admin:add username
23
23
  gritano user:admin:rm username
24
+ gritano user:admin username
24
25
  gritano repo:list
25
26
  gritano repo:add reponame.git [username1 username2 ...]*
26
27
  gritano repo:user:list reponame.git
@@ -13,7 +13,7 @@
13
13
  ssh git@host.com admin:user:list
14
14
  ssh git@host.com admin:user:key:list username
15
15
  ssh git@host.com admin:user:repo:list username
16
- ssh git@host.com admin:user:add username
16
+ ssh git@host.com admin:user:add username [email admin]*
17
17
  ssh git@host.com admin:user:rm username
18
18
  ssh git@host.com admin:user:email:add username email@server.com
19
19
  ssh git@host.com admin:user:email username
@@ -21,6 +21,7 @@
21
21
  ssh git@host.com admin:user:key:rm username keyname
22
22
  ssh git@host.com admin:user:admin:add username
23
23
  ssh git@host.com admin:user:admin:rm username
24
+ ssh git@host.com admin:user:admin username
24
25
  ssh git@host.com admin:repo:list
25
26
  ssh git@host.com admin:repo:add reponame.git [username1 username2 ...]*
26
27
  ssh git@host.com admin:repo:user:list reponame.git
@@ -13,7 +13,7 @@
13
13
  ssh git@host.com admin:user:list
14
14
  ssh git@host.com admin:user:key:list username
15
15
  ssh git@host.com admin:user:repo:list username
16
- ssh git@host.com admin:user:add username
16
+ ssh git@host.com admin:user:add username [email admin]*
17
17
  ssh git@host.com admin:user:rm username
18
18
  ssh git@host.com admin:user:email:add username email@server.com
19
19
  ssh git@host.com admin:user:email username
@@ -21,6 +21,7 @@
21
21
  ssh git@host.com admin:user:key:rm username keyname
22
22
  ssh git@host.com admin:user:admin:add username
23
23
  ssh git@host.com admin:user:admin:rm username
24
+ ssh git@host.com admin:user:admin username
24
25
  ssh git@host.com admin:repo:list
25
26
  ssh git@host.com admin:repo:add reponame.git [username1 username2 ...]*
26
27
  ssh git@host.com admin:repo:user:list reponame.git
@@ -1,6 +1,6 @@
1
- +-------------+-----------------+
2
- | user | email |
3
- +-------------+-----------------+
4
- | igorbonadio | - |
5
- | jessicaeto | jessica@eto.com |
6
- +-------------+-----------------+
1
+ +-------------+-----------------+-------+
2
+ | user | email | admin |
3
+ +-------------+-----------------+-------+
4
+ | igorbonadio | - | true |
5
+ | jessicaeto | jessica@eto.com | false |
6
+ +-------------+-----------------+-------+
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.9.0"
8
+ s.version = "0.9.1"
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 = "2013-03-23"
12
+ s.date = "2013-03-26"
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-pub-key", "gritano-remote"]
@@ -22,12 +22,12 @@ module Gritano
22
22
  add_command "user:list" do |argv|
23
23
  users = User.all
24
24
  msg = Terminal::Table.new do |t|
25
- t << ['user', 'email']
25
+ t << ['user', 'email', 'admin']
26
26
  t << :separator
27
27
  users.each do |user|
28
28
  email = "-"
29
29
  email = user.email if user.email
30
- t.add_row [user.login, email]
30
+ t.add_row [user.login, email, user.admin]
31
31
  end
32
32
  end
33
33
  msg = "there is no user registered" if users.count == 0
@@ -72,9 +72,14 @@ module Gritano
72
72
  end
73
73
  end
74
74
 
75
- add_command "user:add", "username" do |argv|
76
- login, = argv
77
- user = User.new(login: login)
75
+ add_command "user:add", "username [email admin]*" do |argv|
76
+ login, email, admin = argv
77
+ if admin == 'true'
78
+ admin = true
79
+ else
80
+ admin = false
81
+ end
82
+ user = User.new(login: login, email: email, admin: admin)
78
83
  return [true, "User #{login} added."] if user.save
79
84
  return [false, "#{user.errors.full_messages.join(", ")}."]
80
85
  end
@@ -171,6 +176,15 @@ module Gritano
171
176
  return [false, "User #{login} could not be modified"]
172
177
  end
173
178
 
179
+ add_command "user:admin", "username" do |argv|
180
+ login, = argv
181
+ user = User.find_by_login(login)
182
+ if user
183
+ return [true, user.admin]
184
+ end
185
+ return [false, "User #{login} does not exist"]
186
+ end
187
+
174
188
  add_command "repo:list" do |argv|
175
189
  repos = Repository.all
176
190
  msg = Terminal::Table.new do |t|
@@ -31,7 +31,7 @@ module Gritano
31
31
  it "should add users" do
32
32
  user = double()
33
33
  user.should_receive(:save).and_return(true)
34
- User.should_receive(:new).with(login: "login").and_return(user)
34
+ User.should_receive(:new).with(login: "login", email: nil, admin: false).and_return(user)
35
35
  create_executor('.', 'tmp').execute(["user:add", "login"])
36
36
  end
37
37
 
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.9.0
4
+ version: 0.9.1
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: 2013-03-23 00:00:00.000000000 Z
12
+ date: 2013-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -473,7 +473,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
473
473
  version: '0'
474
474
  segments:
475
475
  - 0
476
- hash: 3460791225122802249
476
+ hash: 537137992832981038
477
477
  required_rubygems_version: !ruby/object:Gem::Requirement
478
478
  none: false
479
479
  requirements: