tddAlimentos 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 +13 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +101 -0
- data/Guardfile +83 -0
- data/README.md +46 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/Alimento.html +428 -0
- data/docs/Gemfile.html +98 -0
- data/docs/Gemfile_lock.html +183 -0
- data/docs/Guardfile.html +166 -0
- data/docs/List.html +682 -0
- data/docs/Object.html +128 -0
- data/docs/Plato.html +607 -0
- data/docs/PlatoAmbiental.html +492 -0
- data/docs/README_md.html +126 -0
- data/docs/Rakefile.html +100 -0
- data/docs/TddAlimentos.html +110 -0
- data/docs/TddAlimentos/Error.html +103 -0
- data/docs/bin/setup.html +100 -0
- data/docs/created.rid +17 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +590 -0
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +117 -0
- data/docs/js/darkfish.js +161 -0
- data/docs/js/jquery.js +4 -0
- data/docs/js/navigation.js +141 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +109 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +307 -0
- data/docs/tddAlimentos_gemspec.html +133 -0
- data/lib/tddAlimentos.rb +12 -0
- data/lib/tddAlimentos/alimento.rb +56 -0
- data/lib/tddAlimentos/lista.rb +172 -0
- data/lib/tddAlimentos/menu.rb +51 -0
- data/lib/tddAlimentos/plato.rb +125 -0
- data/lib/tddAlimentos/platoAmbiental.rb +108 -0
- data/lib/tddAlimentos/platoDSL.rb +94 -0
- data/lib/tddAlimentos/version.rb +3 -0
- data/tddAlimentos.gemspec +39 -0
- metadata +249 -0
data/docs/Gemfile.html
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>Gemfile - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="file">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="./index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="project-metadata">
|
58
|
+
<div id="fileindex-section" class="nav-section">
|
59
|
+
<h3>Pages</h3>
|
60
|
+
|
61
|
+
<ul class="link-list">
|
62
|
+
|
63
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
64
|
+
|
65
|
+
<li><a href="./Gemfile_lock.html">Gemfile.lock</a>
|
66
|
+
|
67
|
+
<li><a href="./Guardfile.html">Guardfile</a>
|
68
|
+
|
69
|
+
<li><a href="./README_md.html">README</a>
|
70
|
+
|
71
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
72
|
+
|
73
|
+
<li><a href="./bin/setup.html">setup</a>
|
74
|
+
|
75
|
+
<li><a href="./tddAlimentos_gemspec.html">tddAlimentos.gemspec</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-label="Page Gemfile">
|
84
|
+
|
85
|
+
<p>source “<a href="https://rubygems.org">rubygems.org</a>”</p>
|
86
|
+
|
87
|
+
<p># Specify your gem's dependencies in <a href="tddAlimentos_gemspec.html">tddAlimentos.gemspec</a> gemspec</p>
|
88
|
+
|
89
|
+
</main>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<footer id="validator-badges" role="contentinfo">
|
94
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
95
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
|
96
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
97
|
+
</footer>
|
98
|
+
|
@@ -0,0 +1,183 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>Gemfile.lock - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="file">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="./index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="project-metadata">
|
58
|
+
<div id="fileindex-section" class="nav-section">
|
59
|
+
<h3>Pages</h3>
|
60
|
+
|
61
|
+
<ul class="link-list">
|
62
|
+
|
63
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
64
|
+
|
65
|
+
<li><a href="./Gemfile_lock.html">Gemfile.lock</a>
|
66
|
+
|
67
|
+
<li><a href="./Guardfile.html">Guardfile</a>
|
68
|
+
|
69
|
+
<li><a href="./README_md.html">README</a>
|
70
|
+
|
71
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
72
|
+
|
73
|
+
<li><a href="./bin/setup.html">setup</a>
|
74
|
+
|
75
|
+
<li><a href="./tddAlimentos_gemspec.html">tddAlimentos.gemspec</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-label="Page Gemfile.lock">
|
84
|
+
|
85
|
+
<p>PATH</p>
|
86
|
+
|
87
|
+
<pre>remote: .
|
88
|
+
specs:
|
89
|
+
tddAlimentos (0.1.0)</pre>
|
90
|
+
|
91
|
+
<p>GEM</p>
|
92
|
+
|
93
|
+
<pre>remote: https://rubygems.org/
|
94
|
+
specs:
|
95
|
+
coderay (1.1.2)
|
96
|
+
diff-lcs (1.3)
|
97
|
+
ffi (1.11.2)
|
98
|
+
formatador (0.2.5)
|
99
|
+
guard (2.16.1)
|
100
|
+
formatador (>= 0.2.4)
|
101
|
+
listen (>= 2.7, < 4.0)
|
102
|
+
lumberjack (>= 1.0.12, < 2.0)
|
103
|
+
nenv (~> 0.1)
|
104
|
+
notiffany (~> 0.0)
|
105
|
+
pry (>= 0.9.12)
|
106
|
+
shellany (~> 0.0)
|
107
|
+
thor (>= 0.18.1)
|
108
|
+
guard-bundler (2.2.1)
|
109
|
+
bundler (>= 1.3.0, < 3)
|
110
|
+
guard (~> 2.2)
|
111
|
+
guard-compat (~> 1.1)
|
112
|
+
guard-compat (1.2.1)
|
113
|
+
guard-rspec (4.7.3)
|
114
|
+
guard (~> 2.1)
|
115
|
+
guard-compat (~> 1.1)
|
116
|
+
rspec (>= 2.99.0, < 4.0)
|
117
|
+
listen (3.2.0)
|
118
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
119
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
120
|
+
lumberjack (1.0.13)
|
121
|
+
markup (0.1.3)
|
122
|
+
rdiscount (>= 1.3.5)
|
123
|
+
method_source (0.9.2)
|
124
|
+
nenv (0.3.0)
|
125
|
+
notiffany (0.1.3)
|
126
|
+
nenv (~> 0.1)
|
127
|
+
shellany (~> 0.0)
|
128
|
+
pry (0.12.2)
|
129
|
+
coderay (~> 1.1.0)
|
130
|
+
method_source (~> 0.9.0)
|
131
|
+
rake (10.5.0)
|
132
|
+
rb-fsevent (0.10.3)
|
133
|
+
rb-inotify (0.10.0)
|
134
|
+
ffi (~> 1.0)
|
135
|
+
rdiscount (2.2.0.1)
|
136
|
+
rdoc (6.1.0)
|
137
|
+
rspec (3.9.0)
|
138
|
+
rspec-core (~> 3.9.0)
|
139
|
+
rspec-expectations (~> 3.9.0)
|
140
|
+
rspec-mocks (~> 3.9.0)
|
141
|
+
rspec-core (3.9.0)
|
142
|
+
rspec-support (~> 3.9.0)
|
143
|
+
rspec-expectations (3.9.0)
|
144
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
145
|
+
rspec-support (~> 3.9.0)
|
146
|
+
rspec-mocks (3.9.0)
|
147
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
148
|
+
rspec-support (~> 3.9.0)
|
149
|
+
rspec-support (3.9.0)
|
150
|
+
shellany (0.0.1)
|
151
|
+
thor (0.20.3)</pre>
|
152
|
+
|
153
|
+
<p>PLATFORMS</p>
|
154
|
+
|
155
|
+
<pre class="ruby"><span class="ruby-identifier">ruby</span>
|
156
|
+
</pre>
|
157
|
+
|
158
|
+
<p>DEPENDENCIES</p>
|
159
|
+
|
160
|
+
<pre>bundler (~> 2.0)
|
161
|
+
guard
|
162
|
+
guard-bundler
|
163
|
+
guard-rspec
|
164
|
+
markup
|
165
|
+
rake (~> 10.0)
|
166
|
+
rdoc
|
167
|
+
rspec (~> 3.0)
|
168
|
+
tddAlimentos!</pre>
|
169
|
+
|
170
|
+
<p>BUNDLED WITH</p>
|
171
|
+
|
172
|
+
<pre>2.0.2</pre>
|
173
|
+
|
174
|
+
</main>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<footer id="validator-badges" role="contentinfo">
|
179
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
180
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
|
181
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
182
|
+
</footer>
|
183
|
+
|
data/docs/Guardfile.html
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>Guardfile - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="file">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="./index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="project-metadata">
|
58
|
+
<div id="fileindex-section" class="nav-section">
|
59
|
+
<h3>Pages</h3>
|
60
|
+
|
61
|
+
<ul class="link-list">
|
62
|
+
|
63
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
64
|
+
|
65
|
+
<li><a href="./Gemfile_lock.html">Gemfile.lock</a>
|
66
|
+
|
67
|
+
<li><a href="./Guardfile.html">Guardfile</a>
|
68
|
+
|
69
|
+
<li><a href="./README_md.html">README</a>
|
70
|
+
|
71
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
72
|
+
|
73
|
+
<li><a href="./bin/setup.html">setup</a>
|
74
|
+
|
75
|
+
<li><a href="./tddAlimentos_gemspec.html">tddAlimentos.gemspec</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-label="Page Guardfile">
|
84
|
+
|
85
|
+
<p># A sample <a href="Guardfile.html">Guardfile</a> # More info at <a href="https://github.com/guard/guard#readme">github.com/guard/guard#readme</a></p>
|
86
|
+
|
87
|
+
<p>## Uncomment and set this to only include directories you want to watch # directories %w(app lib config test spec features) \ # .select{|d| Dir.exist?(d) ? d : UI.warning(“Directory #{d} does not exist”)}</p>
|
88
|
+
|
89
|
+
<p>## Note: if you are using the `directories` clause above and you are not ## watching the project directory ('.'), then you will want to move ## the <a href="Guardfile.html">Guardfile</a> to a watched dir and symlink it back, e.g. # # $ mkdir config # $ mv <a href="Guardfile.html">Guardfile</a> config/ # $ ln -s config/Guardfile . # # and, you'll have to watch “config/Guardfile” instead of “Guardfile”</p>
|
90
|
+
|
91
|
+
<p>guard :bundler do</p>
|
92
|
+
|
93
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'guard/bundler'</span>
|
94
|
+
<span class="ruby-identifier">require</span> <span class="ruby-string">'guard/bundler/verify'</span>
|
95
|
+
<span class="ruby-identifier">helper</span> = <span class="ruby-constant">Guard</span><span class="ruby-operator">::</span><span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">Verify</span>.<span class="ruby-identifier">new</span>
|
96
|
+
|
97
|
+
<span class="ruby-identifier">files</span> = [<span class="ruby-string">'Gemfile'</span>]
|
98
|
+
<span class="ruby-identifier">files</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Dir</span>[<span class="ruby-string">'*.gemspec'</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">files</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">helper</span>.<span class="ruby-identifier">uses_gemspec?</span>(<span class="ruby-identifier">f</span>) }
|
99
|
+
|
100
|
+
<span class="ruby-comment"># Assume files are symlinked from somewhere</span>
|
101
|
+
<span class="ruby-identifier">files</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">watch</span>(<span class="ruby-identifier">helper</span>.<span class="ruby-identifier">real_path</span>(<span class="ruby-identifier">file</span>)) }
|
102
|
+
</pre>
|
103
|
+
|
104
|
+
<p>end</p>
|
105
|
+
|
106
|
+
<p># Note: The cmd option is now required due to the increasing number of ways # rspec may be run, below are examples of the most common uses. # * bundler: 'bundle exec rspec' # * bundler binstubs: 'bin/rspec' # * spring: 'bin/rspec' (This will use spring if running and you have # installed the spring binstubs per the docs) # * zeus: 'zeus rspec' (requires the server to be started separately) # * 'just' rspec: 'rspec'</p>
|
107
|
+
|
108
|
+
<p>guard :rspec, cmd: “bundle exec rspec” do</p>
|
109
|
+
|
110
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">"guard/rspec/dsl"</span>
|
111
|
+
<span class="ruby-identifier">dsl</span> = <span class="ruby-constant">Guard</span><span class="ruby-operator">::</span><span class="ruby-constant">RSpec</span><span class="ruby-operator">::</span><span class="ruby-constant">Dsl</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>)
|
112
|
+
|
113
|
+
<span class="ruby-comment"># Feel free to open issues for suggestions and improvements</span>
|
114
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-regexp">%r{^lib/tddAlimentos/(.+)\.rb$}</span>) { <span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_dir</span> }
|
115
|
+
|
116
|
+
<span class="ruby-comment"># RSpec files</span>
|
117
|
+
<span class="ruby-identifier">rspec</span> = <span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">rspec</span>
|
118
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_helper</span>) { <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_dir</span> }
|
119
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_support</span>) { <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_dir</span> }
|
120
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_files</span>)
|
121
|
+
|
122
|
+
<span class="ruby-comment"># Ruby files</span>
|
123
|
+
<span class="ruby-identifier">ruby</span> = <span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">ruby</span>
|
124
|
+
<span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">watch_spec_files_for</span>(<span class="ruby-identifier">ruby</span>.<span class="ruby-identifier">lib_files</span>)
|
125
|
+
|
126
|
+
<span class="ruby-comment"># Rails files</span>
|
127
|
+
<span class="ruby-identifier">rails</span> = <span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">rails</span>(<span class="ruby-value">view_extensions:</span> <span class="ruby-node">%w(erb haml slim)</span>)
|
128
|
+
<span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">watch_spec_files_for</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">app_files</span>)
|
129
|
+
<span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">watch_spec_files_for</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">views</span>)
|
130
|
+
|
131
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">controllers</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
|
132
|
+
[
|
133
|
+
<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">"routing/#{m[1]}_routing"</span>),
|
134
|
+
<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">"controllers/#{m[1]}_controller"</span>),
|
135
|
+
<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">"acceptance/#{m[1]}"</span>)
|
136
|
+
]
|
137
|
+
<span class="ruby-keyword">end</span>
|
138
|
+
|
139
|
+
<span class="ruby-comment"># Rails config changes</span>
|
140
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">spec_helper</span>) { <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_dir</span> }
|
141
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">routes</span>) { <span class="ruby-node">"#{rspec.spec_dir}/routing"</span> }
|
142
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">app_controller</span>) { <span class="ruby-node">"#{rspec.spec_dir}/controllers"</span> }
|
143
|
+
|
144
|
+
<span class="ruby-comment"># Capybara features specs</span>
|
145
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">view_dirs</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">"features/#{m[1]}"</span>) }
|
146
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">layouts</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">"features/#{m[1]}"</span>) }
|
147
|
+
|
148
|
+
<span class="ruby-comment"># Turnip features and steps</span>
|
149
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-regexp">%r{^spec/acceptance/(.+)\.feature$}</span>)
|
150
|
+
<span class="ruby-identifier">watch</span>(<span class="ruby-regexp">%r{^spec/acceptance/steps/(.+)_steps\.rb$}</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
|
151
|
+
<span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-node">"**/#{m[1]}.feature"</span>)][<span class="ruby-value">0</span>] <span class="ruby-operator">||</span> <span class="ruby-string">"spec/acceptance"</span>
|
152
|
+
<span class="ruby-keyword">end</span>
|
153
|
+
</pre>
|
154
|
+
|
155
|
+
<p>end</p>
|
156
|
+
|
157
|
+
</main>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<footer id="validator-badges" role="contentinfo">
|
162
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
163
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
|
164
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
165
|
+
</footer>
|
166
|
+
|
data/docs/List.html
ADDED
@@ -0,0 +1,682 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class List - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="class">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="./index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
<div class="nav-section">
|
57
|
+
<h3>Table of Contents</h3>
|
58
|
+
|
59
|
+
<ul class="link-list" role="directory">
|
60
|
+
<li><a href="#class-List-label-lista.rb">lista.rb</a>
|
61
|
+
<li><a href="#class-List-label-Descripci-C3-B3n">Descripción</a>
|
62
|
+
<li><a href="#class-List-label-M-C3-A9todos">Métodos</a>
|
63
|
+
</ul>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
|
67
|
+
<div id="class-metadata">
|
68
|
+
|
69
|
+
<div id="parent-class-section" class="nav-section">
|
70
|
+
<h3>Parent</h3>
|
71
|
+
|
72
|
+
|
73
|
+
<p class="link"><a href="Object.html">Object</a>
|
74
|
+
|
75
|
+
</div>
|
76
|
+
|
77
|
+
<div id="includes-section" class="nav-section">
|
78
|
+
<h3>Included Modules</h3>
|
79
|
+
|
80
|
+
<ul class="link-list">
|
81
|
+
|
82
|
+
|
83
|
+
<li><span class="include">Enumerable</span>
|
84
|
+
|
85
|
+
|
86
|
+
</ul>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
<!-- Method Quickref -->
|
91
|
+
<div id="method-list-section" class="nav-section">
|
92
|
+
<h3>Methods</h3>
|
93
|
+
|
94
|
+
<ul class="link-list" role="directory">
|
95
|
+
|
96
|
+
<li ><a href="#method-c-new">::new</a>
|
97
|
+
|
98
|
+
<li ><a href="#method-i-each">#each</a>
|
99
|
+
|
100
|
+
<li ><a href="#method-i-empty-3F">#empty?</a>
|
101
|
+
|
102
|
+
<li ><a href="#method-i-extract">#extract</a>
|
103
|
+
|
104
|
+
<li ><a href="#method-i-extract_tail">#extract_tail</a>
|
105
|
+
|
106
|
+
<li ><a href="#method-i-insert">#insert</a>
|
107
|
+
|
108
|
+
<li ><a href="#method-i-insert_more">#insert_more</a>
|
109
|
+
|
110
|
+
<li ><a href="#method-i-insert_tail">#insert_tail</a>
|
111
|
+
|
112
|
+
<li ><a href="#method-i-to_rs">#to_rs</a>
|
113
|
+
|
114
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
115
|
+
|
116
|
+
</ul>
|
117
|
+
</div>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
</nav>
|
121
|
+
|
122
|
+
<main role="main" aria-labelledby="class-List">
|
123
|
+
<h1 id="class-List" class="class">
|
124
|
+
class List
|
125
|
+
</h1>
|
126
|
+
|
127
|
+
<section class="description">
|
128
|
+
|
129
|
+
<h1 id="class-List-label-lista.rb">lista.rb<span><a href="#class-List-label-lista.rb">¶</a> <a href="#top">↑</a></span></h1>
|
130
|
+
<dl class="rdoc-list note-list"><dt>Autor
|
131
|
+
<dd>
|
132
|
+
<p>Himar Manuel Barquín Carrasco</p>
|
133
|
+
</dd><dt>Web
|
134
|
+
<dd>
|
135
|
+
<p><a href="https://github.com/ULL-ESIT-LPP-1920/tdd-alu0101119373">github.com/ULL-ESIT-LPP-1920/tdd-alu0101119373</a></p>
|
136
|
+
</dd></dl>
|
137
|
+
|
138
|
+
<h2 id="class-List-label-Descripci-C3-B3n">Descripción<span><a href="#class-List-label-Descripci-C3-B3n">¶</a> <a href="#top">↑</a></span></h2>
|
139
|
+
|
140
|
+
<p>Clase que representa una lista, utilizando una estrucutura llamada <strong>Node</strong> que contiene la información del valor de ese nodo, junto a su nodo predecesor y su nodo antecesor. Además, la lista dispone de una cabeza, una cola, y un valor que representa el tamaño. De esta manera, la clase <a href="List.html"><code>List</code></a> es tipo LIFO (cola).</p>
|
141
|
+
|
142
|
+
<h2 id="class-List-label-M-C3-A9todos">Métodos<span><a href="#class-List-label-M-C3-A9todos">¶</a> <a href="#top">↑</a></span></h2>
|
143
|
+
<ul><li>
|
144
|
+
<p>empty?</p>
|
145
|
+
</li><li>
|
146
|
+
<p><a href="List.html#method-i-to_s"><code>to_s</code></a></p>
|
147
|
+
</li><li>
|
148
|
+
<p><a href="List.html#method-i-to_rs"><code>to_rs</code></a></p>
|
149
|
+
</li><li>
|
150
|
+
<p>insert</p>
|
151
|
+
</li><li>
|
152
|
+
<p><a href="List.html#method-i-insert_tail"><code>insert_tail</code></a></p>
|
153
|
+
</li><li>
|
154
|
+
<p><a href="List.html#method-i-insert_more"><code>insert_more</code></a></p>
|
155
|
+
</li><li>
|
156
|
+
<p>extract</p>
|
157
|
+
</li><li>
|
158
|
+
<p><a href="List.html#method-i-extract_tail"><code>extract_tail</code></a></p>
|
159
|
+
</li><li>
|
160
|
+
<p>each</p>
|
161
|
+
</li></ul>
|
162
|
+
|
163
|
+
</section>
|
164
|
+
|
165
|
+
|
166
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
<section class="attribute-method-details" class="method-section">
|
175
|
+
<header>
|
176
|
+
<h3>Attributes</h3>
|
177
|
+
</header>
|
178
|
+
|
179
|
+
|
180
|
+
<div id="attribute-i-head" class="method-detail">
|
181
|
+
<div class="method-heading attribute-method-heading">
|
182
|
+
<span class="method-name">head</span><span
|
183
|
+
class="attribute-access-type">[R]</span>
|
184
|
+
</div>
|
185
|
+
|
186
|
+
<div class="method-description">
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
</div>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div id="attribute-i-size" class="method-detail">
|
194
|
+
<div class="method-heading attribute-method-heading">
|
195
|
+
<span class="method-name">size</span><span
|
196
|
+
class="attribute-access-type">[R]</span>
|
197
|
+
</div>
|
198
|
+
|
199
|
+
<div class="method-description">
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
</div>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div id="attribute-i-tail" class="method-detail">
|
207
|
+
<div class="method-heading attribute-method-heading">
|
208
|
+
<span class="method-name">tail</span><span
|
209
|
+
class="attribute-access-type">[R]</span>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div class="method-description">
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
</div>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
</section>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
224
|
+
<header>
|
225
|
+
<h3>Public Class Methods</h3>
|
226
|
+
</header>
|
227
|
+
|
228
|
+
|
229
|
+
<div id="method-c-new" class="method-detail ">
|
230
|
+
|
231
|
+
<div class="method-heading">
|
232
|
+
<span class="method-name">new</span><span
|
233
|
+
class="method-args">()</span>
|
234
|
+
|
235
|
+
<span class="method-click-advice">click to toggle source</span>
|
236
|
+
|
237
|
+
</div>
|
238
|
+
|
239
|
+
|
240
|
+
<div class="method-description">
|
241
|
+
|
242
|
+
<p>Constructor de la clase <a href="List.html"><code>List</code></a></p>
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
<div class="method-source-code" id="new-source">
|
248
|
+
<pre><span class="ruby-comment"># File lib/tddAlimentos/lista.rb, line 40</span>
|
249
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
|
250
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-keyword">nil</span>
|
251
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-keyword">nil</span>
|
252
|
+
<span class="ruby-ivar">@size</span> = <span class="ruby-value">0</span>
|
253
|
+
<span class="ruby-keyword">end</span></pre>
|
254
|
+
</div>
|
255
|
+
|
256
|
+
</div>
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
</div>
|
262
|
+
|
263
|
+
|
264
|
+
</section>
|
265
|
+
|
266
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
267
|
+
<header>
|
268
|
+
<h3>Public Instance Methods</h3>
|
269
|
+
</header>
|
270
|
+
|
271
|
+
|
272
|
+
<div id="method-i-each" class="method-detail ">
|
273
|
+
|
274
|
+
<div class="method-heading">
|
275
|
+
<span class="method-name">each</span><span
|
276
|
+
class="method-args">() { |value| ... }</span>
|
277
|
+
|
278
|
+
<span class="method-click-advice">click to toggle source</span>
|
279
|
+
|
280
|
+
</div>
|
281
|
+
|
282
|
+
|
283
|
+
<div class="method-description">
|
284
|
+
|
285
|
+
<p>Permite que la clase <a href="List.html"><code>List</code></a> sea enumerable, lo que nos deja utilizar métodos como max(), min(), reverse_each(), collect(), etc</p>
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
<div class="method-source-code" id="each-source">
|
291
|
+
<pre><span class="ruby-comment"># File lib/tddAlimentos/lista.rb, line 165</span>
|
292
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">each</span>
|
293
|
+
<span class="ruby-identifier">nodo</span> = <span class="ruby-ivar">@head</span>
|
294
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">nodo</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
295
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-identifier">nodo</span>.<span class="ruby-identifier">value</span>
|
296
|
+
<span class="ruby-identifier">nodo</span> = <span class="ruby-identifier">nodo</span>.<span class="ruby-identifier">next</span>
|
297
|
+
<span class="ruby-keyword">end</span>
|
298
|
+
<span class="ruby-keyword">end</span></pre>
|
299
|
+
</div>
|
300
|
+
|
301
|
+
</div>
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
</div>
|
307
|
+
|
308
|
+
|
309
|
+
<div id="method-i-empty-3F" class="method-detail ">
|
310
|
+
|
311
|
+
<div class="method-heading">
|
312
|
+
<span class="method-name">empty?</span><span
|
313
|
+
class="method-args">()</span>
|
314
|
+
|
315
|
+
<span class="method-click-advice">click to toggle source</span>
|
316
|
+
|
317
|
+
</div>
|
318
|
+
|
319
|
+
|
320
|
+
<div class="method-description">
|
321
|
+
|
322
|
+
<p>Comprueba si la lista está vacía</p>
|
323
|
+
<dl class="rdoc-list note-list"><dt>Devuelve
|
324
|
+
<dd>
|
325
|
+
<p>'true' si la lista está vacía. 'false' en otro caso</p>
|
326
|
+
</dd></dl>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
<div class="method-source-code" id="empty-3F-source">
|
332
|
+
<pre><span class="ruby-comment"># File lib/tddAlimentos/lista.rb, line 49</span>
|
333
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">empty?</span>
|
334
|
+
<span class="ruby-ivar">@size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
335
|
+
<span class="ruby-keyword">end</span></pre>
|
336
|
+
</div>
|
337
|
+
|
338
|
+
</div>
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
</div>
|
344
|
+
|
345
|
+
|
346
|
+
<div id="method-i-extract" class="method-detail ">
|
347
|
+
|
348
|
+
<div class="method-heading">
|
349
|
+
<span class="method-name">extract</span><span
|
350
|
+
class="method-args">()</span>
|
351
|
+
|
352
|
+
<span class="method-click-advice">click to toggle source</span>
|
353
|
+
|
354
|
+
</div>
|
355
|
+
|
356
|
+
|
357
|
+
<div class="method-description">
|
358
|
+
|
359
|
+
<p>Extrae el elemento en la cabeza</p>
|
360
|
+
<dl class="rdoc-list note-list"><dt>Devuelve
|
361
|
+
<dd>
|
362
|
+
<p>Valor extraído</p>
|
363
|
+
</dd></dl>
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
<div class="method-source-code" id="extract-source">
|
369
|
+
<pre><span class="ruby-comment"># File lib/tddAlimentos/lista.rb, line 131</span>
|
370
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">extract</span> ()
|
371
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-keyword">nil</span>
|
372
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@tail</span>
|
373
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
374
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-keyword">nil</span>
|
375
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-keyword">nil</span>
|
376
|
+
<span class="ruby-keyword">else</span>
|
377
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
378
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-ivar">@head</span>.<span class="ruby-identifier">next</span>
|
379
|
+
<span class="ruby-ivar">@head</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-keyword">nil</span>
|
380
|
+
<span class="ruby-identifier">aux</span>.<span class="ruby-identifier">next</span> = <span class="ruby-keyword">nil</span>
|
381
|
+
<span class="ruby-keyword">end</span>
|
382
|
+
<span class="ruby-identifier">aux</span>.<span class="ruby-identifier">value</span>
|
383
|
+
<span class="ruby-keyword">end</span></pre>
|
384
|
+
</div>
|
385
|
+
|
386
|
+
</div>
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
</div>
|
392
|
+
|
393
|
+
|
394
|
+
<div id="method-i-extract_tail" class="method-detail ">
|
395
|
+
|
396
|
+
<div class="method-heading">
|
397
|
+
<span class="method-name">extract_tail</span><span
|
398
|
+
class="method-args">()</span>
|
399
|
+
|
400
|
+
<span class="method-click-advice">click to toggle source</span>
|
401
|
+
|
402
|
+
</div>
|
403
|
+
|
404
|
+
|
405
|
+
<div class="method-description">
|
406
|
+
|
407
|
+
<p>Extrae el elemento en la cola de la lista</p>
|
408
|
+
<dl class="rdoc-list note-list"><dt>Devuelve
|
409
|
+
<dd>
|
410
|
+
<p>Valor extraído</p>
|
411
|
+
</dd></dl>
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
<div class="method-source-code" id="extract_tail-source">
|
417
|
+
<pre><span class="ruby-comment"># File lib/tddAlimentos/lista.rb, line 149</span>
|
418
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">extract_tail</span> ()
|
419
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-keyword">nil</span>
|
420
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@tail</span>
|
421
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
422
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-keyword">nil</span>
|
423
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-keyword">nil</span>
|
424
|
+
<span class="ruby-keyword">else</span>
|
425
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@tail</span>
|
426
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-ivar">@tail</span>.<span class="ruby-identifier">prev</span>
|
427
|
+
<span class="ruby-ivar">@tail</span>.<span class="ruby-identifier">next</span> = <span class="ruby-keyword">nil</span>
|
428
|
+
<span class="ruby-identifier">aux</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-keyword">nil</span>
|
429
|
+
<span class="ruby-keyword">end</span>
|
430
|
+
<span class="ruby-identifier">aux</span>.<span class="ruby-identifier">value</span>
|
431
|
+
<span class="ruby-keyword">end</span></pre>
|
432
|
+
</div>
|
433
|
+
|
434
|
+
</div>
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
</div>
|
440
|
+
|
441
|
+
|
442
|
+
<div id="method-i-insert" class="method-detail ">
|
443
|
+
|
444
|
+
<div class="method-heading">
|
445
|
+
<span class="method-name">insert</span><span
|
446
|
+
class="method-args">(valor)</span>
|
447
|
+
|
448
|
+
<span class="method-click-advice">click to toggle source</span>
|
449
|
+
|
450
|
+
</div>
|
451
|
+
|
452
|
+
|
453
|
+
<div class="method-description">
|
454
|
+
|
455
|
+
<p>Inserta un valor por la cabeza</p>
|
456
|
+
<dl class="rdoc-list note-list"><dt>Parámetro
|
457
|
+
<dd></dd></dl>
|
458
|
+
<ul><li>
|
459
|
+
<p>valor: Valor a insertar</p>
|
460
|
+
</li></ul>
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
<div class="method-source-code" id="insert-source">
|
466
|
+
<pre><span class="ruby-comment"># File lib/tddAlimentos/lista.rb, line 90</span>
|
467
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert</span> (<span class="ruby-identifier">valor</span>)
|
468
|
+
<span class="ruby-identifier">n</span> = <span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">valor</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>)
|
469
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">empty?</span>
|
470
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-identifier">n</span>
|
471
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-identifier">n</span>
|
472
|
+
<span class="ruby-keyword">else</span>
|
473
|
+
<span class="ruby-identifier">n</span>.<span class="ruby-identifier">next</span> = <span class="ruby-ivar">@head</span>
|
474
|
+
<span class="ruby-ivar">@head</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-identifier">n</span>
|
475
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-identifier">n</span>
|
476
|
+
<span class="ruby-keyword">end</span>
|
477
|
+
<span class="ruby-ivar">@size</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
478
|
+
<span class="ruby-keyword">end</span></pre>
|
479
|
+
</div>
|
480
|
+
|
481
|
+
</div>
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
</div>
|
487
|
+
|
488
|
+
|
489
|
+
<div id="method-i-insert_more" class="method-detail ">
|
490
|
+
|
491
|
+
<div class="method-heading">
|
492
|
+
<span class="method-name">insert_more</span><span
|
493
|
+
class="method-args">(arr)</span>
|
494
|
+
|
495
|
+
<span class="method-click-advice">click to toggle source</span>
|
496
|
+
|
497
|
+
</div>
|
498
|
+
|
499
|
+
|
500
|
+
<div class="method-description">
|
501
|
+
|
502
|
+
<p>Inserta un conjunto de elementos en la cabeza</p>
|
503
|
+
<dl class="rdoc-list note-list"><dt>Parámetro
|
504
|
+
<dd></dd></dl>
|
505
|
+
<ul><li>
|
506
|
+
<p>arr: Array de elementos a insertar</p>
|
507
|
+
</li></ul>
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
<div class="method-source-code" id="insert_more-source">
|
513
|
+
<pre><span class="ruby-comment"># File lib/tddAlimentos/lista.rb, line 122</span>
|
514
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_more</span> (<span class="ruby-identifier">arr</span>)
|
515
|
+
<span class="ruby-identifier">arr</span>.<span class="ruby-identifier">reverse_each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
516
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-identifier">value</span>)
|
517
|
+
<span class="ruby-keyword">end</span>
|
518
|
+
<span class="ruby-keyword">end</span></pre>
|
519
|
+
</div>
|
520
|
+
|
521
|
+
</div>
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
</div>
|
527
|
+
|
528
|
+
|
529
|
+
<div id="method-i-insert_tail" class="method-detail ">
|
530
|
+
|
531
|
+
<div class="method-heading">
|
532
|
+
<span class="method-name">insert_tail</span><span
|
533
|
+
class="method-args">(valor)</span>
|
534
|
+
|
535
|
+
<span class="method-click-advice">click to toggle source</span>
|
536
|
+
|
537
|
+
</div>
|
538
|
+
|
539
|
+
|
540
|
+
<div class="method-description">
|
541
|
+
|
542
|
+
<p>Inserta un valor por la cola</p>
|
543
|
+
<dl class="rdoc-list note-list"><dt>Parámetro
|
544
|
+
<dd></dd></dl>
|
545
|
+
<ul><li>
|
546
|
+
<p>valor: Valor a insertar</p>
|
547
|
+
</li></ul>
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
<div class="method-source-code" id="insert_tail-source">
|
553
|
+
<pre><span class="ruby-comment"># File lib/tddAlimentos/lista.rb, line 106</span>
|
554
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_tail</span> (<span class="ruby-identifier">valor</span>)
|
555
|
+
<span class="ruby-identifier">n</span> = <span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">valor</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>)
|
556
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">empty?</span>
|
557
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-identifier">n</span>
|
558
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-identifier">n</span>
|
559
|
+
<span class="ruby-keyword">else</span>
|
560
|
+
<span class="ruby-identifier">n</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-ivar">@tail</span>
|
561
|
+
<span class="ruby-ivar">@tail</span>.<span class="ruby-identifier">next</span> = <span class="ruby-identifier">n</span>
|
562
|
+
<span class="ruby-ivar">@tail</span> = <span class="ruby-identifier">n</span>
|
563
|
+
<span class="ruby-keyword">end</span>
|
564
|
+
<span class="ruby-ivar">@size</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
565
|
+
<span class="ruby-keyword">end</span></pre>
|
566
|
+
</div>
|
567
|
+
|
568
|
+
</div>
|
569
|
+
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
</div>
|
574
|
+
|
575
|
+
|
576
|
+
<div id="method-i-to_rs" class="method-detail ">
|
577
|
+
|
578
|
+
<div class="method-heading">
|
579
|
+
<span class="method-name">to_rs</span><span
|
580
|
+
class="method-args">()</span>
|
581
|
+
|
582
|
+
<span class="method-click-advice">click to toggle source</span>
|
583
|
+
|
584
|
+
</div>
|
585
|
+
|
586
|
+
|
587
|
+
<div class="method-description">
|
588
|
+
|
589
|
+
<p>Muestra la lista desde la cola</p>
|
590
|
+
<dl class="rdoc-list note-list"><dt>Devuelve
|
591
|
+
<dd>
|
592
|
+
<p>Cadena de texto con los elementos de la lista en orden inverso</p>
|
593
|
+
</dd></dl>
|
594
|
+
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
<div class="method-source-code" id="to_rs-source">
|
599
|
+
<pre><span class="ruby-comment"># File lib/tddAlimentos/lista.rb, line 73</span>
|
600
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_rs</span>
|
601
|
+
<span class="ruby-identifier">str</span> = <span class="ruby-string">"["</span>
|
602
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@tail</span>
|
603
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">aux</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">do</span>
|
604
|
+
<span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">aux</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>
|
605
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-identifier">aux</span>.<span class="ruby-identifier">prev</span>
|
606
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">aux</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
607
|
+
<span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-string">","</span>
|
608
|
+
<span class="ruby-keyword">end</span>
|
609
|
+
<span class="ruby-keyword">end</span>
|
610
|
+
<span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-string">"]"</span>
|
611
|
+
<span class="ruby-identifier">str</span>
|
612
|
+
<span class="ruby-keyword">end</span></pre>
|
613
|
+
</div>
|
614
|
+
|
615
|
+
</div>
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
</div>
|
621
|
+
|
622
|
+
|
623
|
+
<div id="method-i-to_s" class="method-detail ">
|
624
|
+
|
625
|
+
<div class="method-heading">
|
626
|
+
<span class="method-name">to_s</span><span
|
627
|
+
class="method-args">()</span>
|
628
|
+
|
629
|
+
<span class="method-click-advice">click to toggle source</span>
|
630
|
+
|
631
|
+
</div>
|
632
|
+
|
633
|
+
|
634
|
+
<div class="method-description">
|
635
|
+
|
636
|
+
<p>Muestra la lista desde la cabeza</p>
|
637
|
+
<dl class="rdoc-list note-list"><dt>Devuelve
|
638
|
+
<dd>
|
639
|
+
<p>Cadena de texto con los elementos de la lista</p>
|
640
|
+
</dd></dl>
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
<div class="method-source-code" id="to_s-source">
|
646
|
+
<pre><span class="ruby-comment"># File lib/tddAlimentos/lista.rb, line 56</span>
|
647
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
|
648
|
+
<span class="ruby-identifier">str</span> = <span class="ruby-string">"["</span>
|
649
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
650
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">aux</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">do</span>
|
651
|
+
<span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">aux</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>
|
652
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-identifier">aux</span>.<span class="ruby-identifier">next</span>
|
653
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">aux</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
654
|
+
<span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-string">","</span>
|
655
|
+
<span class="ruby-keyword">end</span>
|
656
|
+
<span class="ruby-keyword">end</span>
|
657
|
+
<span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-string">"]"</span>
|
658
|
+
<span class="ruby-identifier">str</span>
|
659
|
+
<span class="ruby-keyword">end</span></pre>
|
660
|
+
</div>
|
661
|
+
|
662
|
+
</div>
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
</div>
|
668
|
+
|
669
|
+
|
670
|
+
</section>
|
671
|
+
|
672
|
+
</section>
|
673
|
+
|
674
|
+
</main>
|
675
|
+
|
676
|
+
|
677
|
+
<footer id="validator-badges" role="contentinfo">
|
678
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
679
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
|
680
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
681
|
+
</footer>
|
682
|
+
|