gritano 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/TODO +11 -2
- data/VERSION +1 -1
- data/features/data/local_commands/plugin_exec_ssh_help.txt +10 -0
- data/features/data/local_commands/plugin_exec_ssh_helps.txt +10 -0
- data/features/data/local_commands/plugin_exec_sshs_help.txt +1 -0
- data/features/data/local_commands/plugin_info_sshs.txt +1 -0
- data/features/data/remote_commands/admin_plugin_exec_ssh_help_igorbonadio.txt +10 -0
- data/features/data/remote_commands/admin_plugin_exec_ssh_help_jessicaeto.txt +1 -0
- data/features/data/remote_commands/admin_plugin_exec_ssh_helps_igorbonadio.txt +10 -0
- data/features/data/remote_commands/admin_plugin_exec_ssh_helps_jessicaeto.txt +1 -0
- data/features/data/remote_commands/admin_plugin_exec_sshs_help_igorbonadio.txt +1 -0
- data/features/data/remote_commands/admin_plugin_exec_sshs_help_jessicaeto.txt +1 -0
- data/features/data/remote_commands/admin_plugin_info_sshs_igorbonadio.txt +1 -0
- data/features/data/remote_commands/admin_plugin_info_sshs_jessicaeto.txt +1 -0
- data/features/data/ssh_help.txt +1 -1
- data/features/local.feature +4 -0
- data/features/remote.feature +8 -0
- data/gritano.gemspec +14 -2
- data/lib/gritano/console.rb +2 -0
- data/lib/gritano/console/gritano.rb +13 -13
- data/lib/gritano/plugin.rb +11 -7
- data/spec/plugin_spec.rb +16 -0
- data/spec/plugin_ssh_spec.rb +1 -0
- metadata +15 -3
data/README.rdoc
CHANGED
data/TODO
CHANGED
@@ -1,2 +1,11 @@
|
|
1
|
-
v0.7
|
2
|
-
-
|
1
|
+
v0.7.2
|
2
|
+
- Melhorar mensagens ao compilar SSH
|
3
|
+
- Criar um arquivo de log pra o SSH
|
4
|
+
- mais spec e features (testes)
|
5
|
+
|
6
|
+
v0.7.3
|
7
|
+
- tirar os comando do Console::Gritano
|
8
|
+
- configuracoes via cmd (exec ssh set:port 2222)
|
9
|
+
|
10
|
+
v0.8.0 - WebService
|
11
|
+
v0.9.0 - WebSite
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.1
|
@@ -0,0 +1 @@
|
|
1
|
+
error: There isn't a plugin called sshs
|
@@ -0,0 +1 @@
|
|
1
|
+
error: There isn't a plugin called sshs
|
@@ -0,0 +1,10 @@
|
|
1
|
+
ssh git@host.com admin:plugin:exec ssh [command]
|
2
|
+
|
3
|
+
Examples:
|
4
|
+
ssh git@host.com admin:plugin:exec ssh help
|
5
|
+
ssh git@host.com admin:plugin:exec ssh install gritano_path
|
6
|
+
ssh git@host.com admin:plugin:exec ssh start
|
7
|
+
ssh git@host.com admin:plugin:exec ssh stop
|
8
|
+
|
9
|
+
--
|
10
|
+
v{{VERSION}}
|
@@ -0,0 +1 @@
|
|
1
|
+
error: access denied
|
@@ -0,0 +1,10 @@
|
|
1
|
+
ssh git@host.com admin:plugin:exec ssh [command]
|
2
|
+
|
3
|
+
Examples:
|
4
|
+
ssh git@host.com admin:plugin:exec ssh help
|
5
|
+
ssh git@host.com admin:plugin:exec ssh install gritano_path
|
6
|
+
ssh git@host.com admin:plugin:exec ssh start
|
7
|
+
ssh git@host.com admin:plugin:exec ssh stop
|
8
|
+
|
9
|
+
--
|
10
|
+
v{{VERSION}}
|
@@ -0,0 +1 @@
|
|
1
|
+
error: access denied
|
@@ -0,0 +1 @@
|
|
1
|
+
error: There isn't a plugin called sshs
|
@@ -0,0 +1 @@
|
|
1
|
+
error: access denied
|
@@ -0,0 +1 @@
|
|
1
|
+
error: There isn't a plugin called sshs
|
@@ -0,0 +1 @@
|
|
1
|
+
error: access denied
|
data/features/data/ssh_help.txt
CHANGED
data/features/local.feature
CHANGED
data/features/remote.feature
CHANGED
@@ -102,6 +102,10 @@ Feature: Remote access
|
|
102
102
|
| admin:repo:user:list tmp/ruby.git |
|
103
103
|
| admin:plugin:list |
|
104
104
|
| admin:plugin:info ssh |
|
105
|
+
| admin:plugin:info sshs |
|
106
|
+
| admin:plugin:exec ssh help |
|
107
|
+
| admin:plugin:exec ssh helps |
|
108
|
+
| admin:plugin:exec sshs help |
|
105
109
|
|
106
110
|
Scenario Outline: Admin user execute command
|
107
111
|
Given I start the remote console with "igorbonadio"
|
@@ -158,3 +162,7 @@ Feature: Remote access
|
|
158
162
|
| admin:repo:user:list tmp/ruby.git |
|
159
163
|
| admin:plugin:list |
|
160
164
|
| admin:plugin:info ssh |
|
165
|
+
| admin:plugin:info sshs |
|
166
|
+
| admin:plugin:exec ssh help |
|
167
|
+
| admin:plugin:exec ssh helps |
|
168
|
+
| admin:plugin:exec sshs help |
|
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.7.
|
8
|
+
s.version = "0.7.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-
|
12
|
+
s.date = "2013-03-07"
|
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"]
|
@@ -41,7 +41,11 @@ Gem::Specification.new do |s|
|
|
41
41
|
"features/data/config_true.yml",
|
42
42
|
"features/data/local_commands/addon_list.txt",
|
43
43
|
"features/data/local_commands/addon_ssh_install.txt",
|
44
|
+
"features/data/local_commands/plugin_exec_ssh_help.txt",
|
45
|
+
"features/data/local_commands/plugin_exec_ssh_helps.txt",
|
46
|
+
"features/data/local_commands/plugin_exec_sshs_help.txt",
|
44
47
|
"features/data/local_commands/plugin_info_ssh.txt",
|
48
|
+
"features/data/local_commands/plugin_info_sshs.txt",
|
45
49
|
"features/data/local_commands/plugin_list.txt",
|
46
50
|
"features/data/local_commands/repo_add_tmp_jeka_git.txt",
|
47
51
|
"features/data/local_commands/repo_add_tmp_p_lang_git.txt",
|
@@ -87,8 +91,16 @@ Gem::Specification.new do |s|
|
|
87
91
|
"features/data/remote_commands/admin_addon_list_jessicaeto.txt",
|
88
92
|
"features/data/remote_commands/admin_help_igorbonadio.txt",
|
89
93
|
"features/data/remote_commands/admin_help_jessicaeto.txt",
|
94
|
+
"features/data/remote_commands/admin_plugin_exec_ssh_help_igorbonadio.txt",
|
95
|
+
"features/data/remote_commands/admin_plugin_exec_ssh_help_jessicaeto.txt",
|
96
|
+
"features/data/remote_commands/admin_plugin_exec_ssh_helps_igorbonadio.txt",
|
97
|
+
"features/data/remote_commands/admin_plugin_exec_ssh_helps_jessicaeto.txt",
|
98
|
+
"features/data/remote_commands/admin_plugin_exec_sshs_help_igorbonadio.txt",
|
99
|
+
"features/data/remote_commands/admin_plugin_exec_sshs_help_jessicaeto.txt",
|
90
100
|
"features/data/remote_commands/admin_plugin_info_ssh_igorbonadio.txt",
|
91
101
|
"features/data/remote_commands/admin_plugin_info_ssh_jessicaeto.txt",
|
102
|
+
"features/data/remote_commands/admin_plugin_info_sshs_igorbonadio.txt",
|
103
|
+
"features/data/remote_commands/admin_plugin_info_sshs_jessicaeto.txt",
|
92
104
|
"features/data/remote_commands/admin_plugin_list_igorbonadio.txt",
|
93
105
|
"features/data/remote_commands/admin_plugin_list_jessicaeto.txt",
|
94
106
|
"features/data/remote_commands/admin_repo_add_tmp_jeka_git_igorbonadio.txt",
|
data/lib/gritano/console.rb
CHANGED
@@ -13,12 +13,14 @@ module Gritano
|
|
13
13
|
Executor.bin_name = "ssh git@host.com admin:"
|
14
14
|
Gritano.bin_name = "ssh git@host.com admin:"
|
15
15
|
Installer.bin_name = "ssh git@host.com admin:"
|
16
|
+
Plugin.bin_name = "ssh git@host.com admin:"
|
16
17
|
else
|
17
18
|
Base.bin_name = "gritano "
|
18
19
|
Remote.bin_name = "gritano "
|
19
20
|
Executor.bin_name = "gritano "
|
20
21
|
Gritano.bin_name = "gritano "
|
21
22
|
Installer.bin_name = "gritano "
|
23
|
+
Plugin.bin_name = "gritano "
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
@@ -21,18 +21,14 @@ module Gritano
|
|
21
21
|
end
|
22
22
|
|
23
23
|
add_command "plugin:list" do |argv|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
t.add_row [plugin, params[:installed].call]
|
30
|
-
end
|
24
|
+
msg = Terminal::Table.new do |t|
|
25
|
+
t << ['plugin', 'installed']
|
26
|
+
t << :separator
|
27
|
+
Plugin.list.each do |plugin, params|
|
28
|
+
t.add_row [plugin, params[:installed].call]
|
31
29
|
end
|
32
|
-
return [true, msg]
|
33
|
-
rescue Exception => e
|
34
|
-
puts e
|
35
30
|
end
|
31
|
+
return [true, msg]
|
36
32
|
end
|
37
33
|
|
38
34
|
add_command "plugin:info", "plugin_name" do |argv|
|
@@ -67,9 +63,13 @@ module Gritano
|
|
67
63
|
add_command "plugin:exec", "plugin_name command" do |argv|
|
68
64
|
name = argv[0]
|
69
65
|
params = argv[1..-1]
|
70
|
-
|
71
|
-
|
72
|
-
|
66
|
+
if Plugin.list[name]
|
67
|
+
begin
|
68
|
+
return [true, Plugin.list[name][:klass].new.exec(params)]
|
69
|
+
rescue Exception => e
|
70
|
+
return [true, Plugin.list[name][:klass].help]
|
71
|
+
end
|
72
|
+
else
|
73
73
|
return [false, "There isn't a plugin called #{name}"]
|
74
74
|
end
|
75
75
|
end
|
data/lib/gritano/plugin.rb
CHANGED
@@ -47,11 +47,7 @@ module Gritano
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def self.inherited(subclass)
|
50
|
-
|
51
|
-
@subclass << subclass
|
52
|
-
else
|
53
|
-
@subclass = {subclass.name => {klass: subclass, installed: lambda { subclass.check_install }}}
|
54
|
-
end
|
50
|
+
@subclass = {subclass.name => {klass: subclass, installed: lambda { subclass.check_install }}}
|
55
51
|
end
|
56
52
|
|
57
53
|
def self.add_command(command, parameters = "", &block)
|
@@ -63,11 +59,19 @@ module Gritano
|
|
63
59
|
@commands || @commands = Hash.new
|
64
60
|
end
|
65
61
|
|
62
|
+
def self.bin_name=(name)
|
63
|
+
@bin_name = name
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.bin_name
|
67
|
+
@bin_name || "gritano "
|
68
|
+
end
|
69
|
+
|
66
70
|
def self.help
|
67
|
-
msg = "
|
71
|
+
msg = " #{Plugin.bin_name}plugin:exec #{self.name} [command]\n\n"
|
68
72
|
msg += " Examples:\n"
|
69
73
|
commands.each do |command, parameters|
|
70
|
-
msg += "
|
74
|
+
msg += " #{Plugin.bin_name}plugin:exec #{self.name} #{command} #{parameters}\n"
|
71
75
|
end
|
72
76
|
msg += "\n --\n v#{File.open(File.join(File.dirname(__FILE__), '..', '..', 'VERSION')).readlines.join}"
|
73
77
|
msg
|
data/spec/plugin_spec.rb
CHANGED
@@ -44,5 +44,21 @@ module Gritano
|
|
44
44
|
Plugin.list['ssh'][:installed].call.should be == false
|
45
45
|
end
|
46
46
|
|
47
|
+
it "should call on_remove when it receives remove" do
|
48
|
+
plugin = Plugin.new
|
49
|
+
plugin.should_receive(:on_remove)
|
50
|
+
plugin.remove
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should call on_add when it receives add" do
|
54
|
+
plugin = Plugin.new
|
55
|
+
plugin.should_receive(:on_add)
|
56
|
+
plugin.add
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should not be installed" do
|
60
|
+
Plugin.check_install.should be_false
|
61
|
+
end
|
62
|
+
|
47
63
|
end
|
48
64
|
end
|
data/spec/plugin_ssh_spec.rb
CHANGED
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.7.
|
4
|
+
version: 0.7.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-
|
12
|
+
date: 2013-03-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -222,7 +222,11 @@ files:
|
|
222
222
|
- features/data/config_true.yml
|
223
223
|
- features/data/local_commands/addon_list.txt
|
224
224
|
- features/data/local_commands/addon_ssh_install.txt
|
225
|
+
- features/data/local_commands/plugin_exec_ssh_help.txt
|
226
|
+
- features/data/local_commands/plugin_exec_ssh_helps.txt
|
227
|
+
- features/data/local_commands/plugin_exec_sshs_help.txt
|
225
228
|
- features/data/local_commands/plugin_info_ssh.txt
|
229
|
+
- features/data/local_commands/plugin_info_sshs.txt
|
226
230
|
- features/data/local_commands/plugin_list.txt
|
227
231
|
- features/data/local_commands/repo_add_tmp_jeka_git.txt
|
228
232
|
- features/data/local_commands/repo_add_tmp_p_lang_git.txt
|
@@ -268,8 +272,16 @@ files:
|
|
268
272
|
- features/data/remote_commands/admin_addon_list_jessicaeto.txt
|
269
273
|
- features/data/remote_commands/admin_help_igorbonadio.txt
|
270
274
|
- features/data/remote_commands/admin_help_jessicaeto.txt
|
275
|
+
- features/data/remote_commands/admin_plugin_exec_ssh_help_igorbonadio.txt
|
276
|
+
- features/data/remote_commands/admin_plugin_exec_ssh_help_jessicaeto.txt
|
277
|
+
- features/data/remote_commands/admin_plugin_exec_ssh_helps_igorbonadio.txt
|
278
|
+
- features/data/remote_commands/admin_plugin_exec_ssh_helps_jessicaeto.txt
|
279
|
+
- features/data/remote_commands/admin_plugin_exec_sshs_help_igorbonadio.txt
|
280
|
+
- features/data/remote_commands/admin_plugin_exec_sshs_help_jessicaeto.txt
|
271
281
|
- features/data/remote_commands/admin_plugin_info_ssh_igorbonadio.txt
|
272
282
|
- features/data/remote_commands/admin_plugin_info_ssh_jessicaeto.txt
|
283
|
+
- features/data/remote_commands/admin_plugin_info_sshs_igorbonadio.txt
|
284
|
+
- features/data/remote_commands/admin_plugin_info_sshs_jessicaeto.txt
|
273
285
|
- features/data/remote_commands/admin_plugin_list_igorbonadio.txt
|
274
286
|
- features/data/remote_commands/admin_plugin_list_jessicaeto.txt
|
275
287
|
- features/data/remote_commands/admin_repo_add_tmp_jeka_git_igorbonadio.txt
|
@@ -425,7 +437,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
425
437
|
version: '0'
|
426
438
|
segments:
|
427
439
|
- 0
|
428
|
-
hash: -
|
440
|
+
hash: -844461799902479330
|
429
441
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
430
442
|
none: false
|
431
443
|
requirements:
|