gritano 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +10 -10
- data/Gemfile.lock +10 -10
- data/README.rdoc +3 -3
- data/TODO +11 -18
- data/VERSION +1 -1
- data/bin/gritano +6 -6
- data/features/console.feature +66 -66
- data/features/polices.feature +54 -54
- data/features/step_definitions/console_step.rb +3 -9
- data/gritano.gemspec +32 -32
- data/lib/gritano/console.rb +7 -7
- data/spec/console_spec.rb +18 -18
- metadata +23 -23
data/Gemfile
CHANGED
@@ -3,18 +3,18 @@ source "http://rubygems.org"
|
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
|
6
|
-
gem 'activerecord'
|
7
|
-
gem 'sqlite3'
|
8
|
-
gem 'grit'
|
6
|
+
gem 'activerecord', ">= 3.2.8"
|
7
|
+
gem 'sqlite3', ">= 1.3.6"
|
8
|
+
gem 'grit', ">= 2.5.0"
|
9
9
|
|
10
10
|
# Add dependencies to develop your gem here.
|
11
11
|
# Include everything needed to run rake, tests, features, etc.
|
12
12
|
group :development do
|
13
|
-
gem "rspec"
|
14
|
-
gem "rdoc"
|
15
|
-
gem "cucumber"
|
16
|
-
gem "bundler"
|
17
|
-
gem "jeweler"
|
18
|
-
gem "simplecov"
|
19
|
-
gem 'database_cleaner'
|
13
|
+
gem "rspec", ">= 2.11.0"
|
14
|
+
gem "rdoc", ">= 3.12"
|
15
|
+
gem "cucumber", ">= 1.2.1"
|
16
|
+
gem "bundler", ">= 1.0"
|
17
|
+
gem "jeweler", ">= 1.8.4"
|
18
|
+
gem "simplecov", ">= 0.6.4"
|
19
|
+
gem 'database_cleaner', ">= 0.8.0"
|
20
20
|
end
|
data/Gemfile.lock
CHANGED
@@ -60,13 +60,13 @@ PLATFORMS
|
|
60
60
|
ruby
|
61
61
|
|
62
62
|
DEPENDENCIES
|
63
|
-
activerecord
|
64
|
-
bundler
|
65
|
-
cucumber
|
66
|
-
database_cleaner
|
67
|
-
grit
|
68
|
-
jeweler
|
69
|
-
rdoc
|
70
|
-
rspec
|
71
|
-
simplecov
|
72
|
-
sqlite3
|
63
|
+
activerecord (>= 3.2.8)
|
64
|
+
bundler (>= 1.0)
|
65
|
+
cucumber (>= 1.2.1)
|
66
|
+
database_cleaner (>= 0.8.0)
|
67
|
+
grit (>= 2.5.0)
|
68
|
+
jeweler (>= 1.8.4)
|
69
|
+
rdoc (>= 3.12)
|
70
|
+
rspec (>= 2.11.0)
|
71
|
+
simplecov (>= 0.6.4)
|
72
|
+
sqlite3 (>= 1.3.6)
|
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= Gritano v0.2.
|
1
|
+
= Gritano v0.2.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
|
|
@@ -25,7 +25,7 @@ After that you can add users:
|
|
25
25
|
|
26
26
|
add user's public keys:
|
27
27
|
|
28
|
-
$ gritano user
|
28
|
+
$ gritano user addkey igorbonadio mykey < id_rsa.pub
|
29
29
|
|
30
30
|
create bare repositories:
|
31
31
|
|
@@ -33,7 +33,7 @@ create bare repositories:
|
|
33
33
|
|
34
34
|
and control access:
|
35
35
|
|
36
|
-
$ gritano repo
|
36
|
+
$ gritano repo addread proj.git igorbonadio
|
37
37
|
|
38
38
|
== User Access
|
39
39
|
|
data/TODO
CHANGED
@@ -1,26 +1,19 @@
|
|
1
|
+
v0.2.2
|
2
|
+
- uniformizar o uso de add e rm
|
3
|
+
|
1
4
|
v0.3.0
|
2
5
|
- acesso administrativo via ssh
|
3
6
|
ssh git@host.com user add username
|
4
7
|
ssh git@host.com user rm username
|
5
|
-
ssh git@host.com user
|
6
|
-
ssh git@host.com user
|
8
|
+
ssh git@host.com user addkey username keyname < key.pub
|
9
|
+
ssh git@host.com user rmkey username keyname
|
7
10
|
ssh git@host.com repo add reponame.git
|
8
11
|
ssh git@host.com repo rm reponame.git
|
9
|
-
ssh git@host.com repo
|
10
|
-
ssh git@host.com repo
|
11
|
-
ssh git@host.com repo
|
12
|
-
ssh git@host.com repo
|
12
|
+
ssh git@host.com repo addread reponame.git username
|
13
|
+
ssh git@host.com repo addwrite reponame.git username
|
14
|
+
ssh git@host.com repo rmread reponame.git username
|
15
|
+
ssh git@host.com repo rmwrite reponame.git username
|
13
16
|
|
14
17
|
v0.4.0
|
15
|
-
-
|
16
|
-
|
17
|
-
- usuários (estender os comando de usuários):
|
18
|
-
ssh git@host.com repo add reponame.git
|
19
|
-
ssh git@host.com repo rm reponame.git
|
20
|
-
ssh git@host.com repo +read reponame.git username
|
21
|
-
ssh git@host.com repo +write reponame.git username
|
22
|
-
ssh git@host.com repo -read reponame.git username
|
23
|
-
ssh git@host.com repo -write reponame.git username
|
24
|
-
|
25
|
-
v1.0.0
|
26
|
-
- melhorar sistema de dependencias
|
18
|
+
- usuário pode (ou não) criar repositorios via ssh
|
19
|
+
ssh git@host.com repo add reponame.git
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/bin/gritano
CHANGED
@@ -14,17 +14,17 @@ def help
|
|
14
14
|
gritano install
|
15
15
|
gritano user add username
|
16
16
|
gritano user rm username
|
17
|
-
gritano user
|
18
|
-
gritano user
|
17
|
+
gritano user addkey username keyname < key.pub
|
18
|
+
gritano user rmkey username keyname
|
19
19
|
gritano user list
|
20
20
|
gritano user keys username
|
21
21
|
gritano user repos username
|
22
22
|
gritano repo add reponame.git
|
23
23
|
gritano repo rm reponame.git
|
24
|
-
gritano repo
|
25
|
-
gritano repo
|
26
|
-
gritano repo
|
27
|
-
gritano repo
|
24
|
+
gritano repo addread reponame.git username
|
25
|
+
gritano repo addwrite reponame.git username
|
26
|
+
gritano repo rmread reponame.git username
|
27
|
+
gritano repo rmwrite reponame.git username
|
28
28
|
gritano repo list
|
29
29
|
gritano repo users reponame.git
|
30
30
|
|
data/features/console.feature
CHANGED
@@ -1,67 +1,67 @@
|
|
1
1
|
Feature: Console operations
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
2
|
+
In order to use gritano via console
|
3
|
+
As a user
|
4
|
+
I want to execute some commands
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given the following users exist:
|
8
|
+
| login |
|
9
|
+
| igorbonadio |
|
10
|
+
| jessicaeto |
|
11
|
+
|
12
|
+
And the following keys exist:
|
13
|
+
| login | key |
|
14
|
+
| igorbonadio | eva |
|
15
|
+
| jessicaeto | hal |
|
16
|
+
|
17
|
+
And the following repositories exist:
|
18
|
+
| name |
|
19
|
+
| tmp/gritano.git |
|
20
|
+
| tmp/jeka.git |
|
21
|
+
|
22
|
+
And the following permissions exist:
|
23
|
+
| user | repo | access |
|
24
|
+
| igorbonadio | tmp/gritano.git | read |
|
25
|
+
| igorbonadio | tmp/gritano.git | write |
|
26
|
+
| igorbonadio | tmp/jeka.git | read |
|
27
|
+
| jessicaeto | tmp/jeka.git | read |
|
28
|
+
| jessicaeto | tmp/jeka.git | write |
|
29
|
+
|
30
|
+
Scenario Outline: Add user
|
31
|
+
Given I start the gritano console
|
32
|
+
When I execute "<command>"
|
33
|
+
Then I should see a <result> message
|
34
|
+
Examples:
|
35
|
+
| command | result |
|
36
|
+
| user add jose | success |
|
37
|
+
| user addkey igorbonadio marvin | success |
|
38
|
+
| user rmkey igorbonadio eva | success |
|
39
|
+
| user rm igorbonadio | success |
|
40
|
+
| user list | success |
|
41
|
+
| user keys igorbonadio | success |
|
42
|
+
| user repos igorbonadio | success |
|
43
|
+
| repo add tmp/p-lang.git | success |
|
44
|
+
| repo rm tmp/jeka.git | success |
|
45
|
+
| repo addread tmp/gritano.git jessicaeto | success |
|
46
|
+
| repo addwrite tmp/gritano.git jessicaeto | success |
|
47
|
+
| repo rmread tmp/jeka.git igorbonadio | success |
|
48
|
+
| repo rmwrite tmp/gritano.git igorbonadio | success |
|
49
|
+
| repo list | success |
|
50
|
+
| repo users tmp/jeka.git | success |
|
51
|
+
| user add igorbonadio | error |
|
52
|
+
| user rm jose | error |
|
53
|
+
| user addkey userrr marvino | error |
|
54
|
+
| user rmkey igorbonadio marvino | error |
|
55
|
+
| user keys arybonadio | error |
|
56
|
+
| user repos arybonadio | error |
|
57
|
+
| repo add tmp/jeka.git | error |
|
58
|
+
| repo rm tmp/p-lang.git | error |
|
59
|
+
| repo addread tmp/gritano.git arybonadio | error |
|
60
|
+
| repo addread tmp/p-lang.git jessicaeto | error |
|
61
|
+
| repo addwrite tmp/gritano.git arybonadio | error |
|
62
|
+
| repo addwrite tmp/p-lang.git jessicaeto | error |
|
63
|
+
| repo rmread tmp/jeka.git aribonadio | error |
|
64
|
+
| repo rmread tmp/p-lang.git igorbonadio | error |
|
65
|
+
| repo rmwrite tmp/gritano.git arybonadio | error |
|
66
|
+
| repo rmwrite tmp/p-lang.git igorbonadio | error |
|
67
|
+
| repo users tmp/ruby.git | error |
|
data/features/polices.feature
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
Feature: Policies
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
2
|
+
In order to restrict access to repositories
|
3
|
+
As Gritano
|
4
|
+
I want to create policies
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given the following users exist:
|
8
|
+
| login |
|
9
|
+
| igorbonadio |
|
10
|
+
| jessicaeto |
|
11
|
+
|
12
|
+
And the following repositories exist:
|
13
|
+
| name |
|
14
|
+
| tmp/gritano.git |
|
15
|
+
| tmp/jeka.git |
|
16
|
+
|
17
|
+
And the following permissions exist:
|
18
|
+
| user | repo | access |
|
19
|
+
| igorbonadio | tmp/gritano.git | read |
|
20
|
+
| igorbonadio | tmp/gritano.git | write |
|
21
|
+
| igorbonadio | tmp/jeka.git | read |
|
22
|
+
| jessicaeto | tmp/jeka.git | read |
|
23
|
+
| jessicaeto | tmp/jeka.git | write |
|
24
|
+
|
25
|
+
Scenario Outline: Create a new user
|
26
|
+
Given I create a new user called "<user>"
|
27
|
+
When I check if "<user>" has <access> access to "<repo>"
|
28
|
+
Then I should see that the access is <result>
|
29
|
+
Examples:
|
30
|
+
| user | access | repo | result |
|
31
|
+
| arybonadio | read | tmp/gritano.git | denied |
|
32
|
+
| arybonadio | write | tmp/gritano.git | denied |
|
33
|
+
|
34
|
+
Scenario Outline: Create a new repository
|
35
|
+
Given I create a new repository called "<repo>" to "<user>"
|
36
|
+
Then I should see that only "<user>" has access to "<repo>"
|
37
|
+
Examples:
|
38
|
+
| user | repo |
|
39
|
+
| igorbonadio | tmp/p-lang.git |
|
40
|
+
| jessicaeto | tmp/pabel.git |
|
41
|
+
|
42
|
+
Scenario Outline: Edit access permission
|
43
|
+
Given I <op> "<user>" <permission> access to "<repo>"
|
44
|
+
When I check if "<user>" has <access> access to "<repo>"
|
45
|
+
Then I should see that the access is <result>
|
46
|
+
Examples:
|
47
|
+
| op | user | permission | repo | access | result |
|
48
|
+
| add | igorbonadio | read | tmp/jeka.git | read | allowed |
|
49
|
+
| add | igorbonadio | read | tmp/jeka.git | write | denied |
|
50
|
+
| add | igorbonadio | write | tmp/jeka.git | read | allowed |
|
51
|
+
| add | igorbonadio | write | tmp/jeka.git | write | allowed |
|
52
|
+
| remove | jessicaeto | read | tmp/jeka.git | read | denied |
|
53
|
+
| remove | jessicaeto | read | tmp/jeka.git | write | allowed |
|
54
|
+
| remove | jessicaeto | write | tmp/jeka.git | read | allowed |
|
55
|
+
| remove | jessicaeto | write | tmp/jeka.git | write | denied |
|
@@ -1,9 +1,3 @@
|
|
1
|
-
class FakeSTDIN
|
2
|
-
def read
|
3
|
-
"Your SSHKEY here..."
|
4
|
-
end
|
5
|
-
end
|
6
|
-
|
7
1
|
Given /^I start the gritano console$/ do
|
8
2
|
stdin = double()
|
9
3
|
stdin.stub(:read).and_return("Your SSHKEY here...")
|
@@ -15,8 +9,8 @@ When /^I execute "(.*?)"$/ do |command|
|
|
15
9
|
@output = @console.execute(command.split(' '))
|
16
10
|
end
|
17
11
|
|
18
|
-
Then /^I should see a (success|error) message$/ do |
|
19
|
-
expected_output = true if
|
20
|
-
expected_output = false if
|
12
|
+
Then /^I should see a (success|error) message$/ do |result|
|
13
|
+
expected_output = true if result == 'success'
|
14
|
+
expected_output = false if result == 'error'
|
21
15
|
@output[0].should be == expected_output
|
22
16
|
end
|
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.2.
|
8
|
+
s.version = "0.2.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 = "2012-11-
|
12
|
+
s.date = "2012-11-16"
|
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"]
|
@@ -76,39 +76,39 @@ Gem::Specification.new do |s|
|
|
76
76
|
s.specification_version = 3
|
77
77
|
|
78
78
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
79
|
-
s.add_runtime_dependency(%q<activerecord>, [">=
|
80
|
-
s.add_runtime_dependency(%q<sqlite3>, [">=
|
81
|
-
s.add_runtime_dependency(%q<grit>, [">= 0"])
|
82
|
-
s.add_development_dependency(%q<rspec>, [">= 0"])
|
83
|
-
s.add_development_dependency(%q<rdoc>, [">=
|
84
|
-
s.add_development_dependency(%q<cucumber>, [">=
|
85
|
-
s.add_development_dependency(%q<bundler>, [">= 0"])
|
86
|
-
s.add_development_dependency(%q<jeweler>, [">=
|
87
|
-
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
88
|
-
s.add_development_dependency(%q<database_cleaner>, [">= 0"])
|
79
|
+
s.add_runtime_dependency(%q<activerecord>, [">= 3.2.8"])
|
80
|
+
s.add_runtime_dependency(%q<sqlite3>, [">= 1.3.6"])
|
81
|
+
s.add_runtime_dependency(%q<grit>, [">= 2.5.0"])
|
82
|
+
s.add_development_dependency(%q<rspec>, [">= 2.11.0"])
|
83
|
+
s.add_development_dependency(%q<rdoc>, [">= 3.12"])
|
84
|
+
s.add_development_dependency(%q<cucumber>, [">= 1.2.1"])
|
85
|
+
s.add_development_dependency(%q<bundler>, [">= 1.0"])
|
86
|
+
s.add_development_dependency(%q<jeweler>, [">= 1.8.4"])
|
87
|
+
s.add_development_dependency(%q<simplecov>, [">= 0.6.4"])
|
88
|
+
s.add_development_dependency(%q<database_cleaner>, [">= 0.8.0"])
|
89
89
|
else
|
90
|
-
s.add_dependency(%q<activerecord>, [">=
|
91
|
-
s.add_dependency(%q<sqlite3>, [">=
|
92
|
-
s.add_dependency(%q<grit>, [">= 0"])
|
93
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
94
|
-
s.add_dependency(%q<rdoc>, [">=
|
95
|
-
s.add_dependency(%q<cucumber>, [">=
|
96
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
97
|
-
s.add_dependency(%q<jeweler>, [">=
|
98
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
99
|
-
s.add_dependency(%q<database_cleaner>, [">= 0"])
|
90
|
+
s.add_dependency(%q<activerecord>, [">= 3.2.8"])
|
91
|
+
s.add_dependency(%q<sqlite3>, [">= 1.3.6"])
|
92
|
+
s.add_dependency(%q<grit>, [">= 2.5.0"])
|
93
|
+
s.add_dependency(%q<rspec>, [">= 2.11.0"])
|
94
|
+
s.add_dependency(%q<rdoc>, [">= 3.12"])
|
95
|
+
s.add_dependency(%q<cucumber>, [">= 1.2.1"])
|
96
|
+
s.add_dependency(%q<bundler>, [">= 1.0"])
|
97
|
+
s.add_dependency(%q<jeweler>, [">= 1.8.4"])
|
98
|
+
s.add_dependency(%q<simplecov>, [">= 0.6.4"])
|
99
|
+
s.add_dependency(%q<database_cleaner>, [">= 0.8.0"])
|
100
100
|
end
|
101
101
|
else
|
102
|
-
s.add_dependency(%q<activerecord>, [">=
|
103
|
-
s.add_dependency(%q<sqlite3>, [">=
|
104
|
-
s.add_dependency(%q<grit>, [">= 0"])
|
105
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
106
|
-
s.add_dependency(%q<rdoc>, [">=
|
107
|
-
s.add_dependency(%q<cucumber>, [">=
|
108
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
109
|
-
s.add_dependency(%q<jeweler>, [">=
|
110
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
111
|
-
s.add_dependency(%q<database_cleaner>, [">= 0"])
|
102
|
+
s.add_dependency(%q<activerecord>, [">= 3.2.8"])
|
103
|
+
s.add_dependency(%q<sqlite3>, [">= 1.3.6"])
|
104
|
+
s.add_dependency(%q<grit>, [">= 2.5.0"])
|
105
|
+
s.add_dependency(%q<rspec>, [">= 2.11.0"])
|
106
|
+
s.add_dependency(%q<rdoc>, [">= 3.12"])
|
107
|
+
s.add_dependency(%q<cucumber>, [">= 1.2.1"])
|
108
|
+
s.add_dependency(%q<bundler>, [">= 1.0"])
|
109
|
+
s.add_dependency(%q<jeweler>, [">= 1.8.4"])
|
110
|
+
s.add_dependency(%q<simplecov>, [">= 0.6.4"])
|
111
|
+
s.add_dependency(%q<database_cleaner>, [">= 0.8.0"])
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
data/lib/gritano/console.rb
CHANGED
@@ -11,7 +11,7 @@ module Gritano
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def execute(argv)
|
14
|
-
send(argv[0..1].join('_')
|
14
|
+
send(argv[0..1].join('_'), argv[2..-1])
|
15
15
|
end
|
16
16
|
|
17
17
|
def user_list(argv)
|
@@ -122,7 +122,7 @@ module Gritano
|
|
122
122
|
return [false, "Repository #{name} could not be removed."]
|
123
123
|
end
|
124
124
|
|
125
|
-
def
|
125
|
+
def repo_addread(argv)
|
126
126
|
repo_name, login = argv
|
127
127
|
user = User.find_by_login(login)
|
128
128
|
repo = Repository.find_by_name(repo_name)
|
@@ -132,7 +132,7 @@ module Gritano
|
|
132
132
|
return [false, "An error occurred. Permissions was not modified."]
|
133
133
|
end
|
134
134
|
|
135
|
-
def
|
135
|
+
def repo_addwrite(argv)
|
136
136
|
repo_name, login = argv
|
137
137
|
user = User.find_by_login(login)
|
138
138
|
repo = Repository.find_by_name(repo_name)
|
@@ -142,7 +142,7 @@ module Gritano
|
|
142
142
|
return [false, "An error occurred. Permissions was not modified."]
|
143
143
|
end
|
144
144
|
|
145
|
-
def
|
145
|
+
def repo_rmread(argv)
|
146
146
|
repo_name, login = argv
|
147
147
|
user = User.find_by_login(login)
|
148
148
|
repo = Repository.find_by_name(repo_name)
|
@@ -152,7 +152,7 @@ module Gritano
|
|
152
152
|
return [false, "An error occurred. Permissions was not modified."]
|
153
153
|
end
|
154
154
|
|
155
|
-
def
|
155
|
+
def repo_rmwrite(argv)
|
156
156
|
repo_name, login = argv
|
157
157
|
user = User.find_by_login(login)
|
158
158
|
repo = Repository.find_by_name(repo_name)
|
@@ -162,7 +162,7 @@ module Gritano
|
|
162
162
|
return [false, "An error occurred. Permissions was not modified."]
|
163
163
|
end
|
164
164
|
|
165
|
-
def
|
165
|
+
def user_addkey(argv)
|
166
166
|
login, key_name, key_file = argv
|
167
167
|
user = User.find_by_login(login)
|
168
168
|
if user
|
@@ -175,7 +175,7 @@ module Gritano
|
|
175
175
|
return [false, "Key could not be added."]
|
176
176
|
end
|
177
177
|
|
178
|
-
def
|
178
|
+
def user_rmkey(argv)
|
179
179
|
login, key_name = argv
|
180
180
|
key = Key.where(name: key_name).includes(:user).where("users.login" => login).limit(1)[0]
|
181
181
|
if key
|
data/spec/console_spec.rb
CHANGED
@@ -18,14 +18,14 @@ describe Gritano::Console do
|
|
18
18
|
@console.execute("user rm igorbonadio".split(' '))
|
19
19
|
end
|
20
20
|
|
21
|
-
it "should respond to gritano user
|
22
|
-
@console.should_receive(:
|
23
|
-
@console.execute("user
|
21
|
+
it "should respond to gritano user addkey username keyname < key.pub" do
|
22
|
+
@console.should_receive(:user_addkey)
|
23
|
+
@console.execute("user addkey igorbonadio keyname".split(' '))
|
24
24
|
end
|
25
25
|
|
26
|
-
it "should respond to gritano user
|
27
|
-
@console.should_receive(:
|
28
|
-
@console.execute("user
|
26
|
+
it "should respond to gritano user rmkey username keyname" do
|
27
|
+
@console.should_receive(:user_rmkey)
|
28
|
+
@console.execute("user rmkey username keyname".split(' '))
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should respond to gritano user list" do
|
@@ -53,24 +53,24 @@ describe Gritano::Console do
|
|
53
53
|
@console.execute("repo rm tmp/reponame.git".split(' '))
|
54
54
|
end
|
55
55
|
|
56
|
-
it "should respond to gritano repo
|
57
|
-
@console.should_receive(:
|
58
|
-
@console.execute("repo
|
56
|
+
it "should respond to gritano repo addread igorbonadio tmp/reponame.git" do
|
57
|
+
@console.should_receive(:repo_addread)
|
58
|
+
@console.execute("repo addread igorbonadio tmp/reponame.git".split(' '))
|
59
59
|
end
|
60
60
|
|
61
|
-
it "should respond to gritano repo
|
62
|
-
@console.should_receive(:
|
63
|
-
@console.execute("repo
|
61
|
+
it "should respond to gritano repo addwrite igorbonadio tmp/reponame.git" do
|
62
|
+
@console.should_receive(:repo_addwrite)
|
63
|
+
@console.execute("repo addwrite igorbonadio tmp/reponame.git".split(' '))
|
64
64
|
end
|
65
65
|
|
66
|
-
it "should respond to gritano repo
|
67
|
-
@console.should_receive(:
|
68
|
-
@console.execute("repo
|
66
|
+
it "should respond to gritano repo rmread igorbonadio tmp/reponame.git" do
|
67
|
+
@console.should_receive(:repo_rmread)
|
68
|
+
@console.execute("repo rmread igorbonadio tmp/reponame.git".split(' '))
|
69
69
|
end
|
70
70
|
|
71
|
-
it "should respond to gritano repo
|
72
|
-
@console.should_receive(:
|
73
|
-
@console.execute("repo
|
71
|
+
it "should respond to gritano repo rmwrite igorbonadio tmp/reponame.git" do
|
72
|
+
@console.should_receive(:repo_rmwrite)
|
73
|
+
@console.execute("repo rmwrite igorbonadio tmp/reponame.git".split(' '))
|
74
74
|
end
|
75
75
|
|
76
76
|
it "should respond to gritano repo list" do
|
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.2.
|
4
|
+
version: 0.2.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: 2012-11-
|
12
|
+
date: 2012-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 3.2.8
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 3.2.8
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: sqlite3
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 1.3.6
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: 1.3.6
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: grit
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 2.5.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.5.0
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rspec
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ! '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 2.11.0
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 2.11.0
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: rdoc
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - ! '>='
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: '
|
85
|
+
version: '3.12'
|
86
86
|
type: :development
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ! '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
93
|
+
version: '3.12'
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: cucumber
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - ! '>='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
101
|
+
version: 1.2.1
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: 1.2.1
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: bundler
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ! '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
117
|
+
version: '1.0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - ! '>='
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
125
|
+
version: '1.0'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: jeweler
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ! '>='
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
133
|
+
version: 1.8.4
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ! '>='
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
141
|
+
version: 1.8.4
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: simplecov
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,7 +146,7 @@ dependencies:
|
|
146
146
|
requirements:
|
147
147
|
- - ! '>='
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
149
|
+
version: 0.6.4
|
150
150
|
type: :development
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -154,7 +154,7 @@ dependencies:
|
|
154
154
|
requirements:
|
155
155
|
- - ! '>='
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
157
|
+
version: 0.6.4
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
159
|
name: database_cleaner
|
160
160
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,7 +162,7 @@ dependencies:
|
|
162
162
|
requirements:
|
163
163
|
- - ! '>='
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
165
|
+
version: 0.8.0
|
166
166
|
type: :development
|
167
167
|
prerelease: false
|
168
168
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -170,7 +170,7 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - ! '>='
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: 0.8.0
|
174
174
|
description: Gritano is the simplest way to configure your git server over ssh. You
|
175
175
|
can create repositories and manage user access.
|
176
176
|
email: igorbonadio@gmail.com
|
@@ -245,7 +245,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
245
245
|
version: '0'
|
246
246
|
segments:
|
247
247
|
- 0
|
248
|
-
hash:
|
248
|
+
hash: 192850333012962786
|
249
249
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
250
250
|
none: false
|
251
251
|
requirements:
|