gritano 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. data/README.rdoc +1 -1
  2. data/TODO +6 -4
  3. data/VERSION +1 -1
  4. data/db/migrate/006_add_email_to_users.rb +10 -0
  5. data/features/data/local_commands/user_email_add_igorbonadio_igor@bonadio_com.txt +1 -0
  6. data/features/data/local_commands/user_email_add_wrong_igor@bonadio_com.txt +1 -0
  7. data/features/data/local_commands/user_email_igorbonadio.txt +1 -0
  8. data/features/data/local_commands/user_email_jessicaeto.txt +1 -0
  9. data/features/data/local_commands/user_email_wrong.txt +1 -0
  10. data/features/data/local_commands/user_list.txt +6 -6
  11. data/features/data/local_help.txt +2 -0
  12. data/features/data/remote_commands/admin_help_igorbonadio.txt +2 -0
  13. data/features/data/remote_commands/admin_help_jessicaeto.txt +2 -0
  14. data/features/data/remote_commands/admin_user_email_add_igorbonadio_igor@bonadio_com_igorbonadio.txt +1 -0
  15. data/features/data/remote_commands/admin_user_email_add_igorbonadio_igor@bonadio_com_jessicaeto.txt +1 -0
  16. data/features/data/remote_commands/admin_user_email_add_wrong_igor@bonadio_com_igorbonadio.txt +1 -0
  17. data/features/data/remote_commands/admin_user_email_add_wrong_igor@bonadio_com_jessicaeto.txt +1 -0
  18. data/features/data/remote_commands/admin_user_email_igorbonadio_igorbonadio.txt +1 -0
  19. data/features/data/remote_commands/admin_user_email_igorbonadio_jessicaeto.txt +1 -0
  20. data/features/data/remote_commands/admin_user_email_jessicaeto_igorbonadio.txt +1 -0
  21. data/features/data/remote_commands/admin_user_email_jessicaeto_jessicaeto.txt +1 -0
  22. data/features/data/remote_commands/admin_user_email_wrong_igorbonadio.txt +1 -0
  23. data/features/data/remote_commands/admin_user_email_wrong_jessicaeto.txt +1 -0
  24. data/features/data/remote_commands/admin_user_list_igorbonadio.txt +6 -6
  25. data/features/local.feature +5 -0
  26. data/features/remote.feature +10 -0
  27. data/features/step_definitions/background_step.rb +3 -0
  28. data/gritano.gemspec +18 -2
  29. data/lib/gritano/console/executor.rb +26 -2
  30. metadata +19 -3
data/README.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- = Gritano v0.8.0
1
+ = Gritano v0.9.0
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,4 +1,6 @@
1
- v0.9.0
2
- - email
3
- - envio de pubkey via codigo/email
4
-
1
+ v0.9.1
2
+ - criação de usuários automática
3
+ gritano user:add igorbonadio igorbonadio@gmail.com admin
4
+
5
+ v0.10.0
6
+ - recuperação de senha via email
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.1
1
+ 0.9.0
@@ -0,0 +1,10 @@
1
+ class AddEmailToUsers < ActiveRecord::Migration
2
+ def up
3
+ add_column :users, :email, :string
4
+ end
5
+
6
+ def down
7
+ remove_column :users, :email
8
+ end
9
+ end
10
+
@@ -0,0 +1 @@
1
+ error: Email could not be added.
@@ -0,0 +1 @@
1
+ error: User does not have email.
@@ -0,0 +1 @@
1
+ jessica@eto.com
@@ -0,0 +1 @@
1
+ error: User does not exist.
@@ -1,6 +1,6 @@
1
- +-------------+
2
- | user |
3
- +-------------+
4
- | igorbonadio |
5
- | jessicaeto |
6
- +-------------+
1
+ +-------------+-----------------+
2
+ | user | email |
3
+ +-------------+-----------------+
4
+ | igorbonadio | - |
5
+ | jessicaeto | jessica@eto.com |
6
+ +-------------+-----------------+
@@ -15,6 +15,8 @@
15
15
  gritano user:repo:list username
16
16
  gritano user:add username
17
17
  gritano user:rm username
18
+ gritano user:email:add username email@server.com
19
+ gritano user:email username
18
20
  gritano user:key:add username keyname < key.pub
19
21
  gritano user:key:rm username keyname
20
22
  gritano user:admin:add username
@@ -15,6 +15,8 @@
15
15
  ssh git@host.com admin:user:repo:list username
16
16
  ssh git@host.com admin:user:add username
17
17
  ssh git@host.com admin:user:rm username
18
+ ssh git@host.com admin:user:email:add username email@server.com
19
+ ssh git@host.com admin:user:email username
18
20
  ssh git@host.com admin:user:key:add username keyname < key.pub
19
21
  ssh git@host.com admin:user:key:rm username keyname
20
22
  ssh git@host.com admin:user:admin:add username
@@ -15,6 +15,8 @@
15
15
  ssh git@host.com admin:user:repo:list username
16
16
  ssh git@host.com admin:user:add username
17
17
  ssh git@host.com admin:user:rm username
18
+ ssh git@host.com admin:user:email:add username email@server.com
19
+ ssh git@host.com admin:user:email username
18
20
  ssh git@host.com admin:user:key:add username keyname < key.pub
19
21
  ssh git@host.com admin:user:key:rm username keyname
20
22
  ssh git@host.com admin:user:admin:add username
@@ -0,0 +1 @@
1
+ error: User does not have email.
@@ -0,0 +1 @@
1
+ error: User does not exist.
@@ -0,0 +1 @@
1
+ error: access denied
@@ -1,6 +1,6 @@
1
- +-------------+
2
- | user |
3
- +-------------+
4
- | igorbonadio |
5
- | jessicaeto |
6
- +-------------+
1
+ +-------------+-----------------+
2
+ | user | email |
3
+ +-------------+-----------------+
4
+ | igorbonadio | - |
5
+ | jessicaeto | jessica@eto.com |
6
+ +-------------+-----------------+
@@ -43,6 +43,11 @@ Feature: Local access
43
43
  | user:key:add igorbonadio marvin |
44
44
  | user:key:rm igorbonadio eva |
45
45
  | user:rm igorbonadio |
46
+ | user:email:add igorbonadio igor@bonadio.com |
47
+ | user:email:add wrong igor@bonadio.com |
48
+ | user:email igorbonadio |
49
+ | user:email jessicaeto |
50
+ | user:email wrong |
46
51
  | user:list |
47
52
  | user:key:list igorbonadio |
48
53
  | user:repo:list igorbonadio |
@@ -65,6 +65,11 @@ Feature: Remote access
65
65
  | admin:user:add jose |
66
66
  | admin:user:key:add igorbonadio marvin |
67
67
  | admin:user:key:rm igorbonadio eva |
68
+ | admin:user:email:add igorbonadio igor@bonadio.com |
69
+ | admin:user:email:add wrong igor@bonadio.com |
70
+ | admin:user:email igorbonadio |
71
+ | admin:user:email wrong |
72
+ | admin:user:email jessicaeto |
68
73
  | admin:user:rm igorbonadio |
69
74
  | admin:user:list |
70
75
  | admin:user:key:list igorbonadio |
@@ -123,6 +128,11 @@ Feature: Remote access
123
128
  | admin:help |
124
129
  | admin:version |
125
130
  | admin:user:add jose |
131
+ | admin:user:email:add igorbonadio igor@bonadio.com |
132
+ | admin:user:email:add wrong igor@bonadio.com |
133
+ | admin:user:email igorbonadio |
134
+ | admin:user:email wrong |
135
+ | admin:user:email jessicaeto |
126
136
  | admin:user:key:add igorbonadio marvin |
127
137
  | admin:user:key:rm igorbonadio eva |
128
138
  | admin:user:rm igorbonadio |
@@ -2,6 +2,9 @@ Given /^the following users exist:$/ do |table|
2
2
  table.hashes.each do |user|
3
3
  Gritano::User.create(user)
4
4
  end
5
+ jessica = Gritano::User.find_by_login("jessicaeto")
6
+ jessica.email = "jessica@eto.com"
7
+ jessica.save
5
8
  end
6
9
 
7
10
  Given /^the following keys exist:$/ do |table|
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.8.1"
8
+ s.version = "0.9.0"
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-16"
12
+ s.date = "2013-03-23"
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"]
@@ -38,6 +38,7 @@ Gem::Specification.new do |s|
38
38
  "db/migrate/003_create_permissions.rb",
39
39
  "db/migrate/004_create_keys.rb",
40
40
  "db/migrate/005_add_admin_to_users.rb",
41
+ "db/migrate/006_add_email_to_users.rb",
41
42
  "features/data/config_true.yml",
42
43
  "features/data/local_commands/addon_list.txt",
43
44
  "features/data/local_commands/addon_ssh_install.txt",
@@ -78,6 +79,11 @@ Gem::Specification.new do |s|
78
79
  "features/data/local_commands/user_admin_add_igorbonadio.txt",
79
80
  "features/data/local_commands/user_admin_rm_arybonadio.txt",
80
81
  "features/data/local_commands/user_admin_rm_igorbonadio.txt",
82
+ "features/data/local_commands/user_email_add_igorbonadio_igor@bonadio_com.txt",
83
+ "features/data/local_commands/user_email_add_wrong_igor@bonadio_com.txt",
84
+ "features/data/local_commands/user_email_igorbonadio.txt",
85
+ "features/data/local_commands/user_email_jessicaeto.txt",
86
+ "features/data/local_commands/user_email_wrong.txt",
81
87
  "features/data/local_commands/user_key_add_igorbonadio_marvin.txt",
82
88
  "features/data/local_commands/user_key_add_userrr_marvino.txt",
83
89
  "features/data/local_commands/user_key_list_arybonadio.txt",
@@ -161,6 +167,16 @@ Gem::Specification.new do |s|
161
167
  "features/data/remote_commands/admin_user_admin_rm_arybonadio_jessicaeto.txt",
162
168
  "features/data/remote_commands/admin_user_admin_rm_igorbonadio_igorbonadio.txt",
163
169
  "features/data/remote_commands/admin_user_admin_rm_igorbonadio_jessicaeto.txt",
170
+ "features/data/remote_commands/admin_user_email_add_igorbonadio_igor@bonadio_com_igorbonadio.txt",
171
+ "features/data/remote_commands/admin_user_email_add_igorbonadio_igor@bonadio_com_jessicaeto.txt",
172
+ "features/data/remote_commands/admin_user_email_add_wrong_igor@bonadio_com_igorbonadio.txt",
173
+ "features/data/remote_commands/admin_user_email_add_wrong_igor@bonadio_com_jessicaeto.txt",
174
+ "features/data/remote_commands/admin_user_email_igorbonadio_igorbonadio.txt",
175
+ "features/data/remote_commands/admin_user_email_igorbonadio_jessicaeto.txt",
176
+ "features/data/remote_commands/admin_user_email_jessicaeto_igorbonadio.txt",
177
+ "features/data/remote_commands/admin_user_email_jessicaeto_jessicaeto.txt",
178
+ "features/data/remote_commands/admin_user_email_wrong_igorbonadio.txt",
179
+ "features/data/remote_commands/admin_user_email_wrong_jessicaeto.txt",
164
180
  "features/data/remote_commands/admin_user_key_add_igorbonadio_marvin_igorbonadio.txt",
165
181
  "features/data/remote_commands/admin_user_key_add_igorbonadio_marvin_jessicaeto.txt",
166
182
  "features/data/remote_commands/admin_user_key_add_userrr_marvino_igorbonadio.txt",
@@ -22,10 +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']
25
+ t << ['user', 'email']
26
26
  t << :separator
27
27
  users.each do |user|
28
- t.add_row [user.login]
28
+ email = "-"
29
+ email = user.email if user.email
30
+ t.add_row [user.login, email]
29
31
  end
30
32
  end
31
33
  msg = "there is no user registered" if users.count == 0
@@ -87,6 +89,28 @@ module Gritano
87
89
  end
88
90
  return [false, "User #{login} could not be removed."]
89
91
  end
92
+
93
+ add_command "user:email:add", "username email@server.com" do |argv|
94
+ login, email = argv
95
+ user = User.find_by_login(login)
96
+ if user
97
+ user.email = email
98
+ if user.save
99
+ return [true, "Email added."]
100
+ end
101
+ end
102
+ return [false, "Email could not be added."]
103
+ end
104
+
105
+ add_command "user:email", "username" do |argv|
106
+ login = argv
107
+ user = User.find_by_login(login)
108
+ if user
109
+ return [true, user.email] if user.email
110
+ return [false, "User does not have email."]
111
+ end
112
+ return [false, "User does not exist."]
113
+ end
90
114
 
91
115
  add_command "user:key:add", "username keyname < key.pub" do |argv|
92
116
  login, key_name, key_file = argv
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.8.1
4
+ version: 0.9.0
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-16 00:00:00.000000000 Z
12
+ date: 2013-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -235,6 +235,7 @@ files:
235
235
  - db/migrate/003_create_permissions.rb
236
236
  - db/migrate/004_create_keys.rb
237
237
  - db/migrate/005_add_admin_to_users.rb
238
+ - db/migrate/006_add_email_to_users.rb
238
239
  - features/data/config_true.yml
239
240
  - features/data/local_commands/addon_list.txt
240
241
  - features/data/local_commands/addon_ssh_install.txt
@@ -275,6 +276,11 @@ files:
275
276
  - features/data/local_commands/user_admin_add_igorbonadio.txt
276
277
  - features/data/local_commands/user_admin_rm_arybonadio.txt
277
278
  - features/data/local_commands/user_admin_rm_igorbonadio.txt
279
+ - features/data/local_commands/user_email_add_igorbonadio_igor@bonadio_com.txt
280
+ - features/data/local_commands/user_email_add_wrong_igor@bonadio_com.txt
281
+ - features/data/local_commands/user_email_igorbonadio.txt
282
+ - features/data/local_commands/user_email_jessicaeto.txt
283
+ - features/data/local_commands/user_email_wrong.txt
278
284
  - features/data/local_commands/user_key_add_igorbonadio_marvin.txt
279
285
  - features/data/local_commands/user_key_add_userrr_marvino.txt
280
286
  - features/data/local_commands/user_key_list_arybonadio.txt
@@ -358,6 +364,16 @@ files:
358
364
  - features/data/remote_commands/admin_user_admin_rm_arybonadio_jessicaeto.txt
359
365
  - features/data/remote_commands/admin_user_admin_rm_igorbonadio_igorbonadio.txt
360
366
  - features/data/remote_commands/admin_user_admin_rm_igorbonadio_jessicaeto.txt
367
+ - features/data/remote_commands/admin_user_email_add_igorbonadio_igor@bonadio_com_igorbonadio.txt
368
+ - features/data/remote_commands/admin_user_email_add_igorbonadio_igor@bonadio_com_jessicaeto.txt
369
+ - features/data/remote_commands/admin_user_email_add_wrong_igor@bonadio_com_igorbonadio.txt
370
+ - features/data/remote_commands/admin_user_email_add_wrong_igor@bonadio_com_jessicaeto.txt
371
+ - features/data/remote_commands/admin_user_email_igorbonadio_igorbonadio.txt
372
+ - features/data/remote_commands/admin_user_email_igorbonadio_jessicaeto.txt
373
+ - features/data/remote_commands/admin_user_email_jessicaeto_igorbonadio.txt
374
+ - features/data/remote_commands/admin_user_email_jessicaeto_jessicaeto.txt
375
+ - features/data/remote_commands/admin_user_email_wrong_igorbonadio.txt
376
+ - features/data/remote_commands/admin_user_email_wrong_jessicaeto.txt
361
377
  - features/data/remote_commands/admin_user_key_add_igorbonadio_marvin_igorbonadio.txt
362
378
  - features/data/remote_commands/admin_user_key_add_igorbonadio_marvin_jessicaeto.txt
363
379
  - features/data/remote_commands/admin_user_key_add_userrr_marvino_igorbonadio.txt
@@ -457,7 +473,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
457
473
  version: '0'
458
474
  segments:
459
475
  - 0
460
- hash: 3254913553267021195
476
+ hash: 3460791225122802249
461
477
  required_rubygems_version: !ruby/object:Gem::Requirement
462
478
  none: false
463
479
  requirements: