Alimento 0.1.0 → 30.30.30
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 +4 -4
- data/Alimento-0.1.0.gem +0 -0
- data/Alimento.gemspec +2 -6
- data/Gemfile +2 -0
- data/Rakefile +5 -62
- data/lib/Alimento.rb +2 -9
- data/lib/Alimento/alimentos.rb +9 -136
- data/lib/Alimento/version.rb +1 -1
- metadata +5 -84
- data/.coveralls.yml +0 -6
- data/.rake_tasks~ +0 -8
- data/Guardfile +0 -82
- data/docs/Alimentos.html +0 -1854
- data/docs/ListaDoble.html +0 -1236
- data/docs/Nodo.html +0 -398
- data/docs/_index.html +0 -133
- data/docs/class_list.html +0 -51
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -58
- data/docs/css/style.css +0 -492
- data/docs/file.README.html +0 -117
- data/docs/file_list.html +0 -56
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -117
- data/docs/js/app.js +0 -248
- data/docs/js/full_list.js +0 -216
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -299
- data/docs/top-level-namespace.html +0 -110
- data/lib/Alimento/glucemico.rb +0 -333
- data/lib/Alimento/lista_doble.rb +0 -155
- data/lib/Alimento/ordenacion.rb +0 -321
- data/lib/Alimento/tipo_alimento.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aadcb4c4d239e75c1927754b1e94bfeabac33990
|
4
|
+
data.tar.gz: ee6d5eed0540aed4e0b3b8d68e4c0f1df2451fc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1391cf5f14aa85dd518e054612f6bff576c98220cb29ec67020cca1d35b1fd2db5e8494cf7e0170b1ffacc996385ba3c97081e77197db33d3d8854551798ab4f
|
7
|
+
data.tar.gz: 2ed0f4a48a8a2393029d63107478a57a111c78e253a9006e44bf8f211c46480c553b662332e5f571c74a6ea1d1ac0a7d86e772df808967a6f20538bff329981a
|
data/Alimento-0.1.0.gem
ADDED
Binary file
|
data/Alimento.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Miguel Parra"]
|
10
10
|
spec.email = ["alu0100200393@ull.edu.es"]
|
11
11
|
|
12
|
-
spec.summary = %q{clase
|
13
|
-
spec.description = %q{
|
12
|
+
spec.summary = %q{clase para Alimentos}
|
13
|
+
spec.description = %q{en la clase Alimento se controla las calorias consumidas por un Alimento}
|
14
14
|
spec.homepage = "https://github.com/ULL-ESIT-LPP-1718/tdd-miguelpe83"
|
15
15
|
|
16
16
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
@@ -32,8 +32,4 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "bundler", "~> 1.15"
|
33
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
34
34
|
spec.add_development_dependency "rspec", "~> 3.0"
|
35
|
-
spec.add_development_dependency "guard"
|
36
|
-
spec.add_development_dependency "guard-rspec"
|
37
|
-
spec.add_development_dependency "guard-bundler"
|
38
|
-
spec.add_development_dependency "coveralls"
|
39
35
|
end
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -5,68 +5,11 @@ RSpec::Core::RakeTask.new(:spec)
|
|
5
5
|
|
6
6
|
task :default => :spec
|
7
7
|
|
8
|
-
desc "Ejecutar las espectativas de la clase
|
9
|
-
task :
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
|
14
|
-
desc "Ejecutar las espectativas de la clase tipo_alimento"
|
15
|
-
task :tipo do
|
16
|
-
sh "rspec -I. spec/Tipo_ali_spec.rb"
|
17
|
-
end
|
18
|
-
|
19
|
-
desc "Ejecutar las espectativas de la clase lista"
|
20
|
-
task :lista do
|
21
|
-
sh "rspec -I. spec/Lista_spec.rb"
|
22
|
-
end
|
23
|
-
|
24
|
-
desc "Ejecutar las espectativas de la clase lista"
|
25
|
-
task :gluce do
|
26
|
-
sh "rspec -I. spec/glucemico_spec.rb"
|
27
|
-
end
|
28
|
-
|
29
|
-
desc "Ejecutar las espectativas para la ordenacion"
|
30
|
-
task :orde do
|
31
|
-
sh "rspec -I. spec/Ordenacion_spec.rb"
|
32
|
-
end
|
33
|
-
|
34
|
-
desc "Ejecutar las espectativas para la ordenacion"
|
35
|
-
task :dsl do
|
36
|
-
sh "rspec -I. spec/dsl_spec.rb"
|
37
|
-
end
|
38
|
-
|
39
|
-
desc "Ejecutar las espectativas de la clase tipo_alimento"
|
40
|
-
task :desaali do
|
41
|
-
sh "ruby lib/Alimento/alimentos.rb"
|
42
|
-
end
|
43
|
-
|
44
|
-
desc "Ejecutar las espectativas de la clase tipo_alimento"
|
45
|
-
task :desalista do
|
46
|
-
sh "ruby lib/Alimento/lista_doble.rb"
|
47
|
-
end
|
48
|
-
|
49
|
-
desc "Ejecutar las espectativas de la clase tipo_alimento"
|
50
|
-
task :desagluce do
|
51
|
-
sh "ruby lib/Alimento/glucemico.rb"
|
52
|
-
end
|
53
|
-
desc "Ejecutar las espectativas de la clase tipo_alimento"
|
54
|
-
task :desaorde do
|
55
|
-
sh "ruby lib/Alimento/ordenacion.rb"
|
56
|
-
end
|
57
|
-
|
58
|
-
desc "Ejecutar fichero de dsl"
|
59
|
-
task :desadsl do
|
60
|
-
sh "ruby lib/Alimento/dsl.rb"
|
61
|
-
end
|
62
|
-
|
63
|
-
|
64
|
-
desc "Ejecutar la documentacion"
|
65
|
-
task :docu do
|
66
|
-
sh "yardoc --output-dir ./docs 'lib/Alimento/alimentos.rb' 'lib/Alimento/lista_doble.rb' - README LICENSE FAQ"
|
67
|
-
end
|
68
|
-
|
69
|
-
#
|
8
|
+
# desc "Ejecutar las espectativas de la clase Receta"
|
9
|
+
# task :spec do
|
10
|
+
# sh "rspec -I. spec/Alimento_spec.rb"
|
11
|
+
# end
|
12
|
+
#
|
70
13
|
# desc "Ejecutar con documentacion"
|
71
14
|
# task :doc do
|
72
15
|
# sh "rspec -I. spec/Alimento_spec.rb --format documentation"
|
data/lib/Alimento.rb
CHANGED
@@ -1,13 +1,6 @@
|
|
1
1
|
require "Alimento/version"
|
2
|
-
|
3
|
-
require "Alimento/tipo_alimento.rb"
|
4
|
-
require "Alimento/lista_doble.rb"
|
5
|
-
require "Alimento/glucemico.rb"
|
6
|
-
require "Alimento/ordenacion.rb"
|
7
|
-
require "Alimento/dsl.rb"
|
2
|
+
|
8
3
|
module Alimento
|
9
|
-
|
10
|
-
# require "Alimento/tipo_alimento.rb"
|
11
|
-
# require "Alimento/lista_doble.rb"
|
4
|
+
require "Alimento/alimentos.rb"
|
12
5
|
# Your code goes here...
|
13
6
|
end
|
data/lib/Alimento/alimentos.rb
CHANGED
@@ -1,33 +1,11 @@
|
|
1
1
|
#! /usr/local/rvm/rubies/ruby-2.1.1/bin/ruby
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
# @author Miguel Parra Esquivel (miguelpe83)
|
6
|
-
# @abstract
|
7
|
-
# @since 0.6.0
|
8
|
-
|
9
2
|
class Alimentos
|
10
|
-
include Comparable
|
11
|
-
|
12
|
-
# @return [String] objeto convertidos con el formato string de la descripcion de la clase
|
13
|
-
def self.description
|
14
|
-
"clase que muestra informacion de nutrientes de un Alimento"
|
15
|
-
end
|
16
3
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# @param glucidos [String] glucidos
|
23
|
-
# @param lipidos [String] lipidos
|
24
|
-
# @return [String] objeto convertidos con el formato string
|
25
|
-
|
26
|
-
#attr_accessor :nombre_ali , :proteinas , :glucidos , :lipidos
|
27
|
-
attr_writer :nombre_ali , :proteinas , :glucidos , :lipidos
|
28
|
-
attr_reader :nombre_ali , :proteinas , :glucidos , :lipidos
|
29
|
-
|
30
|
-
def initialize (nombre_ali,proteinas,glucidos,lipidos)
|
4
|
+
def self.description
|
5
|
+
"clase que muestra informacion de nutrientes de un Alimento"
|
6
|
+
end
|
7
|
+
attr_accessor :nombre_ali , :proteinas , :glucidos , :lipidos
|
8
|
+
def initialize (nombre_ali,proteinas,glucidos,lipidos)
|
31
9
|
@nombre_ali = nombre_ali
|
32
10
|
@proteinas = proteinas
|
33
11
|
@glucidos = glucidos
|
@@ -35,159 +13,54 @@ def initialize (nombre_ali,proteinas,glucidos,lipidos)
|
|
35
13
|
end
|
36
14
|
|
37
15
|
##### getter #######
|
38
|
-
|
39
|
-
# @param valor [String] nombre del alimentos
|
40
16
|
def get_nombre_ali (valor)
|
41
17
|
@nombre_ali = valor
|
42
18
|
end
|
43
19
|
|
44
|
-
# @param valor [String] proteinas
|
45
20
|
def get_proteinas (valor)
|
46
21
|
@proteinas = valor
|
47
22
|
end
|
48
|
-
|
49
|
-
# @param valor [String] glucidos
|
50
23
|
def get_glucidos (valor)
|
51
24
|
@glucidos = valor
|
52
25
|
end
|
53
|
-
|
54
|
-
# @param valor [String] lipidos
|
55
26
|
def get_lipidos (valor)
|
56
27
|
@glucidos = valor
|
57
28
|
end
|
58
29
|
|
59
30
|
###### metodo to_s ################
|
60
|
-
|
61
|
-
|
31
|
+
def nombre_ali_to_s
|
32
|
+
|
62
33
|
imprime = "#{@nombre_ali}" #número de porciones
|
63
34
|
return imprime
|
64
35
|
end
|
65
36
|
|
66
|
-
|
37
|
+
|
67
38
|
def proteinas_to_s
|
68
39
|
imprime = " #{@proteinas}" #número de porciones
|
69
40
|
return imprime
|
70
41
|
end
|
71
42
|
|
72
|
-
# @return [String] objeto convertidos con el formato string glucidos
|
73
43
|
def glucidos_to_s
|
74
44
|
imprime = " #{@glucidos}" #número de porciones
|
75
45
|
return imprime
|
76
46
|
end
|
77
47
|
|
78
|
-
# @return [String] objeto convertidos con el formato string lipidos
|
79
48
|
def lipidos_to_s
|
80
49
|
imprime = " #{@lipidos}" #número de porciones
|
81
50
|
return imprime
|
82
51
|
end
|
83
52
|
|
84
|
-
# @return [String] objeto convertidos con el formato string
|
85
53
|
def to_s
|
86
54
|
nombre_ali_to_s + proteinas_to_s + glucidos_to_s + lipidos_to_s
|
87
55
|
end
|
88
|
-
|
89
56
|
### calculo de calorias ###########
|
90
|
-
|
57
|
+
|
91
58
|
def calculo_calorias
|
92
59
|
result = 0
|
93
60
|
result = (@proteinas*4.0) + (@glucidos*4.0) + (@lipidos*9.0)
|
94
61
|
end
|
95
62
|
|
96
|
-
# @param other [String] hacerlo comparable el objeto con otro objeto del mismo tipo
|
97
|
-
# @return [String] objeto convertidos con el formato string
|
98
|
-
def <=> (other)
|
99
|
-
return nil unless other.instance_of? Alimentos
|
100
|
-
@nombre_ali <=> other.nombre_ali
|
101
|
-
@proteinas <=> other.proteinas
|
102
|
-
@glucidos <=> other.glucidos
|
103
|
-
@lipidos <=> other.lipidos
|
104
|
-
end
|
105
|
-
|
106
|
-
# def <=>(other)
|
107
|
-
# # los comentarios locales a los métodos no generan documentación
|
108
|
-
# return nil unless other.instance_of? Point
|
109
|
-
# @x**2 + @y**2 <=> other.x**2 + other.y**2
|
110
|
-
# end
|
111
|
-
|
112
|
-
#Tipeado pato
|
113
|
-
# def ==(other)
|
114
|
-
# if ((other.respond_to?tipo_ali) && (other.respond_to?proteinas)&& (other.respond_to?lipidos)&& (other.respond_to?glucidos)) then
|
115
|
-
# @tipo_ali == other.tipo_ali && @proteinas == other.proteinas && @lipidos == other.lipidos && @glucidos == other.glucidos
|
116
|
-
# end
|
117
|
-
# rescue
|
118
|
-
# false
|
119
|
-
# end
|
120
|
-
|
121
|
-
#Mas restrictivo (sin herencia - usa instance_of?)
|
122
|
-
# def ==(other)
|
123
|
-
# if other.instance_of?Alimentos
|
124
|
-
# @tipo_ali == other.tipo_ali && @proteinas == other.proteinas && @lipidos == other.lipidos && @glucidos == other.glucidos
|
125
|
-
# else
|
126
|
-
# false
|
127
|
-
# end
|
128
|
-
# end
|
129
|
-
|
130
|
-
def ==(other)
|
131
|
-
# los comentarios locales a los métodos no generan documentación
|
132
|
-
if other.is_a?Alimentos
|
133
|
-
@tipo_ali == other.tipo_ali && @proteinas == other.proteinas && @lipidos == other.lipidos && @glucidos == other.glucidos
|
134
|
-
else
|
135
|
-
false
|
136
|
-
end
|
137
|
-
end
|
138
|
-
############################################# OTRO CODIGO ###################################################3
|
139
|
-
# Tipeado pato
|
140
|
-
# def ==(other)
|
141
|
-
# if ((other.respond_to?x) && (other.respond_to?y)) then
|
142
|
-
# @x == other.x && @y == other.y
|
143
|
-
# end
|
144
|
-
# rescue
|
145
|
-
# false
|
146
|
-
# end
|
147
63
|
|
148
|
-
# Mas restrictivo (sin herencia - usa instance_of?)
|
149
|
-
# def ==(other)
|
150
|
-
# if other.instance_of?Point
|
151
|
-
# @x == other.x && @y == other.y
|
152
|
-
# else
|
153
|
-
# false
|
154
|
-
# end
|
155
|
-
# end
|
156
64
|
|
157
|
-
# Restrictivo (con herencia - usa is_a?)
|
158
|
-
# Se invalida porque el que proporciona el mix-in
|
159
|
-
# no distingue entre (1,0) y el (0,1)
|
160
|
-
# def ==(other)
|
161
|
-
# # los comentarios locales a los métodos no generan documentación
|
162
|
-
# if other.is_a?Point
|
163
|
-
# @x == other.x && @y == other.y
|
164
|
-
# else
|
165
|
-
# false
|
166
|
-
# end
|
167
|
-
# end
|
168
|
-
##mujer
|
169
|
-
# def <=>(other)
|
170
|
-
# if ((@autor <=> other.autor)==0)
|
171
|
-
# if((@titulo <=> other.titulo)==0)
|
172
|
-
# @fecha_publicacion <=> other.fecha_publicacion
|
173
|
-
# else
|
174
|
-
# @titulo <=> other.titulo
|
175
|
-
# end
|
176
|
-
# else
|
177
|
-
# @autor <=> other.autor
|
178
|
-
# end
|
179
|
-
# end
|
180
|
-
##josu
|
181
|
-
# def <=>(other)
|
182
|
-
# if((@autor <=> other.autor)==0)
|
183
|
-
# if ((@fecha_publicacion <=> other.fecha_publicacion)==0)
|
184
|
-
# @titulo <=> other.titulo
|
185
|
-
# else
|
186
|
-
# @fecha_publicacion <=> other.fecha_publicacion
|
187
|
-
# end
|
188
|
-
# else
|
189
|
-
# @autor <=> other.autor
|
190
|
-
# end
|
191
|
-
# end
|
192
65
|
|
193
66
|
end
|
data/lib/Alimento/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Alimento
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 30.30.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Parra
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,104 +52,25 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
|
56
|
-
name: guard
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: guard-rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: guard-bundler
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: coveralls
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
description: una clase con herencia y una lista doblemente enlazada
|
55
|
+
description: en la clase Alimento se controla las calorias consumidas por un Alimento
|
112
56
|
email:
|
113
57
|
- alu0100200393@ull.edu.es
|
114
58
|
executables: []
|
115
59
|
extensions: []
|
116
60
|
extra_rdoc_files: []
|
117
61
|
files:
|
118
|
-
- ".coveralls.yml"
|
119
62
|
- ".gitignore"
|
120
|
-
- ".rake_tasks~"
|
121
63
|
- ".rspec"
|
122
64
|
- ".travis.yml"
|
65
|
+
- Alimento-0.1.0.gem
|
123
66
|
- Alimento.gemspec
|
124
67
|
- Gemfile
|
125
|
-
- Guardfile
|
126
68
|
- README.md
|
127
69
|
- Rakefile
|
128
70
|
- bin/console
|
129
71
|
- bin/setup
|
130
|
-
- docs/Alimentos.html
|
131
|
-
- docs/ListaDoble.html
|
132
|
-
- docs/Nodo.html
|
133
|
-
- docs/_index.html
|
134
|
-
- docs/class_list.html
|
135
|
-
- docs/css/common.css
|
136
|
-
- docs/css/full_list.css
|
137
|
-
- docs/css/style.css
|
138
|
-
- docs/file.README.html
|
139
|
-
- docs/file_list.html
|
140
|
-
- docs/frames.html
|
141
|
-
- docs/index.html
|
142
|
-
- docs/js/app.js
|
143
|
-
- docs/js/full_list.js
|
144
|
-
- docs/js/jquery.js
|
145
|
-
- docs/method_list.html
|
146
|
-
- docs/top-level-namespace.html
|
147
72
|
- lib/Alimento.rb
|
148
73
|
- lib/Alimento/alimentos.rb
|
149
|
-
- lib/Alimento/glucemico.rb
|
150
|
-
- lib/Alimento/lista_doble.rb
|
151
|
-
- lib/Alimento/ordenacion.rb
|
152
|
-
- lib/Alimento/tipo_alimento.rb
|
153
74
|
- lib/Alimento/version.rb
|
154
75
|
homepage: https://github.com/ULL-ESIT-LPP-1718/tdd-miguelpe83
|
155
76
|
licenses: []
|
@@ -173,5 +94,5 @@ rubyforge_project:
|
|
173
94
|
rubygems_version: 2.5.2
|
174
95
|
signing_key:
|
175
96
|
specification_version: 4
|
176
|
-
summary: clase
|
97
|
+
summary: clase para Alimentos
|
177
98
|
test_files: []
|