alu0101028163 0.1.0
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 +7 -0
- data/.coveralls.yml +2 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +95 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/practica6.rb +14 -0
- data/lib/practica6/etiqueta.rb +195 -0
- data/lib/practica6/list.rb +178 -0
- data/lib/practica6/menu_dietetico.rb +246 -0
- data/lib/practica6/paciente.rb +13 -0
- data/lib/practica6/paciente_obeso.rb +55 -0
- data/lib/practica6/persona.rb +31 -0
- data/lib/practica6/pruebas_menu.rb +208 -0
- data/lib/practica6/registro.rb +167 -0
- data/lib/practica6/version.rb +3 -0
- data/practica6.gemspec +46 -0
- metadata +170 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
class Persona
|
2
|
+
|
3
|
+
attr_reader :nombre, :peso, :talla, :edad, :sexo
|
4
|
+
# @param nombre [number] nombre del paciente.
|
5
|
+
# @param peso [number] peso del paciente.
|
6
|
+
# @param talla [number] altura del paciente en metros.
|
7
|
+
# @param edad [number] edad del paciente.
|
8
|
+
# @param sexo [number] sexo del paciente, 0 corresponde a hombre y 1 a mujer.
|
9
|
+
# @return [Paciente] retorna una instancia de la clase Persona.
|
10
|
+
def initialize(nombre, peso, talla, edad, sexo)
|
11
|
+
@nombre = nombre
|
12
|
+
@peso = peso
|
13
|
+
@talla = talla
|
14
|
+
@edad = edad
|
15
|
+
@sexo = sexo
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [String] retorna una cadena con la información de la Persona.
|
19
|
+
def to_s
|
20
|
+
s = "Nombre: #{@nombre}
|
21
|
+
Peso: #{@peso}
|
22
|
+
Altura: #{@talla}
|
23
|
+
Edad: #{@edad}
|
24
|
+
"
|
25
|
+
if @sexo == 0
|
26
|
+
s << "Sexo: Hombre"
|
27
|
+
else s << "Sexo: Mujer"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,208 @@
|
|
1
|
+
#require "./list.rb"
|
2
|
+
#require "./etiqueta.rb"
|
3
|
+
#require "./registro.rb"
|
4
|
+
require "benchmark"
|
5
|
+
|
6
|
+
def peso_teorico(talla)
|
7
|
+
peso_teorico_ideal = (talla - 150) * 0.75 + 50
|
8
|
+
end
|
9
|
+
|
10
|
+
# Este es el método que tenía inicialmente
|
11
|
+
def gasto_basal(peso,talla,edad,sexo)
|
12
|
+
gasto_energetico_basal = 0
|
13
|
+
if sexo == 0 #Es un hombre
|
14
|
+
gasto_energetico_basal = (10*peso) + (6.25*talla) - (5*edad) + 5
|
15
|
+
else
|
16
|
+
gasto_energetico_basal = (10*peso) + (6.25*talla) - (5*edad) - 161
|
17
|
+
end
|
18
|
+
gasto_energetico_basal
|
19
|
+
end
|
20
|
+
|
21
|
+
def efecto_termogeno(peso,talla,edad,sexo)
|
22
|
+
efecto_termogeno = gasto_basal(peso,talla,edad,sexo) * 0.10
|
23
|
+
end
|
24
|
+
|
25
|
+
def gasto_actividad_fisica(peso,talla,edad,sexo,factor)
|
26
|
+
gasto_actividad = gasto_basal(peso,talla,edad,sexo) * factor
|
27
|
+
end
|
28
|
+
|
29
|
+
def gasto_energetico_total(peso,talla,edad,sexo,factor)
|
30
|
+
gasto_total = gasto_actividad_fisica(peso,talla,edad,sexo,factor) + gasto_basal(peso,talla,edad,sexo) + efecto_termogeno(peso,talla,edad,sexo)
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
def verificar_cantidad(menu, peso,talla,edad,sexo,factor)
|
35
|
+
val_ener_menu = menu.collect{ |menu| menu.valor_energetico[0]}
|
36
|
+
total_val = val_ener_menu.reduce(:+)
|
37
|
+
gasto_total = gasto_energetico_total(peso,talla,edad,sexo,factor)
|
38
|
+
margen_error = (total_val * 10) / 100
|
39
|
+
|
40
|
+
return true if gasto_total <= (total_val + margen_error) && gasto_total >= (total_val - margen_error)
|
41
|
+
false
|
42
|
+
end
|
43
|
+
|
44
|
+
# FUNCIONES PRÁCTICA 11 --------------------------------------------
|
45
|
+
|
46
|
+
# VALOR ENERGÉTICO DEL MENU
|
47
|
+
def valor_energetico_menu(menu)
|
48
|
+
sum = 0
|
49
|
+
for etiqueta in menu do
|
50
|
+
sum += etiqueta.valor_energetico[0]
|
51
|
+
end
|
52
|
+
sum = (sum*100).round() / 100.0
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
# VALOR ENERGÉTICO DE UNA VALORACIÓN NUTRICIONAL DE UN INDIVIDUO
|
57
|
+
def gasto_energetico_total_(persona)
|
58
|
+
gasto_total = gasto_actividad_fisica(persona.peso, persona.talla, persona.edad, persona.sexo, persona.factor) + gasto_basal(persona.peso, persona.talla, persona.edad, persona.sexo) + efecto_termogeno(persona.peso, persona.talla, persona.edad, persona.sexo)
|
59
|
+
gasto_total = (gasto_total*100).round() / 100.0
|
60
|
+
end
|
61
|
+
|
62
|
+
def swap(arr, a,b)
|
63
|
+
temp = arr[a]
|
64
|
+
arr[a] = arr[b]
|
65
|
+
arr[b] = temp
|
66
|
+
end
|
67
|
+
|
68
|
+
def obtener_array_sort(arr_menu, list_val)
|
69
|
+
Benchmark.bm do |x|
|
70
|
+
x.report{
|
71
|
+
arr_total = []
|
72
|
+
arr_menu.each {|menu| arr_total.push(valor_energetico_menu(menu))}
|
73
|
+
list_val.each {|nodo| arr_total.push(gasto_energetico_total_(nodo))}
|
74
|
+
|
75
|
+
arr_total.sort
|
76
|
+
} end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
def obtener_array_each(arr_menu, list_val)
|
81
|
+
Benchmark.bm do |x|
|
82
|
+
x.report{
|
83
|
+
arr_total = []
|
84
|
+
|
85
|
+
arr_menu.each {|menu| arr_total.push(valor_energetico_menu(menu))}
|
86
|
+
list_val.each {|nodo| arr_total.push(gasto_energetico_total_(nodo))}
|
87
|
+
|
88
|
+
i = 0
|
89
|
+
arr_total.each do
|
90
|
+
j = i
|
91
|
+
min = arr_total[j]
|
92
|
+
min_pos = i
|
93
|
+
actual = arr_total[j]
|
94
|
+
|
95
|
+
while (j < arr_total.length) do
|
96
|
+
if (arr_total[j] < min)
|
97
|
+
min = arr_total[j]
|
98
|
+
min_pos = j
|
99
|
+
end
|
100
|
+
j += 1
|
101
|
+
end
|
102
|
+
|
103
|
+
if (min != actual)
|
104
|
+
swap(arr_total, min_pos, i)
|
105
|
+
end
|
106
|
+
|
107
|
+
i += 1
|
108
|
+
end
|
109
|
+
arr_total
|
110
|
+
}end
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
def obtener_array_for(arr_menu, list_val)
|
115
|
+
Benchmark.bm do |x|
|
116
|
+
x.report{
|
117
|
+
arr_total = []
|
118
|
+
|
119
|
+
# Insertamos en el array el contenido del valor energético de cada menú.
|
120
|
+
for i in arr_menu do
|
121
|
+
val_energetico = valor_energetico_menu(i)
|
122
|
+
arr_total.push(val_energetico)
|
123
|
+
end
|
124
|
+
|
125
|
+
# Insertamos en el array el contenido del gasto energético total de cada individuo.
|
126
|
+
for i in list_val do
|
127
|
+
arr_total.push(gasto_energetico_total_(i))
|
128
|
+
end
|
129
|
+
|
130
|
+
i = 0
|
131
|
+
for element in arr_total do
|
132
|
+
|
133
|
+
j = i
|
134
|
+
min = arr_total[j]
|
135
|
+
min_pos = i
|
136
|
+
actual = arr_total[j]
|
137
|
+
|
138
|
+
while (j < arr_total.length) do
|
139
|
+
if (arr_total[j] < min)
|
140
|
+
min = arr_total[j]
|
141
|
+
min_pos = j
|
142
|
+
end
|
143
|
+
j += 1
|
144
|
+
end
|
145
|
+
|
146
|
+
if (min != actual)
|
147
|
+
swap(arr_total, min_pos, i)
|
148
|
+
end
|
149
|
+
|
150
|
+
i += 1
|
151
|
+
end
|
152
|
+
|
153
|
+
arr_total
|
154
|
+
}end
|
155
|
+
end
|
156
|
+
|
157
|
+
|
158
|
+
# Código para poder visualizar los valores del benchmark
|
159
|
+
=begin
|
160
|
+
registro1 = Registro.new("Adrian", 80, 168, 20, 0, 132.3 , 122.3, 140.3 , 12.3 , 15.2, 11.4, 10.5,0.12)
|
161
|
+
registro2 = Registro.new("Gamma", 120, 190, 32, 0, 132.3 , 122.3, 140.3 , 12.3 , 15.2, 11.4, 10.5, 0.0)
|
162
|
+
registro3 = Registro.new("Beta", 60, 156, 45, 1, 132.3 , 122.3, 140.3 , 12.3 , 15.2, 11.4, 10.5, 0.12)
|
163
|
+
registro4 = Registro.new("Alpha", 76, 175, 18, 0, 132.3 , 122.3, 140.3 , 12.3 , 15.2, 11.4, 10.5, 0.27)
|
164
|
+
registro5 = Registro.new("Umma", 245, 180, 56, 1, 132.3 , 122.3, 140.3 , 12.3 , 15.2, 11.4, 10.5, 0.27)
|
165
|
+
registro6 = Registro.new("Pepe", 120, 198, 45, 0, 132.3 , 122.3, 140.3 , 12.3 , 15.2, 11.4, 10.5, 0.54)
|
166
|
+
registro7 = Registro.new("Jose", 80, 170, 56, 0, 132.3 , 122.3, 140.3 , 12.3 , 15.2, 11.4, 10.5, 0.0)
|
167
|
+
registro8 = Registro.new("Juan", 60, 170, 25, 0, 132.3 , 122.3, 140.3 , 12.3 , 15.2, 11.4, 10.5, 0.12)
|
168
|
+
registro9 = Registro.new("Francisco", 76, 175, 60, 0, 132.3 , 122.3, 140.3 , 12.3 , 15.2, 11.4, 10.5, 0.12)
|
169
|
+
registro10 = Registro.new("Mac", 100, 180, 28, 0, 132.3 , 122.3, 140.3 , 12.3 , 15.2, 11.4, 10.5, 0.27)
|
170
|
+
|
171
|
+
|
172
|
+
etiqueta1 = Etiqueta.new([120.24, 572.76], [17.3,10,12], [41.2,4.15,5.12], 3.3 , 2.4, 1.2, 0, false, 0, 0)
|
173
|
+
etiqueta2 = Etiqueta.new([1000, 572.76], [17.3,10,12], [41.2,4.15,5.12], 3.3 , 2.4, 1.2, 0, false, 0, 0)
|
174
|
+
etiqueta3 = Etiqueta.new([1023.24, 572.76], [17.3,10,12], [41.2,4.15,5.12], 3.3 , 2.4, 1.2, 0, false, 0, 0)
|
175
|
+
etiqueta4 = Etiqueta.new([224.4, 572.76], [17.3,10,12], [41.2,4.15,5.12], 3.3 , 2.4, 1.2, 0, false, 0, 0)
|
176
|
+
etiqueta5 = Etiqueta.new([523.2, 572.76], [17.3,10,12], [41.2,4.15,5.12], 3.3 , 2.4, 1.2, 0, false, 0, 0)
|
177
|
+
etiqueta6 = Etiqueta.new([670.53, 572.76], [17.3,10,12], [41.2,4.15,5.12], 3.3 , 2.4, 1.2, 0, false, 0, 0)
|
178
|
+
|
179
|
+
menu1 = [etiqueta1,etiqueta2,etiqueta3] # 2143.48 kcal
|
180
|
+
menu2 = [etiqueta1,etiqueta2,etiqueta5] # 1643.44 kcal
|
181
|
+
menu3 = [etiqueta2,etiqueta3,etiqueta4,etiqueta6] # 2918.17
|
182
|
+
menu4 = [etiqueta1,etiqueta3,etiqueta6]
|
183
|
+
menu5 = [etiqueta4,etiqueta2,etiqueta5,etiqueta1]
|
184
|
+
menu6 = [etiqueta4,etiqueta3,etiqueta6]
|
185
|
+
menu7 = [etiqueta2,etiqueta1,etiqueta5,etiqueta3]
|
186
|
+
menu8 = [etiqueta4,etiqueta2,etiqueta5,etiqueta1,etiqueta3]
|
187
|
+
menu9 = [etiqueta2,etiqueta1]
|
188
|
+
menu10 = [etiqueta4,etiqueta6,etiqueta5,etiqueta3]
|
189
|
+
|
190
|
+
arr_menu = [menu1,menu2,menu3,menu4,menu5,menu6,menu7,menu8,menu9,menu10]
|
191
|
+
lista_val = List.new()
|
192
|
+
lista_val.push_back(registro1)
|
193
|
+
lista_val.push_back(registro2)
|
194
|
+
lista_val.push_back(registro3)
|
195
|
+
lista_val.push_back(registro4)
|
196
|
+
lista_val.push_back(registro5)
|
197
|
+
lista_val.push_back(registro6)
|
198
|
+
lista_val.push_back(registro7)
|
199
|
+
lista_val.push_back(registro8)
|
200
|
+
lista_val.push_back(registro9)
|
201
|
+
lista_val.push_back(registro10)
|
202
|
+
|
203
|
+
|
204
|
+
total_arr = obtener_array_sort(arr_menu, lista_val)
|
205
|
+
total_arr = obtener_array_each(arr_menu, lista_val)
|
206
|
+
total_arr = obtener_array_for(arr_menu, lista_val)
|
207
|
+
|
208
|
+
=end
|
@@ -0,0 +1,167 @@
|
|
1
|
+
|
2
|
+
class Registro
|
3
|
+
include Comparable
|
4
|
+
attr_reader :nombre, :peso, :talla, :edad, :sexo, :cir_cintura, :cir_cadera, :cir_brazo, :pl_tricipital, :pl_bicipital, :pl_subescapular, :pl_suprailiaco, :imc, :factor
|
5
|
+
|
6
|
+
# @param [Registro] recibe como parámetro otra instancia de la clase Registro con la que va a compararse
|
7
|
+
# @return [Number] retorna -1,0 o 1.
|
8
|
+
def <=>(anOther)
|
9
|
+
@imc <=> anOther.imc
|
10
|
+
end
|
11
|
+
|
12
|
+
# @param nombre [number] nombre del paciente.
|
13
|
+
# @param peso [number] peso del paciente.
|
14
|
+
# @param talla [number] altura del paciente en metros.
|
15
|
+
# @param edad [number] edad del paciente.
|
16
|
+
# @param sexo [number] sexo del paciente, 0 corresponde a hombre y 1 a mujer.
|
17
|
+
# @param cir_cintura [Number] circunferencia de la cintura del paciente.
|
18
|
+
# @param cir_cadera [Number] circunferencia de la cadera del paciente.
|
19
|
+
# @param cir_brazo [Number] circunferencia del brazo del paciente.
|
20
|
+
# @param pl_tricipital [Number] longitud del pliege tricipital del pariente.
|
21
|
+
# @param pl_bicipital [Number] longitud del pliege bicipital del pariente.
|
22
|
+
# @param pl_subescapular [Number] longitud del pliege subescapular del pariente.
|
23
|
+
# @param pl_suprailiaco [Number] longitud del pliege suprailiaco del pariente.
|
24
|
+
# @return [Paciente_Obeso] retorna una instancia de la clase Registro.
|
25
|
+
def initialize(nombre, peso, talla, edad, sexo, cir_cintura = nil, cir_cadera = nil, cir_brazo = nil, pl_tricipital = nil, pl_bicipital = nil, pl_subescapular = nil, pl_suprailiaco = nil, factor= nil)
|
26
|
+
@nombre = nombre
|
27
|
+
@peso = peso
|
28
|
+
@talla = talla
|
29
|
+
@edad = edad
|
30
|
+
@sexo = sexo
|
31
|
+
@cir_cintura = cir_cintura
|
32
|
+
@cir_cadera = cir_cadera
|
33
|
+
@cir_brazo = cir_brazo
|
34
|
+
@pl_tricipital = pl_tricipital
|
35
|
+
@pl_bicipital = pl_bicipital
|
36
|
+
@pl_subescapular = pl_subescapular
|
37
|
+
@pl_suprailiaco = pl_suprailiaco
|
38
|
+
@factor = factor
|
39
|
+
@imc = self.calcular_imc
|
40
|
+
end
|
41
|
+
|
42
|
+
# @return [Number] retorna el índice de masa corporal.
|
43
|
+
def calcular_imc
|
44
|
+
imc = @peso / (@talla * @talla)
|
45
|
+
imc = (imc * 100).round() / 100.0
|
46
|
+
end
|
47
|
+
|
48
|
+
# @return [Number] retorna el porcentaje de grasas.
|
49
|
+
def calcular_pctj_grasa
|
50
|
+
pctj_grasa = (1.2 * self.calcular_imc()) + (0.23 * @edad) - (10.9 * @sexo) - 5.4
|
51
|
+
pctj_grasa = (pctj_grasa*100).round() / 100.0
|
52
|
+
end
|
53
|
+
|
54
|
+
# @return [Number] retorna el rcc.
|
55
|
+
def calcular_rcc
|
56
|
+
cir_cintura = calcular_media(@cir_cintura)
|
57
|
+
cir_cadera = calcular_media(@cir_cadera)
|
58
|
+
rcc = cir_cintura / cir_cadera
|
59
|
+
rcc = (rcc * 100).round() / 100.0
|
60
|
+
end
|
61
|
+
|
62
|
+
# @return [String] retorna una cadena donde se evalúa el índice de masa corporal.
|
63
|
+
def evaluar_imc
|
64
|
+
|
65
|
+
imc = calcular_imc()
|
66
|
+
|
67
|
+
if (imc < 18.5)
|
68
|
+
puts "IMG menor que 18.5, según la OMS bajo peso, popularmente asociamos a las personas con este índice como Aceptables."
|
69
|
+
elsif (18.5 < imc && imc < 24.9)
|
70
|
+
puts "IMC entre 18.5 y 24.5, según la OMS un índice adecuado, popularmente asociamos a las personas con este índice como Aceptables."
|
71
|
+
elsif (25.0 < imc && imc < 29.9)
|
72
|
+
puts "IMC entre 25.0 y 29.9, según la OMS un índice de sobrepeso, popularmente asociamos a las personas con este índice como con sobrepeso."
|
73
|
+
elsif (30.0 < imc && imc < 34.9)
|
74
|
+
puts "IMC entre 30.0 y 34.9, según la OMS un índice de Obesidad grado 1, popularmente asociamos a las personas con este índice como obesas."
|
75
|
+
elsif (35.0 < imc && imc < 39.9)
|
76
|
+
puts "IMC entre 35.0 y 39.9, según la OMS un índice de Obesidad grado 2, popularmente asociamos a las personas con este índice como obesas."
|
77
|
+
elsif (imc > 40)
|
78
|
+
puts "IMC mayor de 40, según la OMS un índice de Obesidad grado 2, popularmente asociamos a las personas con este índice como obesas."
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
# @return [String] retorna una cadena donde se evalúa el rcc.
|
84
|
+
def evaluar_rcc
|
85
|
+
|
86
|
+
rcc = calcular_rcc()
|
87
|
+
|
88
|
+
case @sexo
|
89
|
+
when 0
|
90
|
+
if (0.72 < rcc && rcc < 0.75)
|
91
|
+
puts "RCC entre 0.72 y 0.75 conlleva un riesgo bajo para una mujer"
|
92
|
+
elsif (0.78 < rcc && rcc < 0.82)
|
93
|
+
puts "RCC entre 0.78 y 0.82 conlleva un riesgo moderado para una mujer"
|
94
|
+
elsif (rcc > 0.82)
|
95
|
+
puts "RCC mayor que 0.82, conlleva un riesgo alto para una mujer"
|
96
|
+
end
|
97
|
+
when 1
|
98
|
+
if (0.83 < rcc && rcc < 0.88)
|
99
|
+
puts "RCC entre 0.83 y 0.88 conlleva un riesgo bajo para un hombre"
|
100
|
+
elsif (0.88 < rcc && rcc < 0.95)
|
101
|
+
puts "RCC entre 0.88 y 0.95 conlleva un riesgo moderado para un hombre"
|
102
|
+
elsif (0.95 < rcc && rcc < 1.01)
|
103
|
+
puts "RCC entre 0.95 y 1.01 conlleva un riesgo alto para un hombre"
|
104
|
+
elsif (rcc > 1.01)
|
105
|
+
puts "RCC mayor de 1.01 conlleva un riesgo muy alto para un hombre"
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# @return [Number] calcula la media de los datos.
|
111
|
+
def calcular_media(datos_)
|
112
|
+
|
113
|
+
mean = 0.0
|
114
|
+
datos_.each{ |x| mean = mean + x }
|
115
|
+
mean /= datos_.length
|
116
|
+
mean = ( mean * 100).round() / 100.0
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
# @return [String] muestra la información del registro.
|
121
|
+
def mostrar_info()
|
122
|
+
|
123
|
+
print("Nombre: ", @nombre)
|
124
|
+
puts " "
|
125
|
+
print("Peso: ", @peso)
|
126
|
+
puts " "
|
127
|
+
print("Talla: ", @talla)
|
128
|
+
puts " "
|
129
|
+
print("Edad: ", @edad)
|
130
|
+
puts " "
|
131
|
+
print("Sexo: ", @nombre)
|
132
|
+
puts " "
|
133
|
+
|
134
|
+
print("Circunferencia de la cintura: ", @cir_cintura)
|
135
|
+
puts " "
|
136
|
+
puts "Media: %0.2f" %[calcular_media(@cir_cintura)]
|
137
|
+
|
138
|
+
print("Circunferencia de la cadera: ", @cir_cadera)
|
139
|
+
puts " "
|
140
|
+
puts "Media: %0.2f" %[calcular_media(@cir_cadera)]
|
141
|
+
|
142
|
+
print("Circunferencia del brazo: ", @cir_brazo)
|
143
|
+
puts " "
|
144
|
+
puts "Media: %0.2f" %[calcular_media(@cir_brazo)]
|
145
|
+
|
146
|
+
print("Pliegue tricipital ", @pl_tricipital)
|
147
|
+
puts " "
|
148
|
+
puts "Media: %0.2f" %[calcular_media(@pl_tricipital)]
|
149
|
+
|
150
|
+
print("Pliegue bicicipital ", @pl_bicipital)
|
151
|
+
puts " "
|
152
|
+
puts "Media: %0.2f" %[calcular_media(@pl_bicipital)]
|
153
|
+
|
154
|
+
print("Pliegue subescapular ", @pl_subescapular)
|
155
|
+
puts " "
|
156
|
+
puts "Media: %0.2f" %[calcular_media(@pl_subescapular)]
|
157
|
+
|
158
|
+
print("Pliegue suprailiaco ", @pl_suprailiaco)
|
159
|
+
puts " "
|
160
|
+
puts "Media: %0.2f" %[calcular_media(@pl_suprailiaco)]
|
161
|
+
|
162
|
+
evaluar_imc()
|
163
|
+
evaluar_rcc()
|
164
|
+
|
165
|
+
end
|
166
|
+
|
167
|
+
end
|
data/practica6.gemspec
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "practica6/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "alu0101028163"
|
8
|
+
spec.version = Practica6::VERSION
|
9
|
+
spec.authors = ["alu0101028163"]
|
10
|
+
spec.email = ["alu0101028163@ull.edu.es"]
|
11
|
+
|
12
|
+
spec.summary = %q{Práctica 6 de Lenguajes y paradigmas de programación}
|
13
|
+
spec.description = %q{Práctica 6 de Lenguajes y paradigmas de programación utilizando TDD}
|
14
|
+
spec.homepage = 'http://rubygems.org/gems/alu0101028163'
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
21
|
+
|
22
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
23
|
+
spec.metadata["source_code_uri"] = " "
|
24
|
+
spec.metadata["changelog_uri"] = " "
|
25
|
+
else
|
26
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
27
|
+
"public gem pushes."
|
28
|
+
end
|
29
|
+
|
30
|
+
# Specify which files should be added to the gem when it is released.
|
31
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
32
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
33
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
|
+
end
|
35
|
+
spec.bindir = "exe"
|
36
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
37
|
+
spec.require_paths = ["lib"]
|
38
|
+
|
39
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
40
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
41
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
42
|
+
spec.add_development_dependency "guard"
|
43
|
+
spec.add_development_dependency "guard-rspec"
|
44
|
+
spec.add_development_dependency "guard-bundler"
|
45
|
+
spec.add_development_dependency "coveralls"
|
46
|
+
end
|