forked from GuiCarneiro/AgendaPopulator2000
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rb
97 lines (75 loc) · 1.78 KB
/
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
require './lib/headquarters.rb'
require './lib/classrooms.rb'
require './lib/disciplines.rb'
require './lib/students.rb'
require './lib/responsibles.rb'
require './lib/teachers.rb'
require './lib/team.rb'
require './lib/autentication.rb'
puts 'Qual a URL do Staging?'
SCHOOL_URL = gets.chomp
puts 'Qual o usuário ou e-mail do SchoolUser?'
SCHOOL_USERNAME = gets.chomp
puts 'Qual a Senha do SchoolUser?'
SCHOOL_PASSWORD = gets.chomp
puts 'Qual o token da escola?'
SCHOOL_TOKEN = gets.chomp
puts 'Qual o ID da Disciplina Polivalente?'
SCHOOL_FIRST_DISCIPLINE = gets.chomp
school_auth_token = AgendaAutentication.auth(
SCHOOL_USERNAME,
SCHOOL_PASSWORD,
SCHOOL_URL,
SCHOOL_TOKEN
)
printf("\rProgress: [%-20s]", "=" * (1))
headquarters = AgendaGenerateHeadquarters.generate(
SCHOOL_URL,
SCHOOL_TOKEN,
school_auth_token
)
printf("\rProgress: [%-20s]", "=" * (2))
classrooms = AgendaGenerateClassrooms.generate(
SCHOOL_URL,
SCHOOL_TOKEN,
school_auth_token,
SCHOOL_FIRST_DISCIPLINE,
headquarters
)
printf("\rProgress: [%-20s]", "=" * (3))
disciplines = AgendaGenerateDisciplines.generate(
SCHOOL_URL,
SCHOOL_TOKEN,
school_auth_token,
classrooms
)
printf("\rProgress: [%-20s]", "=" * (5))
students = AgendaGenerateStudents.generate(
SCHOOL_URL,
SCHOOL_TOKEN,
school_auth_token,
classrooms
)
printf("\rProgress: [%-20s]", "=" * (9))
responsibles = AgendaGenerateResponsibles.generate(
SCHOOL_URL,
SCHOOL_TOKEN,
school_auth_token,
students
)
printf("\rProgress: [%-20s]", "=" * (13))
teachers = AgendaGenerateTeachers.generate(
SCHOOL_URL,
SCHOOL_TOKEN,
school_auth_token,
classrooms,
disciplines
)
printf("\rProgress: [%-20s]", "=" * (16))
teams = AgendaGenerateTeams.generate(
SCHOOL_URL,
SCHOOL_TOKEN,
school_auth_token,
headquarters
)
printf("\rProgress: [%-20s]", "=" * (20))