ghedsh 1.1.22 → 1.1.23
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 +47 -38
- data/lib/actions/repo.rb +9 -0
- data/lib/actions/system.rb +36 -1
- data/lib/interface.rb +4 -2
- 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: 0f33992ab76ebb5292a28ce928bf4e16aaf6f789
|
4
|
+
data.tar.gz: bf405fdeb60b377c4f108aee301a838cf95b2099
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7213d3a442b613f8a84dc5a71c7d684e9d232b2613f50177ecbdbba07fd7e285f9ca38cfab004b46761a018c02a2d4bfedbebb2573eecc353dc0b9a58bb398d1
|
7
|
+
data.tar.gz: 8183b0ebdab696d62b5799e3fd6bc87bf468159aea557e939aea8b4fde9c504ba2b3c4f2b718fa4c06251cd1f7214c78f1c9dd84dd8442531ae8246218825d18
|
data/lib/actions/help.rb
CHANGED
@@ -8,67 +8,76 @@ class HelpM
|
|
8
8
|
|
9
9
|
def user()
|
10
10
|
self.common_opt
|
11
|
-
|
12
|
-
print "\
|
13
|
-
print "\
|
14
|
-
print "\
|
15
|
-
print "\
|
11
|
+
puts " Users options:"
|
12
|
+
print "\torgs\t\t\tShow your organizations\n"
|
13
|
+
print "\trepos\t\t\tList your repositories\n"
|
14
|
+
print "\tclone\t\t\tClone a repository or a list of repositories using a regular expresion\n"
|
15
|
+
print "\tnew_repository\t\tCreate a repository in your personal account\n"
|
16
|
+
print "\tset\t\t\tMove you to a specific repository\n"
|
16
17
|
|
17
18
|
end
|
18
19
|
|
19
20
|
def org()
|
20
21
|
self.common_opt
|
21
|
-
|
22
|
-
print "\
|
23
|
-
print "\
|
24
|
-
print "\
|
25
|
-
print "\
|
26
|
-
print "\
|
27
|
-
print "\
|
28
|
-
print "\
|
22
|
+
puts " Organization options:"
|
23
|
+
print "\trepos\t\t\tList the repositories of your organization\n"
|
24
|
+
print "\tclone\t\t\tClone a repository or a list of repositories using a regular expresion\n"
|
25
|
+
print "\tset\t\t\tMove you to a specific repository\n"
|
26
|
+
print "\tpeople\t\t\tMembers of a organization\n"
|
27
|
+
print "\tteams\t\t\tTeams of a organization\n"
|
28
|
+
print "\tnew_assignment\t\tCreate a repository in your organization\n"
|
29
|
+
print "\trm_team\t\t\tDelete a team in you organization. Expected the name of the team\n"
|
30
|
+
print "\tnew_team\t\t\tCreate a team in the organization. Expected the name of the team, and/or members given one by one\n\n"
|
29
31
|
end
|
30
32
|
|
31
33
|
def org_repo()
|
32
34
|
self.common_opt
|
33
|
-
|
34
|
-
print "\
|
35
|
-
print "\
|
36
|
-
print "\
|
37
|
-
print "\
|
35
|
+
puts " Repository options:"
|
36
|
+
print "\tcommits\t\t\tShow the list of commits from the repository\n"
|
37
|
+
print "\tissues\t\t\tShow the list of issues from the repository\n"
|
38
|
+
print "\tfiles\t\t\tShow the files of the repository path given\n"
|
39
|
+
print "\tcat\t\t\tShow data from a file\n"
|
40
|
+
print "\tcol\t\t\tShow the list of collaborators from the repository\n\n"
|
38
41
|
end
|
39
42
|
|
40
43
|
def orgs_teams()
|
41
44
|
self.common_opt
|
42
|
-
|
43
|
-
print "\
|
44
|
-
print "\
|
45
|
-
print "\
|
45
|
+
puts " Organization team options:"
|
46
|
+
print "\tpeople\t\t\tMembers of the team\n"
|
47
|
+
print "\tclone\t\t\tClone a repository or a list of repositories using a regular expresion\n"
|
48
|
+
print "\tnew_repository\t\tCreate a repository to this team\n"
|
49
|
+
print "\tadd_to_team\t\t\tAdd a member in the team\n\n"
|
46
50
|
end
|
47
51
|
|
48
52
|
def user_repo()
|
49
53
|
self.common_opt
|
50
|
-
|
51
|
-
print "\
|
52
|
-
print "\
|
53
|
-
print "\
|
54
|
-
print "\
|
54
|
+
puts " Repository options:"
|
55
|
+
print "\tcommits\t\t\tShow the list of commits from the repository\n"
|
56
|
+
print "\tissues\t\t\tShow the list of issues 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"
|
55
60
|
end
|
56
61
|
def team_repo()
|
57
62
|
self.common_opt
|
58
|
-
|
59
|
-
print "\
|
60
|
-
print "\
|
61
|
-
print "\
|
62
|
-
print "\
|
63
|
+
puts " Repository options:"
|
64
|
+
print "\tcommits\t\t\tShow the list of commits from the repository\n"
|
65
|
+
print "\tissues\t\t\tShow the list of issues from the repository\n"
|
66
|
+
print "\tfiles\t\t\tShow the files of the repository path given\n"
|
67
|
+
print "\tcat\t\t\tShow data from a file\n"
|
68
|
+
print "\tcol\t\t\tShow the list of collaborators from the repository\n\n"
|
63
69
|
end
|
64
70
|
|
65
71
|
def common_opt()
|
66
|
-
puts "\
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
print "\
|
71
|
-
print "\t
|
72
|
+
puts "\n------------------"
|
73
|
+
puts " List of commands "
|
74
|
+
puts "------------------"
|
75
|
+
puts "\n Main options:"
|
76
|
+
print "\tdo\t\t\tRun a script in ghedsh execute path\n"
|
77
|
+
print "\texit\t\t\tExit from this program\n"
|
78
|
+
print "\thelp\t\t\tList of commands available\n"
|
79
|
+
print "\tcd\t\t\tGo to the path\n"
|
80
|
+
print "\t!\t\t\tExecute a bash command\n\n"
|
72
81
|
end
|
73
82
|
|
74
83
|
def welcome
|
data/lib/actions/repo.rb
CHANGED
@@ -111,6 +111,15 @@ class Repositories
|
|
111
111
|
end
|
112
112
|
return mem
|
113
113
|
end
|
114
|
+
|
115
|
+
#show issues comment
|
116
|
+
def get_issues_cm
|
117
|
+
end
|
118
|
+
|
119
|
+
#add issue comment
|
120
|
+
def add_issue_cm
|
121
|
+
end
|
122
|
+
|
114
123
|
#Show repositories and return a list of them
|
115
124
|
#exp = regular expression
|
116
125
|
def show_repos(client,config,scope,exp)
|
data/lib/actions/system.rb
CHANGED
@@ -74,7 +74,7 @@ class Sys
|
|
74
74
|
config["User"]=@client.login
|
75
75
|
userslist=self.load_users(configure_path)
|
76
76
|
|
77
|
-
|
77
|
+
if userslist["users"].detect {|f| f["#{config["User"]}"] }==nil
|
78
78
|
self.add_users(configure_path,"#{config["User"]}"=>token)
|
79
79
|
end
|
80
80
|
if argv_token!=nil
|
@@ -96,6 +96,7 @@ class Sys
|
|
96
96
|
list=self.load_users(configure_path)
|
97
97
|
userFound=list["users"].detect {|f| f["#{user}"]}
|
98
98
|
if userFound!=nil
|
99
|
+
self.clear_cache(configure_path)
|
99
100
|
json = File.read("#{configure_path}/ghedsh-cache.json")
|
100
101
|
config=JSON.parse(json)
|
101
102
|
@client=self.login(userFound["#{user}"])
|
@@ -118,6 +119,35 @@ class Sys
|
|
118
119
|
return users
|
119
120
|
end
|
120
121
|
|
122
|
+
def return_deep(path)
|
123
|
+
json = File.read("#{path}/ghedsh-cache.json")
|
124
|
+
cache=JSON.parse(json)
|
125
|
+
deep=1
|
126
|
+
case
|
127
|
+
when cache["Team"]!=nil
|
128
|
+
if cache["Repo"]!=nil
|
129
|
+
deep=5
|
130
|
+
else
|
131
|
+
deep=4
|
132
|
+
end
|
133
|
+
when cache["Team"]==nil
|
134
|
+
if cache["Org"]!=nil
|
135
|
+
if cache["Repo"]!=nil
|
136
|
+
deep=3
|
137
|
+
else
|
138
|
+
deep=2
|
139
|
+
end
|
140
|
+
else
|
141
|
+
if cache["Repo"]!=nil
|
142
|
+
deep=10
|
143
|
+
else
|
144
|
+
deep=1
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
return deep
|
149
|
+
end
|
150
|
+
|
121
151
|
def add_users(path,data)
|
122
152
|
json=File.read("#{path}/ghedsh-users.json")
|
123
153
|
users=JSON.parse(json)
|
@@ -242,6 +272,11 @@ class Sys
|
|
242
272
|
File.write("#{path}/ghedsh-cache.json",data.to_json)
|
243
273
|
end
|
244
274
|
|
275
|
+
def clear_cache(path)
|
276
|
+
con={:User=>nil,:Org=>nil,:Repo=>nil,:Team=>nil,:TeamID=>nil}
|
277
|
+
File.write("#{path}/ghedsh-cache.json",con.to_json)
|
278
|
+
end
|
279
|
+
|
245
280
|
def save_db(path,data)
|
246
281
|
File.write("#{path}/db/assignments.json", data.to_json)
|
247
282
|
end
|
data/lib/interface.rb
CHANGED
@@ -441,12 +441,14 @@ class Interface
|
|
441
441
|
if @config==nil
|
442
442
|
ex=0
|
443
443
|
end
|
444
|
+
@deep=USER
|
444
445
|
else
|
445
|
-
@config=s.load_config(config_path,argv_token)
|
446
|
+
@config=s.load_config(config_path,argv_token) #retorna la configuracion ya guardada anteriormente
|
446
447
|
@client=s.client
|
448
|
+
@deep=s.return_deep(config_path)
|
447
449
|
end
|
448
450
|
|
449
|
-
|
451
|
+
#@deep=USER
|
450
452
|
if @client!=nil
|
451
453
|
@sysbh.add_history_str(2,Organizations.new.read_orgs(@client))
|
452
454
|
end
|
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.23
|
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:
|
12
|
+
date: 2017-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: octokit
|