jsprac 0.3.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.
Files changed (62) hide show
  1. checksums.yaml +7 -0
  2. data/.bundle/config +2 -0
  3. data/.rspec +2 -0
  4. data/.yardoc/checksums +5 -0
  5. data/.yardoc/complete +0 -0
  6. data/.yardoc/object_types +0 -0
  7. data/.yardoc/objects/root.dat +0 -0
  8. data/.yardoc/proxy_types +0 -0
  9. data/Gemfile +7 -0
  10. data/Gemfile.lock +80 -0
  11. data/Guardfile +82 -0
  12. data/LICENSE.txt +21 -0
  13. data/README.md +1 -0
  14. data/Rakefile +6 -0
  15. data/bin/_guard-core +17 -0
  16. data/bin/bundler +17 -0
  17. data/bin/coderay +17 -0
  18. data/bin/console +14 -0
  19. data/bin/guard +17 -0
  20. data/bin/htmldiff +17 -0
  21. data/bin/ldiff +17 -0
  22. data/bin/listen +17 -0
  23. data/bin/pry +17 -0
  24. data/bin/rake +17 -0
  25. data/bin/rspec +17 -0
  26. data/bin/setup +8 -0
  27. data/bin/thor +17 -0
  28. data/doc/Alimentos.html +368 -0
  29. data/doc/Diet.html +916 -0
  30. data/doc/Edad.html +368 -0
  31. data/doc/List.html +764 -0
  32. data/doc/Node.html +411 -0
  33. data/doc/Prct06.html +117 -0
  34. data/doc/_index.html +174 -0
  35. data/doc/class_list.html +51 -0
  36. data/doc/css/common.css +1 -0
  37. data/doc/css/full_list.css +58 -0
  38. data/doc/css/style.css +481 -0
  39. data/doc/file.README.html +74 -0
  40. data/doc/file_list.html +56 -0
  41. data/doc/frames.html +17 -0
  42. data/doc/index.html +74 -0
  43. data/doc/js/app.js +243 -0
  44. data/doc/js/full_list.js +216 -0
  45. data/doc/js/jquery.js +4 -0
  46. data/doc/method_list.html +291 -0
  47. data/doc/top-level-namespace.html +114 -0
  48. data/lib/prct06/.prct06menu.rb.swp +0 -0
  49. data/lib/prct06/.yardoc/checksums +0 -0
  50. data/lib/prct06/.yardoc/complete +0 -0
  51. data/lib/prct06/.yardoc/object_types +0 -0
  52. data/lib/prct06/.yardoc/objects/root.dat +0 -0
  53. data/lib/prct06/.yardoc/proxy_types +0 -0
  54. data/lib/prct06/menualimentos.rb +13 -0
  55. data/lib/prct06/menuedad.rb +13 -0
  56. data/lib/prct06/prct06.rb +50 -0
  57. data/lib/prct06/prct06menu.rb +56 -0
  58. data/lib/prct06/version.rb +3 -0
  59. data/pkg/jsprac-0.1.0.gem +0 -0
  60. data/pkg/prct06-0.1.0.gem +0 -0
  61. data/prct06.gemspec +40 -0
  62. metadata +189 -0
@@ -0,0 +1,114 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.9.5
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index</a> &raquo;
40
+
41
+
42
+ <span class="title">Top Level Namespace</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <iframe id="search_frame" src="class_list.html"></iframe>
63
+
64
+ <div id="content"><h1>Top Level Namespace
65
+
66
+
67
+
68
+ </h1>
69
+ <div class="box_info">
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ </div>
82
+
83
+ <h2>Defined Under Namespace</h2>
84
+ <p class="children">
85
+
86
+
87
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Prct06.html" title="Prct06 (module)">Prct06</a></span>
88
+
89
+
90
+
91
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Alimentos.html" title="Alimentos (class)">Alimentos</a></span>, <span class='object_link'><a href="Diet.html" title="Diet (class)">Diet</a></span>, <span class='object_link'><a href="Edad.html" title="Edad (class)">Edad</a></span>, <span class='object_link'><a href="List.html" title="List (class)">List</a></span>, <span class='object_link'><a href="Node.html" title="Node (class)">Node</a></span>
92
+
93
+
94
+ </p>
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+ </div>
105
+
106
+ <div id="footer">
107
+ Generated on Tue Nov 22 18:46:04 2016 by
108
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
109
+ 0.9.5 (ruby-2.3.0).
110
+ </div>
111
+
112
+ </div>
113
+ </body>
114
+ </html>
File without changes
File without changes
@@ -0,0 +1,13 @@
1
+ require "prct06/version"
2
+ class Alimentos < Diet
3
+ attr_accessor :alimentos
4
+ def initialize(alimentos,ttl,dip,vct,pprtn,pfts,pchdt)
5
+ @alimentos = alimentos
6
+ super(ttl, dip, vct, pprtn, pfts, pchdt)
7
+ end
8
+ def to_s
9
+ a = ""
10
+ a << "-#{@alimentos}\n"
11
+ a << super
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require "prct06/version"
2
+ class Edad < Diet
3
+ attr_accessor :edad
4
+ def initialize (edad,ttl,dip,vct,pprtn,pfts,pchdt)
5
+ @edad = edad
6
+ super(ttl,dip,vct,pprtn,pfts,pchdt)
7
+ end
8
+ def to_s
9
+ a = ""
10
+ a << "#{@edad}\n"
11
+ a << super
12
+ end
13
+ end
@@ -0,0 +1,50 @@
1
+ require "prct06/version"
2
+ #create a Struct with :value and :next
3
+ Node = Struct.new(:value, :next, :before)
4
+ class List
5
+ include Enumerable
6
+ include Comparable
7
+ attr_accessor :cabeza
8
+ attr_accessor :cola
9
+ def initialize(inicio=nil)
10
+ @cola = @cabeza = Node.new(inicio) if inicio
11
+ end
12
+
13
+ def add(value)
14
+ node = Node.new(value)
15
+ node.next = @cabeza
16
+ @cabeza.before = node
17
+
18
+ @cabeza = node
19
+ end
20
+
21
+ def add_from_tail(value)
22
+ node = Node.new(value)
23
+ node.before = @cola
24
+ @cola.next = node
25
+
26
+ @cola = node
27
+ end
28
+
29
+ def remove
30
+ @cabeza = @cabeza.next
31
+ end
32
+
33
+ def remove_from_tail
34
+ @cola = @cola.before
35
+ @cola.next = nil
36
+ end
37
+ def to_s
38
+ while @cabeza != nil do
39
+ puts @cabeza.value
40
+ remove()
41
+ end
42
+ end
43
+ def each
44
+ aux = @cabeza
45
+ while aux != nil do
46
+ yield aux.value
47
+ aux = aux.next
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,56 @@
1
+ require "prct06/version"
2
+ class Diet
3
+ #Declaración de los métodos de escritura
4
+ #y lectura para todas las variable de la clase
5
+ include Comparable
6
+ attr_accessor :ttl #Título
7
+ attr_accessor :tag #Etiqueta
8
+ attr_accessor :dip #Ingesta Diaria
9
+ attr_accessor :vct #Valor calorífico Total
10
+ attr_accessor :rcps #Array de platos
11
+ attr_accessor :pprtn #Porcentaje de proteínas
12
+ attr_accessor :pfts #Porcentaje de grasas
13
+ attr_accessor :pchdt #Porcentaje de hidratos de carbono
14
+ def initialize(tag, &block)
15
+ self.tag = tag
16
+ @rcps = Array.new #Array de platos
17
+ instance_eval &block
18
+ end
19
+ #Con este método añadimos en el array un nuevo plato
20
+ #siguiendo el formato predefinido.
21
+ def new_recipe(dstn,ptn,dig)
22
+ tmp = "- #{dstn}, #{ptn} unidades, #{dig} g\n"
23
+ rcps << tmp
24
+ end
25
+
26
+ def <=> otra_dieta
27
+ self.vct <=> otra_dieta.vct
28
+ end
29
+
30
+ def to_s
31
+ mostrar = ""
32
+ mostrar << "\n\n#{@ttl} (#{@dip} %)\n"
33
+ for i in 0..(@rcps.length-1)
34
+ mostrar << "- #{@rcps[i]}\n"
35
+ end
36
+ mostrar << "V.C.T | % #{@vct} kcal | #{@pprtn}% - #{@pfts}% - #{@pchdt}%\n\n"
37
+ end
38
+ def titulo (name)
39
+ @ttl=name
40
+ end
41
+ def ingesta (options = {})
42
+ @dip="(#{options[:min]},#{options[:max]})"
43
+ end
44
+ def plato (options = {})
45
+ rcps << "(#{options[:descripcion]})"
46
+ rcps << "(#{options[:porcion]})"
47
+ rcps << "(#{options[:gramos]})"
48
+ end
49
+ def porcentajes (options = {})
50
+ @vct="(#{options[:vct]})"
51
+ @pprtn="(#{options[:proteinas]})"
52
+ @pfts="(#{options[:grasas]})"
53
+ @pchdt="(#{options[:hidratos]})"
54
+ end
55
+
56
+ end
@@ -0,0 +1,3 @@
1
+ module Prct06
2
+ VERSION = "0.3.0"
3
+ end
Binary file
Binary file
@@ -0,0 +1,40 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'prct06/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "jsprac"
8
+ spec.version = Prct06::VERSION
9
+ spec.authors = ["alu0100893755"]
10
+ spec.email = ["alu0100893755@ull.edu.es"]
11
+
12
+ spec.summary = %q{Clase Ruby para representar y gestionar listas enlazadas}
13
+ spec.description = %q{Se abordara ́ la implementacio ́n de una estructura de datos mediante una lista enlazada.}
14
+ spec.homepage = "https://github.com/ULL-ESIT-LPP-1617/menu-dietetico-alu0100893755"
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'] = "TODO: Set to 'http://mygemserver.com'"
21
+ #else
22
+ # raise "RubyGems 2.0 or newer is required to protect against " \
23
+ # "public gem pushes."
24
+ #end
25
+
26
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
+ f.match(%r{^(test|spec|features)/})
28
+ end
29
+ spec.bindir = "exe"
30
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+
33
+
34
+ spec.add_development_dependency "guard"
35
+ spec.add_development_dependency "guard-rspec"
36
+ spec.add_development_dependency "guard-bundler"
37
+ spec.add_development_dependency "bundler", "~> 1.13"
38
+ spec.add_development_dependency "rake", "~> 10.0"
39
+ spec.add_development_dependency "rspec", "~> 3.0"
40
+ end
metadata ADDED
@@ -0,0 +1,189 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jsprac
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - alu0100893755
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: guard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard-rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: guard-bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.13'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.13'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ description: Se abordara ́ la implementacio ́n de una estructura de datos mediante
98
+ una lista enlazada.
99
+ email:
100
+ - alu0100893755@ull.edu.es
101
+ executables: []
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - ".bundle/config"
106
+ - ".rspec"
107
+ - ".yardoc/checksums"
108
+ - ".yardoc/complete"
109
+ - ".yardoc/object_types"
110
+ - ".yardoc/objects/root.dat"
111
+ - ".yardoc/proxy_types"
112
+ - Gemfile
113
+ - Gemfile.lock
114
+ - Guardfile
115
+ - LICENSE.txt
116
+ - README.md
117
+ - Rakefile
118
+ - bin/_guard-core
119
+ - bin/bundler
120
+ - bin/coderay
121
+ - bin/console
122
+ - bin/guard
123
+ - bin/htmldiff
124
+ - bin/ldiff
125
+ - bin/listen
126
+ - bin/pry
127
+ - bin/rake
128
+ - bin/rspec
129
+ - bin/setup
130
+ - bin/thor
131
+ - doc/Alimentos.html
132
+ - doc/Diet.html
133
+ - doc/Edad.html
134
+ - doc/List.html
135
+ - doc/Node.html
136
+ - doc/Prct06.html
137
+ - doc/_index.html
138
+ - doc/class_list.html
139
+ - doc/css/common.css
140
+ - doc/css/full_list.css
141
+ - doc/css/style.css
142
+ - doc/file.README.html
143
+ - doc/file_list.html
144
+ - doc/frames.html
145
+ - doc/index.html
146
+ - doc/js/app.js
147
+ - doc/js/full_list.js
148
+ - doc/js/jquery.js
149
+ - doc/method_list.html
150
+ - doc/top-level-namespace.html
151
+ - lib/prct06/.prct06menu.rb.swp
152
+ - lib/prct06/.yardoc/checksums
153
+ - lib/prct06/.yardoc/complete
154
+ - lib/prct06/.yardoc/object_types
155
+ - lib/prct06/.yardoc/objects/root.dat
156
+ - lib/prct06/.yardoc/proxy_types
157
+ - lib/prct06/menualimentos.rb
158
+ - lib/prct06/menuedad.rb
159
+ - lib/prct06/prct06.rb
160
+ - lib/prct06/prct06menu.rb
161
+ - lib/prct06/version.rb
162
+ - pkg/jsprac-0.1.0.gem
163
+ - pkg/prct06-0.1.0.gem
164
+ - prct06.gemspec
165
+ homepage: https://github.com/ULL-ESIT-LPP-1617/menu-dietetico-alu0100893755
166
+ licenses:
167
+ - MIT
168
+ metadata: {}
169
+ post_install_message:
170
+ rdoc_options: []
171
+ require_paths:
172
+ - lib
173
+ required_ruby_version: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ required_rubygems_version: !ruby/object:Gem::Requirement
179
+ requirements:
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ requirements: []
184
+ rubyforge_project:
185
+ rubygems_version: 2.5.1
186
+ signing_key:
187
+ specification_version: 4
188
+ summary: Clase Ruby para representar y gestionar listas enlazadas
189
+ test_files: []