ghedsh 1.1.13 → 1.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +40 -2
- data/lib/actions/help.rb +7 -0
- data/lib/actions/repo.rb +110 -33
- data/lib/actions/teams.rb +36 -2
- data/lib/interface.rb +26 -4
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05402a8afa9f6cd7623cd28bbb5d6f24e98ea6ea
|
4
|
+
data.tar.gz: dfdb11838a373aa30ef2ddb8549ca51f120ace60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf0e49b3e9a884807583d1f845837c71208024404dc691eb468afe3de8563c89c812a158422943cb4f1a74c7c85d00e0f1d374a7edabff2b4fd3a2c48f04dd57
|
7
|
+
data.tar.gz: 5a95195898a3b08b9b9e365b47343559145f9a4f8cdb267c330753428c0dd9cc76c3c8687d2d30f4a89bd4ee01a34f8e1a797b5c8619dc45b66db412e7b4e730
|
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
![](http://i125.photobucket.com/albums/p79/NooK1e_RG/ghedsh2_zpsdsdlzg1t.png)
|
1
2
|
#GITHUB EDUCATION SHELL
|
2
3
|
|
3
4
|
A command line program following the philosophy of GitHub Education.
|
@@ -12,6 +13,11 @@ Following the philosophy of Github Education, you can use this application to ma
|
|
12
13
|
|
13
14
|
Ir order to run this program, you need to make an **Access token** from Github with create and edit scope. When you run the program, it asks you the access token to identify yourself with no need to use your user and password.
|
14
15
|
|
16
|
+
[Link to create a new personal access token](https://github.com/settings/tokens/new?description=ghedsh)
|
17
|
+
|
18
|
+
You need to tick all options, unless admin:gpg_key scopes.
|
19
|
+
|
20
|
+
|
15
21
|
##Running the program in your computer
|
16
22
|
|
17
23
|
To start using the program, put "rake bash" or "rake" in your command line in the main folder of this program. You can invoke the binary file using the command *ghedsh*.
|
@@ -21,7 +27,20 @@ Instead of download the program from the repository, you can download the gem **
|
|
21
27
|
|
22
28
|
``gem install ghdesh``
|
23
29
|
|
24
|
-
To run the app you need to call the binary file "
|
30
|
+
To run the app you need to call the binary file "ghedsh" in your command line after install it.
|
31
|
+
|
32
|
+
###ghedsh executable options
|
33
|
+
|
34
|
+
'-t' or '--token token'. Provides a github access token by argument.
|
35
|
+
|
36
|
+
'-u', '--user user'. Change your user from your users list
|
37
|
+
|
38
|
+
'-v', '--version'. Show the current version of GHEDSH
|
39
|
+
|
40
|
+
'-h', '--help'. Displays Help
|
41
|
+
|
42
|
+
This program creates a directory called *.ghedsh* in your home with all configuration files that it needs.
|
43
|
+
|
25
44
|
|
26
45
|
##Basic usage
|
27
46
|
Logged in our app you start set in your personal profile. There you can list your repositories, create repositories, see your organizations and other options that you can see using the command *help* in your command line. You can go inside of a specific organization with the command *cd* and start to managing itself. Its possible to create task for the members your organization, create teamworks and many options that you can see again with *help*. You can move and go back in the tree directory as it is possible in the github structure.
|
@@ -81,6 +100,22 @@ teams
|
|
81
100
|
```
|
82
101
|
Muestra todos los equipos de una organizacion.
|
83
102
|
|
103
|
+
```sh
|
104
|
+
new_team <nombre> <miembro1> <miembro2> ...
|
105
|
+
```
|
106
|
+
Crea un equipo a al que le sera asignado uno o varios miembros de la organizacion.
|
107
|
+
|
108
|
+
```sh
|
109
|
+
add_to_team <miembro1> <miembro2> ...
|
110
|
+
```
|
111
|
+
|
112
|
+
Dentro de un equipo en una organizacion, añadira nuevos miembros al equipo de trabajo.
|
113
|
+
|
114
|
+
```sh
|
115
|
+
new_group <nombre> <equipo1> <equipo2> ...
|
116
|
+
```
|
117
|
+
Dentro de una organizacion, crea grupos donde asignar equipos de trabajo.
|
118
|
+
|
84
119
|
```sh
|
85
120
|
groups
|
86
121
|
```
|
@@ -111,7 +146,10 @@ commits
|
|
111
146
|
```
|
112
147
|
Muestra los commits del repositorio en el que se encuentre el usuario.
|
113
148
|
|
114
|
-
|
149
|
+
```sh
|
150
|
+
issues
|
151
|
+
```
|
152
|
+
Muestra los issues del repositorio en el que se encuentre el usuario.
|
115
153
|
|
116
154
|
|
117
155
|
|
data/lib/actions/help.rb
CHANGED
@@ -51,6 +51,13 @@ class HelpM
|
|
51
51
|
print "\tcat\t\t\tshow data from a file\n"
|
52
52
|
print "\tcol\t\t\tshow the list of collaborators from the repository\n\n"
|
53
53
|
end
|
54
|
+
def team_repo()
|
55
|
+
self.common_opt
|
56
|
+
print "\tcommits\t\t\tshow the list of commits from the repository\n"
|
57
|
+
print "\tfiles\t\t\tshow the files of the repository path given\n"
|
58
|
+
print "\tcat\t\t\tshow data from a file\n"
|
59
|
+
print "\tcol\t\t\tshow the list of collaborators from the repository\n\n"
|
60
|
+
end
|
54
61
|
|
55
62
|
def common_opt()
|
56
63
|
puts "\nList of commands\n"
|
data/lib/actions/repo.rb
CHANGED
@@ -33,6 +33,25 @@ class Repositories
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
def show_issues(client,config,scope)
|
37
|
+
print "\n"
|
38
|
+
case
|
39
|
+
when scope==USER_REPO
|
40
|
+
if config["Repo"].split("/").size == 1
|
41
|
+
mem=client.list_issues(config["User"]+"/"+config["Repo"],{:state=>"all"})
|
42
|
+
else
|
43
|
+
mem=client.list_issues(config["Repo"],{:state=>"all"})
|
44
|
+
end
|
45
|
+
when scope==ORGS_REPO || scope==TEAM_REPO
|
46
|
+
mem=client.list_issues(config["Org"]+"/"+config["Repo"],{:state=>"all"})
|
47
|
+
end
|
48
|
+
mem.each do |i|
|
49
|
+
#print i[:sha],"\n",i[:commit][:author][:name],"\n",i[:commit][:author][:date],"\n",i[:commit][:message],"\n\n"
|
50
|
+
puts "##{i[:number]} state: #{i[:state]} -> #{i[:title]} "
|
51
|
+
end
|
52
|
+
puts "\n"
|
53
|
+
end
|
54
|
+
|
36
55
|
#Show repositories and return a list of them
|
37
56
|
#exp = regular expression
|
38
57
|
def show_repos(client,config,scope,exp)
|
@@ -126,7 +145,6 @@ class Repositories
|
|
126
145
|
end
|
127
146
|
end
|
128
147
|
|
129
|
-
|
130
148
|
def show_forks(client,config,scope)
|
131
149
|
print "\n"
|
132
150
|
forklist=[]
|
@@ -211,7 +229,11 @@ class Repositories
|
|
211
229
|
if scope!=USER
|
212
230
|
reposlist.push(i.name)
|
213
231
|
else
|
214
|
-
|
232
|
+
if i[:owner][:login]==config["User"]
|
233
|
+
reposlist.push(i.name)
|
234
|
+
else
|
235
|
+
reposlist.push(i.full_name)
|
236
|
+
end
|
215
237
|
end
|
216
238
|
end
|
217
239
|
return reposlist
|
@@ -223,37 +245,58 @@ class Repositories
|
|
223
245
|
web="https://github.com/"
|
224
246
|
web2="git@github.com:"
|
225
247
|
|
226
|
-
if
|
227
|
-
|
228
|
-
|
229
|
-
|
248
|
+
if scope==USER_REPO || scope==TEAM_REPO || scope==ORGS_REPO
|
249
|
+
case
|
250
|
+
when scope==USER_REPO
|
251
|
+
if config["Repo"].split("/").size == 1
|
252
|
+
command = "git clone #{web2}#{config["User"]}/#{config["Repo"]}.git"
|
253
|
+
else
|
254
|
+
command = "git clone #{web2}#{config["Repo"]}.git"
|
255
|
+
end
|
256
|
+
when scope==TEAM_REPO
|
257
|
+
command = "git clone #{web2}#{config["Org"]}/#{config["Repo"]}.git"
|
258
|
+
when scope==ORGS_REPO
|
259
|
+
command = "git clone #{web2}#{config["Org"]}/#{config["Repo"]}.git"
|
260
|
+
end
|
261
|
+
system(command)
|
230
262
|
else
|
231
|
-
|
232
|
-
|
233
|
-
|
263
|
+
if exp.match(/^\//)
|
264
|
+
exps=exp.split('/')
|
265
|
+
list=self.get_repos_list(client,config,scope)
|
266
|
+
list=Sys.new.search_rexp(list,exps[1])
|
267
|
+
else
|
268
|
+
list=[]
|
269
|
+
list.push(exp)
|
270
|
+
end
|
234
271
|
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
272
|
+
if (list.empty?) == false
|
273
|
+
case
|
274
|
+
when scope==USER
|
275
|
+
list.each do |i|
|
276
|
+
command = "git clone #{web2}#{config["User"]}/#{i}.git"
|
277
|
+
system(command)
|
278
|
+
end
|
279
|
+
when scope==ORGS
|
280
|
+
list.each do |i|
|
281
|
+
command = "git clone #{web2}#{config["Org"]}/#{i}.git"
|
282
|
+
system(command)
|
283
|
+
end
|
246
284
|
end
|
285
|
+
else
|
286
|
+
puts "No repositories found it with the parameters given"
|
247
287
|
end
|
248
|
-
else
|
249
|
-
puts "No repositories found it with the parameters given"
|
250
288
|
end
|
251
289
|
end
|
252
290
|
|
253
291
|
def show_files(list)
|
254
292
|
print "\n"
|
293
|
+
|
255
294
|
list.each do |i|
|
256
|
-
|
295
|
+
if i.name.match(/.\./)!=nil
|
296
|
+
puts i.name
|
297
|
+
else
|
298
|
+
puts "\e[33m#{i.name}\e[0m"
|
299
|
+
end
|
257
300
|
end
|
258
301
|
print "\n"
|
259
302
|
end
|
@@ -263,22 +306,36 @@ class Repositories
|
|
263
306
|
case
|
264
307
|
when scope==USER_REPO
|
265
308
|
if config["Repo"].split("/").size > 1
|
266
|
-
|
309
|
+
begin
|
310
|
+
data=Base64.decode64(client.content(config["Repo"],:path=>path).content)
|
311
|
+
rescue Exception, Interrupt
|
312
|
+
puts "File not found"
|
313
|
+
end
|
267
314
|
else
|
268
|
-
|
315
|
+
begin
|
316
|
+
data=Base64.decode64(client.content(config["User"]+"/"+config["Repo"],:path=>path).content)
|
317
|
+
rescue Exception, Interrupt
|
318
|
+
puts "File not found"
|
319
|
+
end
|
269
320
|
end
|
270
321
|
|
271
322
|
when scope==ORGS_REPO
|
272
|
-
|
323
|
+
begin
|
324
|
+
data=Base64.decode64(client.content(config["Org"]+"/"+config["Repo"],:path=>path).content)
|
325
|
+
rescue Exception, Interrupt
|
326
|
+
puts "File not found"
|
327
|
+
end
|
273
328
|
when scope==TEAM_REPO
|
274
|
-
|
329
|
+
begin
|
330
|
+
data=Base64.decode64(client.content(config["Org"]+"/"+config["Repo"],:path=>path).content)
|
331
|
+
rescue Exception, Interrupt
|
332
|
+
puts "File not found"
|
333
|
+
end
|
275
334
|
end
|
276
|
-
|
277
335
|
# s=Sys.new()
|
278
336
|
# s.createTempFile(data)
|
279
337
|
# s.execute_bash("vi -R #{data}")
|
280
338
|
puts data
|
281
|
-
|
282
339
|
else
|
283
340
|
puts "#{path} is not a file."
|
284
341
|
end
|
@@ -291,15 +348,35 @@ class Repositories
|
|
291
348
|
case
|
292
349
|
when scope==USER_REPO
|
293
350
|
if config["Repo"].split("/").size > 1
|
294
|
-
|
351
|
+
begin
|
352
|
+
list=client.content(config["Repo"],:path=>path)
|
353
|
+
rescue Exception, Interrupt => e
|
354
|
+
puts "No files found"
|
355
|
+
show=false
|
356
|
+
end
|
295
357
|
else
|
296
|
-
|
358
|
+
begin
|
359
|
+
list=client.content(config["User"]+"/"+config["Repo"],:path=>path)
|
360
|
+
rescue Exception, Interrupt => e
|
361
|
+
puts "No files found"
|
362
|
+
show=false
|
363
|
+
end
|
297
364
|
end
|
298
365
|
|
299
366
|
when scope==ORGS_REPO
|
300
|
-
|
367
|
+
begin
|
368
|
+
list=client.content(config["Org"]+"/"+config["Repo"],:path=>path)
|
369
|
+
rescue Exception, Interrupt => e
|
370
|
+
puts "No files found"
|
371
|
+
show=false
|
372
|
+
end
|
301
373
|
when scope==TEAM_REPO
|
302
|
-
|
374
|
+
begin
|
375
|
+
list=client.content(config["Org"]+"/"+config["Repo"],:path=>path)
|
376
|
+
rescue Exception, Interrupt => e
|
377
|
+
puts "No files found"
|
378
|
+
show=false
|
379
|
+
end
|
303
380
|
end
|
304
381
|
if show!=false
|
305
382
|
self.show_files(list)
|
data/lib/actions/teams.rb
CHANGED
@@ -7,6 +7,10 @@ require_rel '.'
|
|
7
7
|
class Teams
|
8
8
|
attr_accessor :teamlist
|
9
9
|
|
10
|
+
def initialize
|
11
|
+
@teamlist=Hash.new
|
12
|
+
end
|
13
|
+
|
10
14
|
def add_to_team(client,config,path)
|
11
15
|
client.add_team_member(config["TeamID"],path)
|
12
16
|
end
|
@@ -77,7 +81,11 @@ class Teams
|
|
77
81
|
puts "No groups are available yet"
|
78
82
|
else
|
79
83
|
groups["groups"].each do |i|
|
80
|
-
puts
|
84
|
+
puts "\n"
|
85
|
+
puts i["name_group"]
|
86
|
+
i["teams"].each do |j|
|
87
|
+
puts "\t#{j}"
|
88
|
+
end
|
81
89
|
end
|
82
90
|
end
|
83
91
|
else
|
@@ -87,9 +95,35 @@ class Teams
|
|
87
95
|
end
|
88
96
|
end
|
89
97
|
|
90
|
-
def new_group(client,config,name,
|
98
|
+
def new_group(client,config,name,listgroups)
|
99
|
+
sys=Sys.new()
|
100
|
+
list=sys.load_groups("#{ENV['HOME']}/.ghedsh")
|
101
|
+
groups=list["orgs"].detect{|aux| aux["name"]==config["Org"]}
|
91
102
|
|
103
|
+
if groups==nil
|
104
|
+
list["orgs"].push({"name"=>config["Org"],"groups"=>[]})
|
105
|
+
sys.save_groups("#{ENV['HOME']}/.ghedsh",list)
|
106
|
+
end
|
92
107
|
|
108
|
+
if @teamlist.empty?
|
109
|
+
self.read_teamlist(client,config)
|
110
|
+
end
|
111
|
+
|
112
|
+
listgroups.each do |item|
|
113
|
+
if @teamlist["#{item}"]==nil
|
114
|
+
listgroups.delete(item)
|
115
|
+
puts "#{item} is not a team available."
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
if listgroups.empty? == false
|
120
|
+
begin
|
121
|
+
list["orgs"][list["orgs"].index{|aux| aux["name"]==config["Org"]}]["groups"].push({"name_group"=>name,"teams"=>listgroups})
|
122
|
+
rescue Exception => e
|
123
|
+
puts e
|
124
|
+
end
|
125
|
+
sys.save_groups("#{ENV['HOME']}/.ghedsh",list)
|
126
|
+
end
|
93
127
|
end
|
94
128
|
|
95
129
|
end
|
data/lib/interface.rb
CHANGED
@@ -45,7 +45,7 @@ class Interface
|
|
45
45
|
raise
|
46
46
|
rescue Exception => e
|
47
47
|
puts "exit"
|
48
|
-
puts e
|
48
|
+
#puts e
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -74,6 +74,8 @@ class Interface
|
|
74
74
|
h.user_repo()
|
75
75
|
when @deep == TEAM
|
76
76
|
h.orgs_teams()
|
77
|
+
when @deep == TEAM_REPO
|
78
|
+
h.team_repo()
|
77
79
|
end
|
78
80
|
end
|
79
81
|
|
@@ -96,6 +98,9 @@ class Interface
|
|
96
98
|
@config["TeamID"]=nil
|
97
99
|
@teams_repos=[]
|
98
100
|
@deep=2
|
101
|
+
when @deep == TEAM_REPO
|
102
|
+
@config["Repo"]=nil
|
103
|
+
@deep=TEAM
|
99
104
|
end
|
100
105
|
else
|
101
106
|
@config["Org"]=nil
|
@@ -226,6 +231,8 @@ class Interface
|
|
226
231
|
case
|
227
232
|
when @deep==USER
|
228
233
|
@sysbh.add_history_str(2,Organizations.new.show_orgs(@client,@config))
|
234
|
+
when @deep==ORGS
|
235
|
+
Organizations.new.show_orgs(@client,@config)
|
229
236
|
end
|
230
237
|
end
|
231
238
|
|
@@ -299,7 +306,7 @@ class Interface
|
|
299
306
|
|
300
307
|
def commits()
|
301
308
|
c=Repositories.new
|
302
|
-
if @deep==ORGS_REPO || @deep==USER_REPO
|
309
|
+
if @deep==ORGS_REPO || @deep==USER_REPO || @deep==TEAM_REPO
|
303
310
|
c.show_commits(@client,@config,@deep)
|
304
311
|
end
|
305
312
|
print "\n"
|
@@ -364,6 +371,10 @@ class Interface
|
|
364
371
|
t.show_teams_bs(@client,@config)
|
365
372
|
end
|
366
373
|
when op == "commits" then self.commits()
|
374
|
+
when op == "issues"
|
375
|
+
if @deep==ORGS_REPO || @deep==USER_REPO || @deep==TEAM_REPO
|
376
|
+
r.show_issues(@client,@config,@deep)
|
377
|
+
end
|
367
378
|
when op == "col" then self.collaborators()
|
368
379
|
when op == "forks" then self.show_forks()
|
369
380
|
when op == "groups"
|
@@ -446,8 +457,19 @@ class Interface
|
|
446
457
|
r.create_repository_by_teamlist(@client,@config,opcd[1],opcd[2,opcd.size],self.get_teamlist(opcd[2,opcd.size]))
|
447
458
|
end
|
448
459
|
end
|
449
|
-
if opcd[0]=="
|
450
|
-
|
460
|
+
if opcd[0]=="new_group" and opcd.size>2
|
461
|
+
if @deep==ORGS
|
462
|
+
t.new_group(@client,@config,opcd[1],opcd[2..opcd.size-1])
|
463
|
+
end
|
464
|
+
end
|
465
|
+
|
466
|
+
if opcd[0]=="clone"
|
467
|
+
if opcd.size==2
|
468
|
+
r.clone_repo(@client,@config,opcd[1],@deep)
|
469
|
+
end
|
470
|
+
if opcd.size==1 && (@deep==USER_REPO || @deep==TEAM_REPO || @deep==ORGS_REPO)
|
471
|
+
r.clone_repo(@client,@config,nil,@deep)
|
472
|
+
end
|
451
473
|
end
|
452
474
|
if op.match(/^!/)
|
453
475
|
op=op.split("!")
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ghedsh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Clemente
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-05-
|
12
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: octokit
|