ghedsh 1.1.18 → 1.1.19

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91a1e576e6021caa23fa8bef97618f99a7017439
4
- data.tar.gz: 6f8a0652306828dffcc67b3989e2bba7fb3a2b57
3
+ metadata.gz: 0a2ec1d8b2fd095c583e532595ee68fe18b6b53f
4
+ data.tar.gz: 9b6a3fbe5ec29a58cae30595eb2619391d21093d
5
5
  SHA512:
6
- metadata.gz: aecbf58f1241fc1b164c9852f46f38020ffa103a4ce565421d306f756c3a7c91da02d870ed3ce979c058844bae4baa34141020014fd0234ea6413e43ee28228a
7
- data.tar.gz: 10e5efc84821088d236fd0c4e7055d6f76c08394d57a455e1bab8f4f3ee30382ff04a6295fe2acaec40eb38b7ed5426f83dc6fd8446c11794fcd5a5c825fa754
6
+ metadata.gz: 11f9343de0221abdc6c56d3eaf200a67e2e1ed14de797d3eff0889e269741b5e4efa047266887522c0ff427c569bcd7e577ac91e7d320e5578b428142a6ad38f
7
+ data.tar.gz: 9698941036512841612c7d370e44e3bfcf3b157b756eb60b48f7e63879b3434b8f667575f3f2d9f4d6a62de1a16c948566de4afe5411b83e78f181f007c19489
data/README.md CHANGED
@@ -135,7 +135,12 @@ Muestra las tareas o asignaciones hechas para una organizacion.
135
135
  ```sh
136
136
  new_assignment <nombre>
137
137
  ```
138
- Crea una assignacion para una organizacion. Espera por parametro el nombre. Tras ejecutar el comando pedira un repositorio ya existente, la creacion de uno nuevo o la no insercion de un repositorio. Ademas esperara una lista de grupos para asignar a la tarea.
138
+ Crea una asignacion para una organizacion. Espera por parametro el nombre. Tras ejecutar el comando pedira un repositorio ya existente, la creacion de uno nuevo o la no insercion de un repositorio. Ademas esperara una lista de grupos para asignar a la tarea.
139
+
140
+ ```sh
141
+ make <nombre>
142
+ ```
143
+ Situado dentro de una asignacion o tarea, se creara un repositorio para cada equipo que pertenezca al grupo o grupos asignados.
139
144
 
140
145
  ```sh
141
146
  clone <nombre>
@@ -123,7 +123,47 @@ class Organizations
123
123
  return assiglist
124
124
  end
125
125
 
126
+ def get_single_assig(config,wanted)
127
+ list=self.load_assig()
128
+ as=list["orgs"].detect{|aux| aux["name"]==config["Org"]}
129
+ as=as["assigs"].detect{|aux| aux["name_assig"]==wanted}
130
+ puts as
131
+ return as
132
+ end
126
133
 
134
+ def make_assig(client,config,assig)
135
+ web="https://github.com/"
136
+ web2="git@github.com:"
137
+ repo=Repositories.new()
138
+ team=Teams.new()
139
+ teamlist=team.read_teamlist(client,config)
140
+ assig=self.get_single_assig(config,assig)
141
+
142
+ if assig["repo"]!=""
143
+
144
+ system("git clone #{web2}#{config["Org"]}/#{assig["repo"]}.git")
145
+ system("git-C #{assig["repo"]} remote rename origin professor")
146
+
147
+ assig["groups"].each do |i|
148
+ teamsforgroup=team.get_single_group(config,i)
149
+ teamsforgroup.each do |y|
150
+ config["TeamID"]=teamlist["#{y}"]
151
+ config["Team"]=y
152
+ repo.create_repository(client,config,"#{y}-#{assig["name_assig"]}",TEAM)
153
+ #system("git-C #{assig["repo"]} remote rm origin")
154
+ # system("git -C #{assig["repo"]} remote add origin #{web2}#{config["Org"]}/#{y}-#{assig["name_assig"]}.git")
155
+
156
+ #system("git -C #{assig["repo"]} remote set-url origin #{web2}#{config["Org"]}/#{y}-#{assig["name_assig"]}.git")
157
+ system("git -C #{assig["repo"]} remote add #{y} #{web2}#{config["Org"]}/#{y}-#{assig["name_assig"]}.git")
158
+ system("git -C #{assig["repo"]} push #{y} --all")
159
+ end
160
+ end
161
+ else
162
+ puts "No repository is given for this assignment"
163
+ end
164
+
165
+
166
+ end
127
167
 
128
168
  def add_team_to_assig(client,config,data)
129
169
 
@@ -241,7 +241,7 @@ class Repositories
241
241
  puts "created repository in #{config["Org"]} team"
242
242
  options[:team_id]=config["TeamID"]
243
243
  options[:organization]=config["Org"]
244
- client.create_repository(config["Team"]+"/"+repo,options)
244
+ client.create_repository(repo,options)
245
245
  end
246
246
  end
247
247
 
@@ -10,7 +10,7 @@ class Sys
10
10
  attr_reader :client
11
11
  attr_reader :memory
12
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',
13
- 'version', 'cat ', 'groups', 'files', 'assignments','new_issue ', 'open_issue', 'new_','open_', 'new_group ', 'rm_group', 'rm_', 'do '].sort
13
+ 'version', 'cat ', 'groups', 'files', 'assignments','new_issue ', 'open_issue', 'new_','open_', 'new_group ', 'rm_group', 'rm_', 'do ', 'make'].sort
14
14
 
15
15
  def initialize()
16
16
  @memory=[]
@@ -126,6 +126,14 @@ class Teams
126
126
  return grouplist
127
127
  end
128
128
 
129
+ def get_single_group(config,wanted)
130
+ sys=Sys.new()
131
+ list=sys.load_groups("#{ENV['HOME']}/.ghedsh")
132
+ w=list["orgs"].detect{|aux| aux["name"]==config["Org"]}
133
+ w=w["groups"].detect{|aux| aux["name_group"]==wanted}
134
+ return w["teams"]
135
+ end
136
+
129
137
  def new_group(client,config,name,listgroups)
130
138
  sys=Sys.new()
131
139
  list=sys.load_groups("#{ENV['HOME']}/.ghedsh")
@@ -482,7 +482,11 @@ class Interface
482
482
  puts "GitHub Education Shell v#{Ghedsh::VERSION}"
483
483
  when op == "assignments"
484
484
  if @deep==ORGS
485
- o.show_assignments(@cliente,@config)
485
+ o.show_assignments(@client,@config)
486
+ end
487
+ when op =="make"
488
+ if @deep==ASSIG
489
+ o.make_assig(@client,@config,@assig_path)
486
490
  end
487
491
  end
488
492
 
@@ -1,3 +1,3 @@
1
1
  module Ghedsh
2
- VERSION='1.1.18'
2
+ VERSION='1.1.19'
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.18
4
+ version: 1.1.19
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-06-10 00:00:00.000000000 Z
12
+ date: 2016-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: octokit