ghedsh 1.1.32 → 1.1.33
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.
- checksums.yaml +4 -4
- data/lib/actions/orgs.rb +56 -16
- data/lib/actions/system.rb +33 -0
- data/lib/actions/teams.rb +16 -3
- data/lib/interface.rb +8 -6
- 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: 9dca8d52441f8e5577b607f806391d21014b8520
|
4
|
+
data.tar.gz: 812a9a01446c4180aecd626a6c4162432fb873d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f970a8ecb8535662f24dac78a2f1039038f208f51f069c6f9fea090fd922598198fb2d7050cbf5dec5845a7e230f2afc53659524107b670a129ca6048a07581
|
7
|
+
data.tar.gz: dc6172feedf7d0336cdeac6eec0c33c2a5ab0c2f9d5fc47820f8dc08269206acef96c64a93d79661c23e80497fd2ef2d80ae6692ca9cae756ba52659d00c875f
|
data/lib/actions/orgs.rb
CHANGED
@@ -123,6 +123,7 @@ class Organizations
|
|
123
123
|
|
124
124
|
def assignment_groups(client,config)
|
125
125
|
team=Teams.new()
|
126
|
+
sys=Sys.new()
|
126
127
|
groupslist=team.get_groupslist(config)
|
127
128
|
groupsadd=[]
|
128
129
|
teamlist=team.read_teamlist(client,config)
|
@@ -132,7 +133,7 @@ class Organizations
|
|
132
133
|
groupslist.each do |aux|
|
133
134
|
puts "\t#{aux}"
|
134
135
|
end
|
135
|
-
|
136
|
+
|
136
137
|
puts "\nAdd groups to your assignment (Press enter to skip): "
|
137
138
|
op=gets.chomp
|
138
139
|
if op==""
|
@@ -151,11 +152,44 @@ class Organizations
|
|
151
152
|
teamlist.each do |aux|
|
152
153
|
puts "\t#{aux[0]}"
|
153
154
|
end
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
155
|
+
begin
|
156
|
+
puts "\n1)Put a list of Teams"
|
157
|
+
puts "2)Take all the Teams available"
|
158
|
+
puts "3)Take the teams from a file\n"
|
159
|
+
puts "4)Add the teams to the group later"
|
160
|
+
op2=gets.chomp
|
161
|
+
end while (op2!="1" && op2!="2" && op2!="3" && op2!="4")
|
162
|
+
refuse=false #para no añadirlo cuando se niege en la repeticion de la busqueda de fichero
|
163
|
+
if op2=="1"
|
164
|
+
puts "\nPut a list of Teams (Separeted with space): "
|
165
|
+
list=gets.chomp
|
166
|
+
list=list.split(" ")
|
167
|
+
end
|
168
|
+
if op2=="2"
|
169
|
+
puts "All the teams have been taken"
|
170
|
+
list=teamlist.keys
|
171
|
+
end
|
172
|
+
if op2=="3"
|
173
|
+
begin
|
174
|
+
ex=2
|
175
|
+
puts "Put the name of the file: "
|
176
|
+
file=gets.chomp
|
177
|
+
list=sys.loadfile(file)
|
178
|
+
if list==nil
|
179
|
+
puts "The file doesn't exist or It's empty. Do you like to try again? (y/n):"
|
180
|
+
op3=gets.chomp
|
181
|
+
if op3 == "n" or op3 == "N"
|
182
|
+
ex=1
|
183
|
+
refuse=true
|
184
|
+
end
|
185
|
+
else
|
186
|
+
ex=1
|
187
|
+
end
|
188
|
+
end while ex!=1
|
189
|
+
end
|
190
|
+
if op!="4" and refuse==false
|
191
|
+
team.new_group(client,config,name,list)
|
192
|
+
end
|
159
193
|
groupsadd.push(name)
|
160
194
|
else
|
161
195
|
groupsadd=[]
|
@@ -181,15 +215,21 @@ class Organizations
|
|
181
215
|
Sys.new.save_assigs("#{ENV['HOME']}/.ghedsh",list)
|
182
216
|
end
|
183
217
|
|
184
|
-
|
185
|
-
|
218
|
+
assig_exist=list["orgs"].detect{|aux| aux["name"]==config["Org"]}["assigs"].detect{|aux| aux["name_assig"]==name}
|
219
|
+
if assig_exist==nil
|
186
220
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
221
|
+
reponame=self.assignment_repository(client,config,name)
|
222
|
+
groupsadd=self.assignment_groups(client,config)
|
223
|
+
|
224
|
+
begin
|
225
|
+
list["orgs"][list["orgs"].index{|aux| aux["name"]==config["Org"]}]["assigs"].push({"name_assig"=>name,"teams"=>[],"groups"=>groupsadd,"repo"=>reponame})
|
226
|
+
rescue Exception => e
|
227
|
+
puts e
|
228
|
+
end
|
229
|
+
Sys.new.save_assigs("#{ENV['HOME']}/.ghedsh",list)
|
230
|
+
else
|
231
|
+
puts "Already exists an Assignment with that name"
|
191
232
|
end
|
192
|
-
Sys.new.save_assigs("#{ENV['HOME']}/.ghedsh",list)
|
193
233
|
end
|
194
234
|
|
195
235
|
def get_assigs(client,config)
|
@@ -516,8 +556,8 @@ class Organizations
|
|
516
556
|
if field==nil
|
517
557
|
inuser.each_value do |j|
|
518
558
|
if j.include?("github.com")
|
519
|
-
if j.include?("https://")
|
520
|
-
Sys.new.open_url("
|
559
|
+
if !j.include?("https://") && !j.include?("http://")
|
560
|
+
Sys.new.open_url("https://"+j)
|
521
561
|
else
|
522
562
|
Sys.new.open_url(j)
|
523
563
|
end
|
@@ -529,7 +569,7 @@ class Organizations
|
|
529
569
|
end
|
530
570
|
else
|
531
571
|
if inuser.keys.include?(field.downcase)
|
532
|
-
if inuser[field.downcase].include?("https://")
|
572
|
+
if !inuser[field.downcase].include?("https://") && !inuser[field.downcase].include?("http://")
|
533
573
|
url="http://"+inuser["#{field.downcase}"]
|
534
574
|
else
|
535
575
|
url=inuser["#{field.downcase}"]
|
data/lib/actions/system.rb
CHANGED
@@ -49,6 +49,28 @@ class Sys
|
|
49
49
|
Readline.completion_proc = comp
|
50
50
|
end
|
51
51
|
|
52
|
+
def load_memory(path,config)
|
53
|
+
if File.exist?("#{path}/ghedsh-#{config["User"]}-history")
|
54
|
+
source=File.read("#{path}/ghedsh-#{config["User"]}-history")
|
55
|
+
s=source.split("\n")
|
56
|
+
s.each do |i|
|
57
|
+
Readline::HISTORY.push(i)
|
58
|
+
end
|
59
|
+
else
|
60
|
+
File.write("#{path}/ghedsh-#{config["User"]}-history","")
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def save_memory(path,config)
|
65
|
+
mem= Readline::HISTORY.to_a
|
66
|
+
me=""
|
67
|
+
mem.each do |i|
|
68
|
+
me=me+i.to_s+"\n"
|
69
|
+
end
|
70
|
+
File.write("#{path}/ghedsh-#{config["User"]}-history",me)
|
71
|
+
end
|
72
|
+
|
73
|
+
|
52
74
|
def write_initial_memory
|
53
75
|
history=LIST+memory
|
54
76
|
comp = proc { |s| LIST.grep( /^#{Regexp.escape(s)}/ ) }
|
@@ -399,6 +421,17 @@ class Sys
|
|
399
421
|
end
|
400
422
|
end
|
401
423
|
|
424
|
+
def loadfile(path)
|
425
|
+
if File.exist?(path)
|
426
|
+
mem=File.read(path)
|
427
|
+
mem=mem.split("\n")
|
428
|
+
return mem
|
429
|
+
else
|
430
|
+
puts "File not found"
|
431
|
+
return nil
|
432
|
+
end
|
433
|
+
end
|
434
|
+
|
402
435
|
def open_url(url)
|
403
436
|
case
|
404
437
|
when RUBY_PLATFORM.downcase.include?("darwin")
|
data/lib/actions/teams.rb
CHANGED
@@ -5,10 +5,11 @@ require 'require_all'
|
|
5
5
|
require_rel '.'
|
6
6
|
|
7
7
|
class Teams
|
8
|
-
attr_accessor :teamlist
|
8
|
+
attr_accessor :teamlist; :groupsteams
|
9
9
|
|
10
10
|
def initialize
|
11
11
|
@teamlist=Hash.new
|
12
|
+
@groupsteams=Hash.new
|
12
13
|
end
|
13
14
|
|
14
15
|
def add_to_team(client,config,path)
|
@@ -28,6 +29,10 @@ class Teams
|
|
28
29
|
return @teamlist
|
29
30
|
end
|
30
31
|
|
32
|
+
def clean_groupsteams() #metodo para limpiar la cache en cd ..
|
33
|
+
@groupsteams=Hash.new
|
34
|
+
end
|
35
|
+
|
31
36
|
def create_team(client,config,name)
|
32
37
|
begin
|
33
38
|
client.create_team(config["Org"],{:name=>name,:permission=>'push'})
|
@@ -110,8 +115,16 @@ class Teams
|
|
110
115
|
puts i["name_group"]
|
111
116
|
i["teams"].each do |j|
|
112
117
|
puts "\t#{j}"
|
113
|
-
|
114
|
-
|
118
|
+
if @groupsteams["#{j}"]==nil
|
119
|
+
@groupsteams["#{j}"]=Array.new
|
120
|
+
self.get_team_members(client,config,j).each do |k|
|
121
|
+
puts "\t\t#{k}"
|
122
|
+
@groupsteams["#{j}"].push(k)
|
123
|
+
end
|
124
|
+
else
|
125
|
+
@groupsteams["#{j}"].each do |k|
|
126
|
+
puts "\t\t#{k}"
|
127
|
+
end
|
115
128
|
end
|
116
129
|
end
|
117
130
|
end
|
data/lib/interface.rb
CHANGED
@@ -435,7 +435,6 @@ class Interface
|
|
435
435
|
def run(config_path, argv_token,user)
|
436
436
|
ex=1
|
437
437
|
opscript=[]
|
438
|
-
|
439
438
|
@sysbh.write_initial_memory()
|
440
439
|
HelpM.new.welcome()
|
441
440
|
o=Organizations.new
|
@@ -459,7 +458,7 @@ class Interface
|
|
459
458
|
@deep=s.return_deep(config_path)
|
460
459
|
#if @deep==ORGS then @teamlist=t.get_teamlist end #solucion a la carga de las ids de los equipos de trabajo
|
461
460
|
end
|
462
|
-
|
461
|
+
@sysbh.load_memory(config_path,@config)
|
463
462
|
#@deep=USER
|
464
463
|
if @client!=nil
|
465
464
|
@sysbh.add_history_str(2,Organizations.new.read_orgs(@client))
|
@@ -482,13 +481,16 @@ class Interface
|
|
482
481
|
|
483
482
|
case
|
484
483
|
when op == "exit" then ex=0
|
484
|
+
@sysbh.save_memory(config_path,@config)
|
485
485
|
s.save_cache(config_path,@config)
|
486
486
|
s.remove_temp("#{ENV['HOME']}/.ghedsh/temp")
|
487
487
|
when op == "help" then self.help()
|
488
488
|
when op == "orgs" then self.orgs()
|
489
|
-
when op == "cd .."
|
489
|
+
when op == "cd .."
|
490
|
+
if @deep==ORGS then t.clean_groupsteams() end ##cleans groups cache
|
491
|
+
self.cdback(false)
|
490
492
|
when op == "people" then self.people()
|
491
|
-
when op == "teams"
|
493
|
+
when op == "teams"
|
492
494
|
if @deep==ORGS
|
493
495
|
t.show_teams_bs(@client,@config)
|
494
496
|
end
|
@@ -525,7 +527,7 @@ class Interface
|
|
525
527
|
@teamlist=t.read_teamlist(@client,@config)
|
526
528
|
@sysbh.add_history_str(1,@teamlist)
|
527
529
|
end
|
528
|
-
when op.include?("new") && op.include?("comment")
|
530
|
+
when op.include?("new") && !op.include?("comment") && opcd[0]=="new" && opcd[1]=="issue"
|
529
531
|
if opcd.size==2 and (@deep==ORGS_REPO || @deep==USER_REPO || @deep==TEAM_REPO)
|
530
532
|
r.create_issue(@client,@config,@deep,config_path)
|
531
533
|
end
|
@@ -648,7 +650,7 @@ class Interface
|
|
648
650
|
end
|
649
651
|
end
|
650
652
|
if opcd[0]=="do" and opcd.size>1
|
651
|
-
opscript=s.load_script(opcd[1])
|
653
|
+
# opscript=s.load_script(opcd[1])
|
652
654
|
end
|
653
655
|
if opcd[0]=="set"
|
654
656
|
self.set(opcd[1])
|
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.33
|
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-04-
|
12
|
+
date: 2017-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: octokit
|