gritano 0.10.1 → 0.10.2

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/TODO CHANGED
@@ -1,11 +1,6 @@
1
- v0.10.1:
2
- bug: nao da pra mudar senha via SSH
3
-
4
- v0.11.0:
5
- ☐ permitir/barrar acesso remoto ao terminal do administrador
6
-
7
- v0.12.0:
8
- ☐ novos tipos de permissão
1
+ v0.10.3:
2
+ configurar o nome do servidor ssh
3
+ ☐ permitir usuario ver o repo:info
9
4
 
10
5
  futuro:
11
6
  ☐ divulgar
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.1
1
+ 0.10.2
@@ -2,4 +2,5 @@
2
2
  | plugin | installed |
3
3
  +--------+-----------+
4
4
  | ssh | false |
5
+ | http | false |
5
6
  +--------+-----------+
@@ -31,6 +31,7 @@
31
31
  gritano repo:write:add reponame.git username
32
32
  gritano repo:read:rm reponame.git username
33
33
  gritano repo:write:rm reponame.git username
34
+ gritano repo:info reponame.git
34
35
 
35
36
  --
36
37
  v{{VERSION}}
@@ -31,6 +31,7 @@
31
31
  ssh git@host.com admin:repo:write:add reponame.git username
32
32
  ssh git@host.com admin:repo:read:rm reponame.git username
33
33
  ssh git@host.com admin:repo:write:rm reponame.git username
34
+ ssh git@host.com admin:repo:info reponame.git
34
35
 
35
36
  --
36
37
  v{{VERSION}}
@@ -31,6 +31,7 @@
31
31
  ssh git@host.com admin:repo:write:add reponame.git username
32
32
  ssh git@host.com admin:repo:read:rm reponame.git username
33
33
  ssh git@host.com admin:repo:write:rm reponame.git username
34
+ ssh git@host.com admin:repo:info reponame.git
34
35
 
35
36
  --
36
37
  v{{VERSION}}
@@ -2,4 +2,5 @@
2
2
  | plugin | installed |
3
3
  +--------+-----------+
4
4
  | ssh | false |
5
+ | http | false |
5
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.10.1"
8
+ s.version = "0.10.2"
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-05-03"
12
+ s.date = "2013-05-06"
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"]
@@ -250,6 +250,7 @@ Gem::Specification.new do |s|
250
250
  "lib/gritano/models/repository.rb",
251
251
  "lib/gritano/models/user.rb",
252
252
  "lib/gritano/plugin.rb",
253
+ "lib/gritano/plugin/http.rb",
253
254
  "lib/gritano/plugin/ssh.rb",
254
255
  "spec/cli_spec.rb",
255
256
  "spec/config_spec.rb",
@@ -319,6 +319,22 @@ module Gritano
319
319
  end
320
320
  return [false, "An error occurred. Permissions was not modified."]
321
321
  end
322
+
323
+ add_command "repo:info", "reponame.git" do |argv|
324
+ repo_name, = argv
325
+ repo = Repository.find_by_name(repo_name)
326
+ if repo
327
+ msg = Terminal::Table.new do |t|
328
+ t << ['ssh', "git@server.com:#{repo_name}"]
329
+ if ::Gritano::Http.check_install
330
+ t << :separator
331
+ t << ['http', "#{Http.servername}/#{repo_name}"]
332
+ end
333
+ end
334
+ return [true, msg]
335
+ end
336
+ return [false, "Repository #{repo_name} doesn't exist."]
337
+ end
322
338
 
323
339
  end
324
340
  end
@@ -47,7 +47,8 @@ module Gritano
47
47
  end
48
48
 
49
49
  def self.inherited(subclass)
50
- @subclass = {subclass.name => {klass: subclass, installed: lambda { subclass.check_install }}}
50
+ @subclass ||= Hash.new
51
+ @subclass[subclass.name] = {klass: subclass, installed: lambda { subclass.check_install }}
51
52
  end
52
53
 
53
54
  def self.add_command(command, parameters = "", &block)
@@ -80,4 +81,5 @@ module Gritano
80
81
  end
81
82
  end
82
83
 
83
- require File.join(ROOT_PATH, 'gritano/plugin/ssh')
84
+ require File.join(ROOT_PATH, 'gritano/plugin/ssh')
85
+ require File.join(ROOT_PATH, 'gritano/plugin/http')
@@ -0,0 +1,72 @@
1
+ module Gritano
2
+ class Http < Plugin
3
+
4
+ def self.info
5
+ "TODO"
6
+ end
7
+
8
+ def on_add
9
+ config = Config.new(File.join(@home_dir, '.gritano', 'config.yml'))
10
+ config.http = true
11
+ config.save
12
+ end
13
+
14
+ def on_remove
15
+ config = Config.new(File.join(@home_dir, '.gritano', 'config.yml'))
16
+ config.http = false
17
+ config.save
18
+ end
19
+
20
+ def self.check_install
21
+ home = Etc.getpwuid.dir
22
+ if File.exist?(File.join(home, '.gritano', 'config.yml'))
23
+ config = Config.new(File.join(home, '.gritano', 'config.yml'))
24
+ if config.http
25
+ return config.http
26
+ else
27
+ return false
28
+ end
29
+ else
30
+ return false
31
+ end
32
+ end
33
+
34
+ def self.servername
35
+ home = Etc.getpwuid.dir
36
+ config = Config.new(File.join(home, '.gritano', 'config.yml'))
37
+ if config.http_servername
38
+ return config.http_servername
39
+ else
40
+ return "http://git.server.com"
41
+ end
42
+ end
43
+
44
+ add_command "help" do |params|
45
+ Http.help
46
+ end
47
+
48
+ add_command "install", "install_dir" do |params|
49
+ install_dir, = params
50
+ puts "[git] Cloning"
51
+ if system "git clone git://github.com/igorbonadio/gritano-grack.git #{install_dir}"
52
+ puts "Please, edit the gritano-grack/config.yml file to finish your installation."
53
+ return "Done"
54
+ end
55
+ return "error"
56
+ end
57
+
58
+ add_command "servername:get" do |params|
59
+ return Http.servername
60
+ end
61
+
62
+ add_command "servername:set", "servername" do |params|
63
+ servername, = params
64
+ home = Etc.getpwuid.dir
65
+ config = Config.new(File.join(home, '.gritano', 'config.yml'))
66
+ config.http_servername = servername
67
+ config.save
68
+ return "done!"
69
+ end
70
+
71
+ end
72
+ end
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.10.1
4
+ version: 0.10.2
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-05-03 00:00:00.000000000 Z
12
+ date: 2013-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -463,6 +463,7 @@ files:
463
463
  - lib/gritano/models/repository.rb
464
464
  - lib/gritano/models/user.rb
465
465
  - lib/gritano/plugin.rb
466
+ - lib/gritano/plugin/http.rb
466
467
  - lib/gritano/plugin/ssh.rb
467
468
  - spec/cli_spec.rb
468
469
  - spec/config_spec.rb
@@ -496,7 +497,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
496
497
  version: '0'
497
498
  segments:
498
499
  - 0
499
- hash: -3210328951127054192
500
+ hash: 2308429539270069393
500
501
  required_rubygems_version: !ruby/object:Gem::Requirement
501
502
  none: false
502
503
  requirements: