ghedsh 1.1.27 → 1.1.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +46 -0
- data/lib/actions/help.rb +8 -1
- data/lib/actions/orgs.rb +17 -4
- data/lib/actions/repo.rb +101 -28
- data/lib/actions/teams.rb +9 -0
- data/lib/actions/user.rb +13 -2
- data/lib/interface.rb +9 -3
- 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: 17a76ca53bff0b058e4e19d2be8c227326ef34b1
|
4
|
+
data.tar.gz: 4fb73850d929ea7bd6edd6d9aa27f54c9dcb3802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28a8b03e9a751adb7a91d8847da018f0dcb7be9544c650d92f27ce4297a132a1a892c9cbd3e83c5e4491f5747636aa21125d0fa6a22275d3971ddee5e188c764
|
7
|
+
data.tar.gz: d4b2242379e55bb41d5d32552678aba271d41f7b53ae72483d88aad9edd29432bf7e929329846dbf29640646b31838cb564ceb6a6c578c6043dcda375783a423
|
data/README.md
CHANGED
@@ -153,6 +153,32 @@ people
|
|
153
153
|
```
|
154
154
|
Muestra los miembros de una organizacion si nos encontramos en ese ambito, o los miembros de un equipo.
|
155
155
|
|
156
|
+
```sh
|
157
|
+
people info
|
158
|
+
```
|
159
|
+
Muestra la informacion extendida de los miembros de la organizacion.
|
160
|
+
|
161
|
+
```sh
|
162
|
+
people info <usuario>
|
163
|
+
```
|
164
|
+
Muestra la informacion extendida de un miembro especifico de una organizacion.
|
165
|
+
|
166
|
+
```sh
|
167
|
+
add_people_info <file>
|
168
|
+
```
|
169
|
+
Añade informacion extendida de los miembros de una organizacion mediante un archivo .csv.
|
170
|
+
|
171
|
+
Formato y campos de la informacion añadida:
|
172
|
+
|
173
|
+
> github, id, nombre, apellido, emails, organizaciones, urls
|
174
|
+
|
175
|
+
Ejemplo del contenido del archivo .csv. Cada linea representara los datos de un alumno, poniendo comillas se podra añadir varios valores en los campos de email, organizaciones y las urls.
|
176
|
+
|
177
|
+
> studentbeta,alu1342,Pedro,Garcia Perez,"alu1342@ull.edu.es, pedrogarciaperez@gmail.com","classroom-testing, SYTW1617","http://campusvirtual.ull.es/aluXXX, http://pegarpe.github.io"
|
178
|
+
|
179
|
+
> studentalpha1,alu321,Paco,Gutierrez,"alu321@ull.edu.es, pacogutierrez@gmail.com","classroom-testing, SYTW1617","http://campusvirtual.ull.es/aluXXX, http://st.github.io"
|
180
|
+
|
181
|
+
|
156
182
|
```sh
|
157
183
|
files <path>
|
158
184
|
```
|
@@ -168,11 +194,31 @@ commits
|
|
168
194
|
```
|
169
195
|
Muestra los commits del repositorio en el que se encuentre el usuario.
|
170
196
|
|
197
|
+
```sh
|
198
|
+
private <true/false>
|
199
|
+
```
|
200
|
+
Modifica la privacidad de un repositorio estando situado dentro del mismo.
|
201
|
+
|
202
|
+
```sh
|
203
|
+
info
|
204
|
+
```
|
205
|
+
Dentro del repositorio, muestra informacion del mismo.
|
206
|
+
|
171
207
|
```sh
|
172
208
|
issues
|
173
209
|
```
|
174
210
|
Muestra los issues del repositorio en el que se encuentre el usuario.
|
175
211
|
|
212
|
+
```sh
|
213
|
+
issue <id>
|
214
|
+
```
|
215
|
+
Muestra un issue especifico, y permite ver ademas sus comentarios.
|
216
|
+
|
217
|
+
```sh
|
218
|
+
add_issue_comment <id>
|
219
|
+
```
|
220
|
+
Añade un comentario a un issue especifico.
|
221
|
+
|
176
222
|
```sh
|
177
223
|
new_issue <nombre>
|
178
224
|
```
|
data/lib/actions/help.rb
CHANGED
@@ -11,6 +11,7 @@ class HelpM
|
|
11
11
|
puts " Users options:"
|
12
12
|
print "\n\tCOMMAND\t\t\tDESCRIPTION\n\n"
|
13
13
|
print "\torgs\t\t\tShow your organizations\n"
|
14
|
+
print "\topen\t\t\tOpen the user's url of github in your web browser.\n"
|
14
15
|
print "\trepos\t\t\tList your repositories\n"
|
15
16
|
print "\tclone\t\t\tClone a repository or a list of repositories using a regular expresion\n"
|
16
17
|
print "\tnew_repository\t\tCreate a repository in your personal account\n"
|
@@ -23,6 +24,7 @@ class HelpM
|
|
23
24
|
puts " Organization options:"
|
24
25
|
print "\n\tCOMMAND\t\t\tDESCRIPTION\n\n"
|
25
26
|
print "\trepos\t\t\tList the repositories of your organization\n"
|
27
|
+
print "\topen\t\t\tOpen the organization's url of github in your web browser.\n"
|
26
28
|
print "\tclone\t\t\tClone a repository or a list of repositories using a regular expresion\n"
|
27
29
|
print "\tset\t\t\tMove you to a specific repository\n"
|
28
30
|
print "\tpeople\t\t\tShow the members of an organization\n"
|
@@ -53,6 +55,7 @@ class HelpM
|
|
53
55
|
puts " Repository options:"
|
54
56
|
print "\n\tCOMMAND\t\t\tDESCRIPTION\n\n"
|
55
57
|
print "\tinfo\t\t\tShow information about the repository\n"
|
58
|
+
print "\topen\t\t\tOpen the repository's url of github in your web browser.\n"
|
56
59
|
print "\tcommits\t\t\tShow the list of commits from the repository\n"
|
57
60
|
print "\tnew_issue\t\tCreates a new issue\n"
|
58
61
|
print "\tissues\t\t\tShow the list of issues from the repository\n"
|
@@ -77,9 +80,10 @@ class HelpM
|
|
77
80
|
puts " Organization team options:"
|
78
81
|
print "\n\tCOMMAND\t\t\tDESCRIPTION\n\n"
|
79
82
|
print "\tpeople\t\t\tMembers of the team\n"
|
83
|
+
print "\topen\t\t\tOpen the team's url of github in your web browser.\n"
|
80
84
|
print "\tclone\t\t\tClone a repository or a list of repositories using a regular expresion\n"
|
81
85
|
print "\tnew_repository\t\tCreate a repository to this team\n"
|
82
|
-
print "\tadd_to_team\t\
|
86
|
+
print "\tadd_to_team\t\tAdd a member in the team\n\n"
|
83
87
|
end
|
84
88
|
|
85
89
|
def user_repo()
|
@@ -87,6 +91,7 @@ class HelpM
|
|
87
91
|
puts " Repository options:"
|
88
92
|
print "\n\tCOMMAND\t\t\tDESCRIPTION\n\n"
|
89
93
|
print "\tinfo\t\t\tShow information about the repository\n"
|
94
|
+
print "\topen\t\t\tOpen the repository's url of github in your web browser.\n"
|
90
95
|
print "\tcommits\t\t\tShow the list of commits from the repository\n"
|
91
96
|
print "\tnew_issue\t\tCreates a new issue\n"
|
92
97
|
print "\tissues\t\t\tShow the list of issues from the repository\n"
|
@@ -103,6 +108,7 @@ class HelpM
|
|
103
108
|
print "\t\t\t\t->\tcat [file]\n\n"
|
104
109
|
print "\tprivate\t\t\tChange the privacy of a repository. Expected 'true' or 'false' as parameter.\n"
|
105
110
|
print "\t\t\t\t->\tprivate [true]\n\n"
|
111
|
+
print "\topen\t\t\tOpen the repository's url of github in your web browser.\n"
|
106
112
|
print "\tcol\t\t\tShow the list of collaborators from the repository\n\n"
|
107
113
|
end
|
108
114
|
def team_repo()
|
@@ -110,6 +116,7 @@ class HelpM
|
|
110
116
|
puts " Repository options:"
|
111
117
|
print "\n\tCOMMAND\t\t\tDESCRIPTION\n\n"
|
112
118
|
print "\tinfo\t\t\tShow information about the repository\n"
|
119
|
+
print "\topen\t\t\tOpen the repository's url of github in your web browser.\n"
|
113
120
|
print "\tcommits\t\t\tShow the list of commits from the repository\n"
|
114
121
|
print "\tnew_issue\t\tCreates a new issue\n"
|
115
122
|
print "\tissues\t\t\tShow the list of issues from the repository\n"
|
data/lib/actions/orgs.rb
CHANGED
@@ -133,7 +133,7 @@ class Organizations
|
|
133
133
|
puts "\nAdd groups to your assignment (Press enter to skip): "
|
134
134
|
op=gets.chomp
|
135
135
|
if op==""
|
136
|
-
puts "Do you want to create a new group? (Press any key to proceed, or only enter to skip)"
|
136
|
+
puts "Do you want to create a new group? (Press any key and enter to proceed, or only enter to skip)"
|
137
137
|
an=gets.chomp
|
138
138
|
|
139
139
|
if an!=""
|
@@ -296,8 +296,11 @@ class Organizations
|
|
296
296
|
file=file+".csv"
|
297
297
|
end
|
298
298
|
if File.exist?(file)
|
299
|
-
|
300
|
-
|
299
|
+
begin
|
300
|
+
mem = CSV.read(file,:quote_char => "|")
|
301
|
+
rescue
|
302
|
+
print "Invalid csv format."
|
303
|
+
end
|
301
304
|
users=Hash.new;
|
302
305
|
users=[]
|
303
306
|
mem.each do |i|
|
@@ -329,7 +332,7 @@ class Organizations
|
|
329
332
|
puts " Emails:\t#{here["emails"]} -> #{i["emails"]}"
|
330
333
|
puts " Organizations:\t#{here["orgs"]} -> #{i["orgs"]}"
|
331
334
|
puts " Urls:\t\t#{here["urls"]} -> #{i["urls"]}"
|
332
|
-
puts "\nPress any key to proceed, or only enter to skip: "
|
335
|
+
puts "\nPress any key and enter to proceed, or only enter to skip: "
|
333
336
|
op=gets.chomp
|
334
337
|
if op!=""
|
335
338
|
index1=list["orgs"].index{|aux| aux["name"]==config["Org"]}
|
@@ -436,4 +439,14 @@ class Organizations
|
|
436
439
|
return orgslist
|
437
440
|
end
|
438
441
|
|
442
|
+
def open_org(client,config)
|
443
|
+
mem=client.organization(config["Org"])
|
444
|
+
case
|
445
|
+
when RUBY_PLATFORM.downcase.include?("darwin")
|
446
|
+
system("open #{mem[:html_url]}")
|
447
|
+
when RUBY_PLATFORM.downcase.include?("linux")
|
448
|
+
system("xdg-open #{mem[:html_url]}")
|
449
|
+
end
|
450
|
+
end
|
451
|
+
|
439
452
|
end
|
data/lib/actions/repo.rb
CHANGED
@@ -70,22 +70,71 @@ class Repositories
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
def
|
74
|
-
puts "Insert Issue tittle: "
|
75
|
-
tittle=gets.chomp
|
76
|
-
puts "Add a description: "
|
77
|
-
desc=gets.chomp
|
78
|
-
|
73
|
+
def open_repository(client,config,scope)
|
79
74
|
case
|
80
75
|
when scope==USER_REPO
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
76
|
+
if config["Repo"].split("/").size == 1
|
77
|
+
mem=client.repository(config["User"]+"/"+config["Repo"])
|
78
|
+
else
|
79
|
+
mem=client.repository(config["Repo"])
|
80
|
+
end
|
86
81
|
when scope==ORGS_REPO || scope==TEAM_REPO
|
87
|
-
|
82
|
+
mem=client.repository(config["Org"]+"/"+config["Repo"])
|
83
|
+
end
|
84
|
+
|
85
|
+
case
|
86
|
+
when RUBY_PLATFORM.downcase.include?("darwin")
|
87
|
+
system("open #{mem[:html_url]}")
|
88
|
+
when RUBY_PLATFORM.downcase.include?("linux")
|
89
|
+
system("xdg-open #{mem[:html_url]}")
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
def create_issue(client,config,scope,path)
|
95
|
+
tittle=""
|
96
|
+
while tittle==""
|
97
|
+
puts "\nInsert Issue tittle: "
|
98
|
+
tittle=gets.chomp
|
99
|
+
end
|
100
|
+
puts "Write the description in you editor, press enter when you finish "
|
101
|
+
|
102
|
+
if ENV["EDITOR"]==nil
|
103
|
+
editor="vi"
|
104
|
+
else
|
105
|
+
editor=ENV["EDITOR"]
|
106
|
+
end
|
107
|
+
|
108
|
+
system("#{editor} #{path}/temp.txt &")
|
109
|
+
gets
|
110
|
+
begin
|
111
|
+
desc=File.read("#{path}/temp.txt")
|
112
|
+
rescue
|
113
|
+
puts "Empty description"
|
114
|
+
end
|
115
|
+
puts "This issue is gonna be created"
|
116
|
+
puts "\ntitle: #{tittle}"
|
117
|
+
puts "\n--------------------------------------"
|
118
|
+
puts desc
|
119
|
+
puts "--------------------------------------"
|
120
|
+
puts "\nTo proceed press enter, or to discard press any key and enter"
|
121
|
+
an=gets.chomp
|
122
|
+
if an==""
|
123
|
+
case
|
124
|
+
when scope==USER_REPO
|
125
|
+
if config["Repo"].split("/").size == 1
|
126
|
+
client.create_issue(config["User"]+"/"+config["Repo"],tittle,desc)
|
127
|
+
else
|
128
|
+
client.create_issue(config["Repo"],tittle,desc)
|
129
|
+
end
|
130
|
+
when scope==ORGS_REPO || scope==TEAM_REPO
|
131
|
+
client.create_issue(config["Org"]+"/"+config["Repo"],tittle,desc)
|
132
|
+
end
|
133
|
+
puts "Issue correctly created"
|
134
|
+
else
|
135
|
+
puts "Issue not created"
|
88
136
|
end
|
137
|
+
Sys.new().remove_temp("#{path}/temp.txt")
|
89
138
|
end
|
90
139
|
|
91
140
|
def close_issue(client,config,scope,id)
|
@@ -163,7 +212,7 @@ class Repositories
|
|
163
212
|
puts " --------------------------------------"
|
164
213
|
puts "\n#{i[:body]}"
|
165
214
|
issfound=1
|
166
|
-
print "\nShow comments (Press any key to proceed, or only enter to skip) -> "
|
215
|
+
print "\nShow comments (Press any key and enter to proceed, or only enter to skip) -> "
|
167
216
|
show=gets.chomp
|
168
217
|
puts
|
169
218
|
if show!=""
|
@@ -207,25 +256,49 @@ class Repositories
|
|
207
256
|
end
|
208
257
|
|
209
258
|
#add issue comment
|
210
|
-
def add_issue_cm(client,config,scope,id)
|
211
|
-
puts "
|
212
|
-
|
213
|
-
|
214
|
-
|
259
|
+
def add_issue_cm(client,config,scope,id,path)
|
260
|
+
puts "Write the description in you editor, press enter when you finish "
|
261
|
+
|
262
|
+
if ENV["EDITOR"]==nil
|
263
|
+
editor="vi"
|
264
|
+
else
|
265
|
+
editor=ENV["EDITOR"]
|
266
|
+
end
|
267
|
+
system("#{editor} #{path}/temp.txt")
|
268
|
+
gets
|
215
269
|
begin
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
270
|
+
desc=File.read("#{path}/temp.txt")
|
271
|
+
rescue
|
272
|
+
puts "Empty description"
|
273
|
+
end
|
274
|
+
|
275
|
+
puts "This comment is gonna be created"
|
276
|
+
puts "\n--------------------------------------"
|
277
|
+
puts desc
|
278
|
+
puts "--------------------------------------"
|
279
|
+
puts "\nTo proceed press enter, or to discard press any key and enter"
|
280
|
+
an=gets.chomp
|
281
|
+
|
282
|
+
if an==""
|
283
|
+
begin
|
284
|
+
case
|
285
|
+
when scope==USER_REPO
|
286
|
+
if config["Repo"].split("/").size == 1
|
287
|
+
client.add_comment(config["User"]+"/"+config["Repo"],id,desc)
|
288
|
+
else
|
289
|
+
client.add_comment(config["Repo"],id,desc)
|
290
|
+
end
|
291
|
+
when scope==ORGS_REPO || scope==TEAM_REPO
|
292
|
+
client.add_comment(config["Org"]+"/"+config["Repo"],id,desc)
|
222
293
|
end
|
223
|
-
|
224
|
-
|
294
|
+
puts "Comment created"
|
295
|
+
rescue
|
296
|
+
puts "Issue not found"
|
225
297
|
end
|
226
|
-
|
227
|
-
puts "
|
298
|
+
else
|
299
|
+
puts "comment not created"
|
228
300
|
end
|
301
|
+
Sys.new().remove_temp("#{path}/temp.txt")
|
229
302
|
end
|
230
303
|
|
231
304
|
#Show repositories and return a list of them
|
data/lib/actions/teams.rb
CHANGED
@@ -189,6 +189,15 @@ class Teams
|
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
|
+
def open_team_repos(config)
|
193
|
+
case
|
194
|
+
when RUBY_PLATFORM.downcase.include?("darwin")
|
195
|
+
system("open https://github.com/orgs/#{config["Org"]}/teams/#{config["Team"]}")
|
196
|
+
when RUBY_PLATFORM.downcase.include?("linux")
|
197
|
+
system("xdg-open https://github.com/orgs/#{config["Org"]}/teams/#{config["Team"]}")
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
192
201
|
def change_group_repos_privacity()
|
193
202
|
end
|
194
203
|
|
data/lib/actions/user.rb
CHANGED
@@ -5,9 +5,20 @@ require 'require_all'
|
|
5
5
|
require_rel '.'
|
6
6
|
|
7
7
|
class User
|
8
|
-
def
|
8
|
+
def info(client)
|
9
|
+
mem=client.user(client.login)
|
10
|
+
puts m[:login]
|
11
|
+
puts m[:name]
|
12
|
+
puts m[:email]
|
9
13
|
end
|
10
14
|
|
11
|
-
def
|
15
|
+
def open_user(client)
|
16
|
+
mem=client.user(client.login)
|
17
|
+
case
|
18
|
+
when RUBY_PLATFORM.downcase.include?("darwin")
|
19
|
+
system("open #{mem[:html_url]}")
|
20
|
+
when RUBY_PLATFORM.downcase.include?("linux")
|
21
|
+
system("xdg-open #{mem[:html_url]}")
|
22
|
+
end
|
12
23
|
end
|
13
24
|
end
|
data/lib/interface.rb
CHANGED
@@ -191,7 +191,7 @@ class Interface
|
|
191
191
|
@teamlist=Teams.new.read_teamlist(@client,@config)
|
192
192
|
end
|
193
193
|
aux=@teamlist
|
194
|
-
|
194
|
+
|
195
195
|
if aux[path]!=nil
|
196
196
|
@config["Team"]=path
|
197
197
|
@config["TeamID"]=@teamlist[path]
|
@@ -440,6 +440,7 @@ class Interface
|
|
440
440
|
t=Teams.new
|
441
441
|
r=Repositories.new
|
442
442
|
s=Sys.new
|
443
|
+
u=User.new
|
443
444
|
# orden de búsqueda: ~/.ghedsh.json ./ghedsh.json ENV["ghedsh"] --configpath path/to/file.json
|
444
445
|
|
445
446
|
#control de carga de parametros en el logueo de la aplicacion
|
@@ -513,6 +514,11 @@ class Interface
|
|
513
514
|
if @deep==ASSIG
|
514
515
|
o.make_assig(@client,@config,@assig_path)
|
515
516
|
end
|
517
|
+
when op =="open"
|
518
|
+
if @deep==USER_REPO || @deep==TEAM_REPO || @deep==ORGS_REPO then r.open_repository(@client,@config,@deep) end
|
519
|
+
if @deep==USER then u.open_user(@client) end
|
520
|
+
if @deep==ORGS then o.open_org(@client,@config) end
|
521
|
+
if @deep==TEAM then t.open_team_repos(@config) end
|
516
522
|
end
|
517
523
|
|
518
524
|
if opcd[0]=="issue" and opcd.size>1
|
@@ -580,12 +586,12 @@ class Interface
|
|
580
586
|
end
|
581
587
|
if opcd[0]=="new_issue" and opcd.size==1
|
582
588
|
if @deep==ORGS_REPO || @deep==USER_REPO || @deep==TEAM_REPO
|
583
|
-
r.create_issue(@client,@config,@deep)
|
589
|
+
r.create_issue(@client,@config,@deep,config_path)
|
584
590
|
end
|
585
591
|
end
|
586
592
|
if opcd[0]=="add_issue_comment" and opcd.size==2
|
587
593
|
if @deep==ORGS_REPO || @deep==USER_REPO || @deep==TEAM_REPO
|
588
|
-
r.add_issue_cm(@client,@config,@deep,opcd[1])
|
594
|
+
r.add_issue_cm(@client,@config,@deep,opcd[1],config_path)
|
589
595
|
end
|
590
596
|
end
|
591
597
|
if opcd[0]=="close_issue" and opcd.size==2
|
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.28
|
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: 2017-
|
12
|
+
date: 2017-03-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: octokit
|