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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e6a1aa39eb28e77a453ffd27bd0a5eb3ba41003
4
- data.tar.gz: 0b4b7a21e90573c14f588c4ca82849ed3b0b3d78
3
+ metadata.gz: 0f33992ab76ebb5292a28ce928bf4e16aaf6f789
4
+ data.tar.gz: bf405fdeb60b377c4f108aee301a838cf95b2099
5
5
  SHA512:
6
- metadata.gz: 573c4ae20362c0ca25a5a7a5b55823e85a63e0c2ec5b8a226deca62da789a5c0378dadb47bd99dd39415223462d3fb8cdce5d8f3e3ed3c1d812871eb53dea84a
7
- data.tar.gz: 7f4e4b70fc9afcdeba7efbaf7091bb59eaa93931c9f2a8659d4d1f5c177f04182c28d8ec38a581cf09e3b554fefebd6ef00084d9b6dcba7c030161485fcfc159
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
- print "\torgs\t\t\tshow your organizations\n"
12
- print "\trepos\t\t\tlist your repositories\n\n"
13
- print "\tclone\t\t\tclone a repository or a list of repositories using a regular expresion\n"
14
- print "\tnew_repository\t\tcreate a repository in your personal account\n"
15
- print "\tset\t\t\tmove you to a specific repository\n"
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
- print "\trepos\t\t\tlist the repositories of your organization\n"
22
- print "\tclone\t\t\tclone a repository or a list of repositories using a regular expresion\n"
23
- print "\tset\t\t\tmove you to a specific repository\n"
24
- print "\tpeople\t\t\tmembers of a organization\n"
25
- print "\tteams\t\t\tteams of a organization\n"
26
- print "\tnew_assignment\t\tcreate a repository in your organization\n"
27
- print "\trm_team\t\t\tdelete a team in you organization. Expected the name of the team\n"
28
- 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"
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
- 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"
35
- print "\tfiles\t\t\tshow the files of the repository path given\n"
36
- print "\tcat\t\t\tshow data from a file\n"
37
- print "\tcol\t\t\tshow the list of collaborators from the repository\n\n"
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
- print "\tpeople\t\t\tmembers of the team\n"
43
- print "\tclone\t\t\tclone a repository or a list of repositories using a regular expresion\n"
44
- print "\tnew_repository\t\tcreate a repository to this team\n"
45
- print "\tadd_to_team\t\t\tadd a member in the team\n\n"
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
- 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"
52
- print "\tfiles\t\t\tshow the files of the repository path given\n"
53
- print "\tcat\t\t\tshow data from a file\n"
54
- print "\tcol\t\t\tshow the list of collaborators from the repository\n\n"
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
- 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"
60
- print "\tfiles\t\t\tshow the files of the repository path given\n"
61
- print "\tcat\t\t\tshow data from a file\n"
62
- print "\tcol\t\t\tshow the list of collaborators from the repository\n\n"
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 "\nList of commands\n"
67
- print "\tdo\t\t\trun a script in ghedsh execute path\n"
68
- print "\texit\t\t\texit from this program\n"
69
- print "\thelp\t\t\tlist of commands available\n"
70
- print "\tcd\t\t\tgo to the path\n"
71
- print "\t!\t\t\texecute a bash command\n"
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)
@@ -74,7 +74,7 @@ class Sys
74
74
  config["User"]=@client.login
75
75
  userslist=self.load_users(configure_path)
76
76
 
77
- if userslist["users"].detect {|f| f["#{config["User"]}"] }==nil
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
- @deep=USER
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
@@ -1,3 +1,3 @@
1
1
  module Ghedsh
2
- VERSION='1.1.22'
2
+ VERSION='1.1.23'
3
3
  end
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.22
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: 2016-07-18 00:00:00.000000000 Z
12
+ date: 2017-02-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: octokit