ghedsh 1.1.14 → 1.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/actions/help.rb +3 -0
- data/lib/actions/repo.rb +4 -3
- data/lib/actions/system.rb +1 -1
- data/lib/interface.rb +82 -13
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc397c9530e474d050f6d450dd4aa466232c58ba
|
4
|
+
data.tar.gz: e802e974b144bae6a1b4066c371abeb90fc1f3a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 692e0d27cde267e4bd71a84e0a1fba548d509a55f0a5e7dc9112cfc52c16148fecc35d64a4aeb115102277dd3865f7745e4492caa5d18367fed19f74d244415b
|
7
|
+
data.tar.gz: f3101d13d3efbcf58914d864f2970b453c1ebceeec100000cdb705b421ed63afdd05934a57a6647f824a3b63c72d6502c5589c43609fecca7e6eaf06a479c44b
|
data/lib/actions/help.rb
CHANGED
@@ -31,6 +31,7 @@ class HelpM
|
|
31
31
|
def org_repo()
|
32
32
|
self.common_opt
|
33
33
|
print "\tcommits\t\t\tshow the list of commits from the repository\n"
|
34
|
+
print "\tissues\t\t\tshow the list of issues from the repository\n"
|
34
35
|
print "\tfiles\t\t\tshow the files of the repository path given\n"
|
35
36
|
print "\tcat\t\t\tshow data from a file\n"
|
36
37
|
print "\tcol\t\t\tshow the list of collaborators from the repository\n\n"
|
@@ -47,6 +48,7 @@ class HelpM
|
|
47
48
|
def user_repo()
|
48
49
|
self.common_opt
|
49
50
|
print "\tcommits\t\t\tshow the list of commits from the repository\n"
|
51
|
+
print "\tissues\t\t\tshow the list of issues from the repository\n"
|
50
52
|
print "\tfiles\t\t\tshow the files of the repository path given\n"
|
51
53
|
print "\tcat\t\t\tshow data from a file\n"
|
52
54
|
print "\tcol\t\t\tshow the list of collaborators from the repository\n\n"
|
@@ -54,6 +56,7 @@ class HelpM
|
|
54
56
|
def team_repo()
|
55
57
|
self.common_opt
|
56
58
|
print "\tcommits\t\t\tshow the list of commits from the repository\n"
|
59
|
+
print "\tissues\t\t\tshow the list of issues from the repository\n"
|
57
60
|
print "\tfiles\t\t\tshow the files of the repository path given\n"
|
58
61
|
print "\tcat\t\t\tshow data from a file\n"
|
59
62
|
print "\tcol\t\t\tshow the list of collaborators from the repository\n\n"
|
data/lib/actions/repo.rb
CHANGED
@@ -341,9 +341,8 @@ class Repositories
|
|
341
341
|
end
|
342
342
|
end
|
343
343
|
|
344
|
-
def get_files(client,config,path,scope)
|
345
|
-
|
346
|
-
show=true
|
344
|
+
def get_files(client,config,path,show,scope)
|
345
|
+
#show=true
|
347
346
|
if path.match(/.\./)==nil
|
348
347
|
case
|
349
348
|
when scope==USER_REPO
|
@@ -380,6 +379,8 @@ class Repositories
|
|
380
379
|
end
|
381
380
|
if show!=false
|
382
381
|
self.show_files(list)
|
382
|
+
else
|
383
|
+
return list
|
383
384
|
end
|
384
385
|
else
|
385
386
|
puts "#{path} is not a directory. If you want to open a file try to use cat <path>"
|
data/lib/actions/system.rb
CHANGED
@@ -9,7 +9,7 @@ require 'version'
|
|
9
9
|
class Sys
|
10
10
|
attr_reader :client
|
11
11
|
attr_reader :memory
|
12
|
-
LIST = ['repos', 'exit', 'orgs','help', 'people','teams', 'cd ', 'cd repo ','commits','forks', 'add_team_member ','new_team ','rm_team ','new_repository ','new_assignment ','clone '].sort
|
12
|
+
LIST = ['repos', 'exit', 'orgs','help', 'people','teams', 'cd ', 'cd repo ','commits','forks', 'add_team_member ','new_team ','rm_team ','new_repository ','new_assignment ','clone ', 'issues', 'version'].sort
|
13
13
|
|
14
14
|
def initialize()
|
15
15
|
@memory=[]
|
data/lib/interface.rb
CHANGED
@@ -25,11 +25,12 @@ class Interface
|
|
25
25
|
attr_accessor :client
|
26
26
|
attr_accessor :deep
|
27
27
|
attr_accessor :memory
|
28
|
-
attr_reader :orgs_list,:repos_list, :teamlist, :orgs_repos, :teams_repos
|
28
|
+
attr_reader :orgs_list,:repos_list, :teamlist, :orgs_repos, :teams_repos, :repo_path
|
29
29
|
|
30
30
|
def initialize
|
31
31
|
@sysbh=Sys.new()
|
32
32
|
@repos_list=[]; @orgs_repos=[]; @teams_repos=[]; @orgs_list=[]; @teamlist=[]
|
33
|
+
@repo_path=''
|
33
34
|
|
34
35
|
options=@sysbh.parse
|
35
36
|
|
@@ -53,11 +54,26 @@ class Interface
|
|
53
54
|
def prompt()
|
54
55
|
case
|
55
56
|
when @deep == USER then return @config["User"]+"> "
|
56
|
-
when @deep == USER_REPO
|
57
|
+
when @deep == USER_REPO
|
58
|
+
if @repo_path!=""
|
59
|
+
@config["User"]+">"+ "\e[31m#{@config["Repo"]}\e[0m"+">"+"#{@repo_path}"+"> "
|
60
|
+
else
|
61
|
+
return @config["User"]+">"+ "\e[31m#{@config["Repo"]}\e[0m"+"> "
|
62
|
+
end
|
57
63
|
when @deep == ORGS then return @config["User"]+">"+ "\e[34m#{@config["Org"]}\e[0m"+"> "
|
58
64
|
when @deep == TEAM then return @config["User"]+">"+"\e[34m#{@config["Org"]}\e[0m"+">"+"\e[32m#{@config["Team"]}\e[0m"+"> "
|
59
|
-
when @deep == TEAM_REPO
|
60
|
-
|
65
|
+
when @deep == TEAM_REPO
|
66
|
+
if @repo_path!=""
|
67
|
+
return @config["User"]+">"+"\e[34m#{@config["Org"]}\e[0m"+">"+"\e[32m#{@config["Team"]}\e[0m"+">"+"\e[31m#{@config["Repo"]}\e[0m"+">"+"#{@repo_path}"+"> "
|
68
|
+
else
|
69
|
+
return @config["User"]+">"+"\e[34m#{@config["Org"]}\e[0m"+">"+"\e[32m#{@config["Team"]}\e[0m"+">"+"\e[31m#{@config["Repo"]}\e[0m"+"> "
|
70
|
+
end
|
71
|
+
when @deep == ORGS_REPO then
|
72
|
+
if @repo_path!=""
|
73
|
+
return @config["User"]+">"+"\e[34m#{@config["Org"]}\e[0m"+">"+"\e[31m#{@config["Repo"]}\e[0m"+">"+"#{@repo_path}"+"> "
|
74
|
+
else
|
75
|
+
return @config["User"]+">"+"\e[34m#{@config["Org"]}\e[0m"+">"+"\e[31m#{@config["Repo"]}\e[0m"+"> "
|
76
|
+
end
|
61
77
|
end
|
62
78
|
end
|
63
79
|
|
@@ -88,19 +104,49 @@ class Interface
|
|
88
104
|
@deep=1
|
89
105
|
@orgs_repos=[]
|
90
106
|
when @deep == ORGS_REPO
|
91
|
-
@
|
92
|
-
|
107
|
+
if @repo_path==""
|
108
|
+
@config["Repo"]=nil
|
109
|
+
@deep=2
|
110
|
+
else
|
111
|
+
aux=@repo_path.split("/")
|
112
|
+
aux.pop
|
113
|
+
if aux.empty?
|
114
|
+
@repo_path=""
|
115
|
+
else
|
116
|
+
@repo_path=aux.join("/")
|
117
|
+
end
|
118
|
+
end
|
93
119
|
when @deep == USER_REPO
|
94
|
-
@
|
95
|
-
|
120
|
+
if @repo_path==""
|
121
|
+
@config["Repo"]=nil
|
122
|
+
@deep=1
|
123
|
+
else
|
124
|
+
aux=@repo_path.split("/")
|
125
|
+
aux.pop
|
126
|
+
if aux.empty?
|
127
|
+
@repo_path=""
|
128
|
+
else
|
129
|
+
@repo_path=aux.join("/")
|
130
|
+
end
|
131
|
+
end
|
96
132
|
when @deep == TEAM
|
97
133
|
@config["Team"]=nil
|
98
134
|
@config["TeamID"]=nil
|
99
135
|
@teams_repos=[]
|
100
136
|
@deep=2
|
101
137
|
when @deep == TEAM_REPO
|
102
|
-
@
|
103
|
-
|
138
|
+
if @repo_path==""
|
139
|
+
@config["Repo"]=nil
|
140
|
+
@deep=TEAM
|
141
|
+
else
|
142
|
+
aux=@repo_path.split("/")
|
143
|
+
aux.pop
|
144
|
+
if aux.empty?
|
145
|
+
@repo_path=""
|
146
|
+
else
|
147
|
+
@repo_path=aux.join("/")
|
148
|
+
end
|
149
|
+
end
|
104
150
|
end
|
105
151
|
else
|
106
152
|
@config["Org"]=nil
|
@@ -109,12 +155,17 @@ class Interface
|
|
109
155
|
@config["TeamID"]=nil
|
110
156
|
@deep=1
|
111
157
|
@orgs_repos=[]; @teams_repos=[]
|
158
|
+
@repo_path=""
|
112
159
|
end
|
113
160
|
end
|
114
161
|
|
115
162
|
#Go to the path, depends with the scope
|
116
163
|
#if you are in user scope, first searchs Orgs then Repos, etc.
|
117
164
|
def cd(path)
|
165
|
+
if @deep==ORGS_REPO || @deep==USER_REPO || @deep==TEAM_REPO
|
166
|
+
self.cdrepo(path)
|
167
|
+
end
|
168
|
+
|
118
169
|
path_split=path.split("/")
|
119
170
|
if path_split.size==1 ##cd con path simple
|
120
171
|
case
|
@@ -181,7 +232,6 @@ class Interface
|
|
181
232
|
puts "\nNo team is available with that name"
|
182
233
|
end
|
183
234
|
end
|
184
|
-
|
185
235
|
end
|
186
236
|
end
|
187
237
|
|
@@ -227,6 +277,23 @@ class Interface
|
|
227
277
|
if @deep==USER || @deep==ORGS || @deep==TEAM then puts "No repository is available with that name\n\n" end
|
228
278
|
end
|
229
279
|
|
280
|
+
def cdrepo(path)
|
281
|
+
r=Repositories.new()
|
282
|
+
list=[]
|
283
|
+
|
284
|
+
if @repo_path==""
|
285
|
+
newpath=path
|
286
|
+
else
|
287
|
+
newpath=@repo_path+"/"+path
|
288
|
+
end
|
289
|
+
list=r.get_files(@client,@config,newpath,false,@deep)
|
290
|
+
if list==nil
|
291
|
+
puts "Wrong path name"
|
292
|
+
else
|
293
|
+
@repo_path=newpath
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
230
297
|
def orgs()
|
231
298
|
case
|
232
299
|
when @deep==USER
|
@@ -381,6 +448,8 @@ class Interface
|
|
381
448
|
if @deep==ORGS
|
382
449
|
t.list_groups(@client,@config)
|
383
450
|
end
|
451
|
+
when op == "version"
|
452
|
+
puts "GitHub Education Shell v#{Ghedsh::VERSION}"
|
384
453
|
end
|
385
454
|
|
386
455
|
if opcd[0]=="cd" and opcd[1]!=".."
|
@@ -480,9 +549,9 @@ class Interface
|
|
480
549
|
end
|
481
550
|
if opcd[0]=="files"
|
482
551
|
if opcd.size==1
|
483
|
-
r.get_files(@client,@config,
|
552
|
+
r.get_files(@client,@config,@repo_path,true,@deep)
|
484
553
|
else
|
485
|
-
r.get_files(@client,@config,opcd[1],@deep)
|
554
|
+
r.get_files(@client,@config,opcd[1],true,@deep)
|
486
555
|
end
|
487
556
|
end
|
488
557
|
if opcd[0]=="cat" and opcd.size>1
|
data/lib/version.rb
CHANGED