exam_LPP_T_5 0.1.2
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 +20 -0
- data/.rspec +2 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/Guardfile +38 -0
- data/LICENSE.txt +22 -0
- data/README.md +7 -0
- data/README.rdoc +3 -0
- data/Rakefile +13 -0
- data/exam.gemspec +32 -0
- data/html/Exam.html +112 -0
- data/html/Exam/DList.html +569 -0
- data/html/Exam/Examen.html +335 -0
- data/html/Exam/Interfaz.html +333 -0
- data/html/Exam/List.html +323 -0
- data/html/Exam/Test.html +384 -0
- data/html/Exam/ToF.html +164 -0
- data/html/Inversor.html +112 -0
- data/html/Inverter.html +164 -0
- data/html/Object.html +119 -0
- data/html/README_rdoc.html +86 -0
- data/html/created.rid +13 -0
- data/html/fonts.css +167 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +108 -0
- data/html/js/darkfish.js +140 -0
- data/html/js/jquery.js +4 -0
- data/html/js/navigation.js +142 -0
- data/html/js/search.js +109 -0
- data/html/js/search_index.js +1 -0
- data/html/js/searcher.js +228 -0
- data/html/rdoc.css +580 -0
- data/html/table_of_contents.html +222 -0
- data/lib/exam.rb +8 -0
- data/lib/exam/d_list.rb +124 -0
- data/lib/exam/examen.rb +38 -0
- data/lib/exam/interfaz.rb +34 -0
- data/lib/exam/list.rb +57 -0
- data/lib/exam/quiz.rb +39 -0
- data/lib/exam/test.rb +37 -0
- data/lib/exam/tof.rb +9 -0
- data/lib/exam/version.rb +3 -0
- data/lib/inverter.rb +1 -0
- data/lib/inverter/reverse.rb +10 -0
- data/lib/inverter/version.rb +3 -0
- data/rspec_results.html +339 -0
- data/spec/exam_spec.rb +346 -0
- data/spec/spec_helper.rb +19 -0
- metadata +225 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a0d8c0fb6ec9d30ed1a09549dcf5a1171ecb1bef
|
4
|
+
data.tar.gz: b1d13d9bd94991ceca4701352ef71712f44c82b2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e5c29861f7e44646c3550d9eb4fdca43b5347a31fdd0b10bc68ee1e49b287ab7b488ab940c75facd2c7bf5343bfa3e15876c457ccf8b539234d886648ec59997
|
7
|
+
data.tar.gz: 79628738f4e10eb5f92475acced3931054a9e94afb73b30dcd786a08819eb9ceb082386baf49ccb4d609899b5a21e695c1efedbc7218dc6006c597dd5f0a31e4
|
data/.coveralls.yml
ADDED
data/.gitignore
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
._.DS_Store
|
2
|
+
*.gem
|
3
|
+
*.rbc
|
4
|
+
.bundle
|
5
|
+
.config
|
6
|
+
.yardoc
|
7
|
+
.DS_Store
|
8
|
+
Gemfile.lock
|
9
|
+
InstalledFiles
|
10
|
+
_yardoc
|
11
|
+
coverage
|
12
|
+
doc/
|
13
|
+
lib/bundler/man
|
14
|
+
pkg
|
15
|
+
rdoc
|
16
|
+
spec/reports
|
17
|
+
test/tmp
|
18
|
+
test/version_tmp
|
19
|
+
tmp
|
20
|
+
rspec_results.html
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard :bundler do
|
5
|
+
watch('Gemfile')
|
6
|
+
# Uncomment next line if your Gemfile contains the `gemspec' command.
|
7
|
+
watch(/^.+\.gemspec/)
|
8
|
+
end
|
9
|
+
|
10
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
11
|
+
# rspec may be run, below are examples of the most common uses.
|
12
|
+
# * bundler: 'bundle exec rspec'
|
13
|
+
# * bundler binstubs: 'bin/rspec'
|
14
|
+
# * spring: 'bin/rsspec' (This will use spring if running and you have
|
15
|
+
# installed the spring binstubs per the docs)
|
16
|
+
# * zeus: 'zeus rspec' (requires the server to be started separetly)
|
17
|
+
# * 'just' rspec: 'rspec'
|
18
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
19
|
+
watch(%r{^spec/.+_spec\.rb$})
|
20
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
21
|
+
watch('spec/spec_helper.rb') { "spec" }
|
22
|
+
|
23
|
+
# Rails example
|
24
|
+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
25
|
+
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
26
|
+
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
27
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
28
|
+
watch('config/routes.rb') { "spec/routing" }
|
29
|
+
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
30
|
+
watch('spec/rails_helper.rb') { "spec" }
|
31
|
+
|
32
|
+
# Capybara features specs
|
33
|
+
watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
|
34
|
+
|
35
|
+
# Turnip features and steps
|
36
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
37
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
38
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Jonathan Expósito
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# Gema Exam
|
2
|
+
|
3
|
+
[](https://travis-ci.org/alu0100699968/LPP_T_5_prct08)
|
4
|
+
|
5
|
+
[](https://coveralls.io/r/alu0100699968/LPP_T_5_prct08?branch=desarrollo)
|
6
|
+
|
7
|
+
Autores: Jonathan Expósito Martín - Sergio J. Rodríguez Martín
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
$:.unshift File.dirname(__FILE__) + 'lib'
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
RSpec::Core::RakeTask.new
|
6
|
+
task :default => :spec
|
7
|
+
|
8
|
+
require 'rdoc/task'
|
9
|
+
Rake::RDocTask.new do |rd|
|
10
|
+
rd.main = "README.rdoc"
|
11
|
+
rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
|
12
|
+
rd.options << "--all"
|
13
|
+
end
|
data/exam.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'exam/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "exam_LPP_T_5"
|
8
|
+
spec.version = Exam::VERSION
|
9
|
+
spec.platform = Gem::Platform::RUBY
|
10
|
+
spec.authors = ["Jonathan Expósito", "Sergio Rodríguez"]
|
11
|
+
spec.email = ["alu0100696455@ull.edu.es", "alu0100699968@ull.edu.es"]
|
12
|
+
spec.description = %q{Gema para realizar tests}
|
13
|
+
spec.summary = %q{Gema para realizar tests}
|
14
|
+
spec.homepage = "https://github.com/alu0100699968/LPP_T_5_prct08"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files`.split($/)
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "rspec", "~>2.11"
|
25
|
+
|
26
|
+
spec.add_development_dependency "guard"
|
27
|
+
spec.add_development_dependency "guard-rspec"
|
28
|
+
spec.add_development_dependency "guard-bundler"
|
29
|
+
|
30
|
+
spec.add_development_dependency "coveralls"
|
31
|
+
|
32
|
+
end
|
data/html/Exam.html
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module Exam - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link href="./fonts.css" rel="stylesheet">
|
10
|
+
<link href="./rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "./";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="./js/jquery.js"></script>
|
17
|
+
<script src="./js/navigation.js"></script>
|
18
|
+
<script src="./js/search_index.js"></script>
|
19
|
+
<script src="./js/search.js"></script>
|
20
|
+
<script src="./js/searcher.js"></script>
|
21
|
+
<script src="./js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
</div>
|
65
|
+
</nav>
|
66
|
+
|
67
|
+
<main role="main" aria-labelledby="module-Exam">
|
68
|
+
<h1 id="module-Exam" class="module">
|
69
|
+
module Exam
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<section class="description">
|
73
|
+
|
74
|
+
</section>
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<section class="constants-list">
|
86
|
+
<header>
|
87
|
+
<h3>Constants</h3>
|
88
|
+
</header>
|
89
|
+
<dl>
|
90
|
+
|
91
|
+
<dt id="VERSION">VERSION
|
92
|
+
|
93
|
+
<dd>
|
94
|
+
|
95
|
+
|
96
|
+
</dl>
|
97
|
+
</section>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
</section>
|
104
|
+
</main>
|
105
|
+
|
106
|
+
|
107
|
+
<footer id="validator-badges" role="contentinfo">
|
108
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
109
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
|
110
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
111
|
+
</footer>
|
112
|
+
|
@@ -0,0 +1,569 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Exam::DList - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link href="../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "../";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="../js/jquery.js"></script>
|
17
|
+
<script src="../js/navigation.js"></script>
|
18
|
+
<script src="../js/search_index.js"></script>
|
19
|
+
<script src="../js/search.js"></script>
|
20
|
+
<script src="../js/searcher.js"></script>
|
21
|
+
<script src="../js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
<div id="parent-class-section" class="nav-section">
|
61
|
+
<h3>Parent</h3>
|
62
|
+
|
63
|
+
|
64
|
+
<p class="link"><a href="../Object.html">Object</a>
|
65
|
+
|
66
|
+
</div>
|
67
|
+
|
68
|
+
<div id="includes-section" class="nav-section">
|
69
|
+
<h3>Included Modules</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
|
74
|
+
<li><span class="include">Enumerable</span>
|
75
|
+
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
|
81
|
+
<!-- Method Quickref -->
|
82
|
+
<div id="method-list-section" class="nav-section">
|
83
|
+
<h3>Methods</h3>
|
84
|
+
|
85
|
+
<ul class="link-list" role="directory">
|
86
|
+
|
87
|
+
<li ><a href="#method-c-new">::new</a>
|
88
|
+
|
89
|
+
<li ><a href="#method-i-each">#each</a>
|
90
|
+
|
91
|
+
<li ><a href="#method-i-popHead">#popHead</a>
|
92
|
+
|
93
|
+
<li ><a href="#method-i-popTail">#popTail</a>
|
94
|
+
|
95
|
+
<li ><a href="#method-i-pushHead">#pushHead</a>
|
96
|
+
|
97
|
+
<li ><a href="#method-i-pushTail">#pushTail</a>
|
98
|
+
|
99
|
+
<li ><a href="#method-i-size">#size</a>
|
100
|
+
|
101
|
+
<li ><a href="#method-i-to_is">#to_is</a>
|
102
|
+
|
103
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
104
|
+
|
105
|
+
</ul>
|
106
|
+
</div>
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</nav>
|
110
|
+
|
111
|
+
<main role="main" aria-labelledby="class-Exam::DList">
|
112
|
+
<h1 id="class-Exam::DList" class="class">
|
113
|
+
class Exam::DList
|
114
|
+
</h1>
|
115
|
+
|
116
|
+
<section class="description">
|
117
|
+
|
118
|
+
<p>create a <a href="DList.html">DList</a></p>
|
119
|
+
|
120
|
+
</section>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<section class="attribute-method-details" class="method-section">
|
134
|
+
<header>
|
135
|
+
<h3>Attributes</h3>
|
136
|
+
</header>
|
137
|
+
|
138
|
+
|
139
|
+
<div id="attribute-i-head" class="method-detail">
|
140
|
+
<div class="method-heading attribute-method-heading">
|
141
|
+
<span class="method-name">head</span><span
|
142
|
+
class="attribute-access-type">[RW]</span>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div class="method-description">
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div id="attribute-i-tail" class="method-detail">
|
153
|
+
<div class="method-heading attribute-method-heading">
|
154
|
+
<span class="method-name">tail</span><span
|
155
|
+
class="attribute-access-type">[RW]</span>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<div class="method-description">
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
</section>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
170
|
+
<header>
|
171
|
+
<h3>Public Class Methods</h3>
|
172
|
+
</header>
|
173
|
+
|
174
|
+
|
175
|
+
<div id="method-c-new" class="method-detail ">
|
176
|
+
|
177
|
+
<div class="method-heading">
|
178
|
+
<span class="method-name">new</span><span
|
179
|
+
class="method-args">(v)</span>
|
180
|
+
|
181
|
+
<span class="method-click-advice">click to toggle source</span>
|
182
|
+
|
183
|
+
</div>
|
184
|
+
|
185
|
+
|
186
|
+
<div class="method-description">
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<div class="method-source-code" id="new-source">
|
194
|
+
<pre><span class="ruby-comment"># File lib/exam/d_list.rb, line 19</span>
|
195
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">v</span>)
|
196
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Array</span>)
|
197
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">v</span>[<span class="ruby-value">0</span>],<span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>)
|
198
|
+
<span class="ruby-identifier">v</span>.<span class="ruby-identifier">shift</span>
|
199
|
+
<span class="ruby-identifier">pushHead</span>(<span class="ruby-identifier">v</span>)
|
200
|
+
<span class="ruby-keyword">else</span>
|
201
|
+
<span class="ruby-ivar">@head</span> = <span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">v</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>)
|
202
|
+
<span class="ruby-keyword">end</span>
|
203
|
+
<span class="ruby-keyword">end</span></pre>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
</div>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</div>
|
212
|
+
|
213
|
+
|
214
|
+
</section>
|
215
|
+
|
216
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
217
|
+
<header>
|
218
|
+
<h3>Public Instance Methods</h3>
|
219
|
+
</header>
|
220
|
+
|
221
|
+
|
222
|
+
<div id="method-i-each" class="method-detail ">
|
223
|
+
|
224
|
+
<div class="method-heading">
|
225
|
+
<span class="method-name">each</span><span
|
226
|
+
class="method-args">() { |aux| ... }</span>
|
227
|
+
|
228
|
+
<span class="method-click-advice">click to toggle source</span>
|
229
|
+
|
230
|
+
</div>
|
231
|
+
|
232
|
+
|
233
|
+
<div class="method-description">
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
<div class="method-source-code" id="each-source">
|
241
|
+
<pre><span class="ruby-comment"># File lib/exam/d_list.rb, line 9</span>
|
242
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>
|
243
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-ivar">@head</span>
|
244
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
245
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:value</span>]
|
246
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
247
|
+
<span class="ruby-keyword">end</span>
|
248
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:value</span>]
|
249
|
+
<span class="ruby-keyword">end</span></pre>
|
250
|
+
</div>
|
251
|
+
|
252
|
+
</div>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
<div id="method-i-popHead" class="method-detail ">
|
261
|
+
|
262
|
+
<div class="method-heading">
|
263
|
+
<span class="method-name">popHead</span><span
|
264
|
+
class="method-args">()</span>
|
265
|
+
|
266
|
+
<span class="method-click-advice">click to toggle source</span>
|
267
|
+
|
268
|
+
</div>
|
269
|
+
|
270
|
+
|
271
|
+
<div class="method-description">
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
<div class="method-source-code" id="popHead-source">
|
279
|
+
<pre><span class="ruby-comment"># File lib/exam/d_list.rb, line 29</span>
|
280
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">popHead</span>
|
281
|
+
<span class="ruby-identifier">nodo</span> = <span class="ruby-ivar">@head</span>
|
282
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">nodo</span>
|
283
|
+
<span class="ruby-ivar">@head</span>=<span class="ruby-ivar">@head</span>[<span class="ruby-value">:next</span>]
|
284
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@head</span>
|
285
|
+
<span class="ruby-ivar">@head</span>[<span class="ruby-value">:prev</span>]=<span class="ruby-keyword">nil</span>
|
286
|
+
<span class="ruby-keyword">end</span>
|
287
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">nodo</span>[<span class="ruby-value">:value</span>]
|
288
|
+
<span class="ruby-keyword">end</span>
|
289
|
+
<span class="ruby-keyword">end</span></pre>
|
290
|
+
</div>
|
291
|
+
|
292
|
+
</div>
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
</div>
|
298
|
+
|
299
|
+
|
300
|
+
<div id="method-i-popTail" class="method-detail ">
|
301
|
+
|
302
|
+
<div class="method-heading">
|
303
|
+
<span class="method-name">popTail</span><span
|
304
|
+
class="method-args">()</span>
|
305
|
+
|
306
|
+
<span class="method-click-advice">click to toggle source</span>
|
307
|
+
|
308
|
+
</div>
|
309
|
+
|
310
|
+
|
311
|
+
<div class="method-description">
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
<div class="method-source-code" id="popTail-source">
|
319
|
+
<pre><span class="ruby-comment"># File lib/exam/d_list.rb, line 40</span>
|
320
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">popTail</span>
|
321
|
+
<span class="ruby-identifier">nodo</span> = <span class="ruby-ivar">@head</span>
|
322
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">nodo</span>
|
323
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">nodo</span>[<span class="ruby-value">:next</span>] <span class="ruby-keyword">do</span>
|
324
|
+
<span class="ruby-identifier">nodo</span>=<span class="ruby-identifier">nodo</span>[<span class="ruby-value">:next</span>]
|
325
|
+
<span class="ruby-keyword">end</span>
|
326
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-identifier">nodo</span>[<span class="ruby-value">:prev</span>]
|
327
|
+
<span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]=<span class="ruby-keyword">nil</span>
|
328
|
+
<span class="ruby-identifier">nodo</span>[<span class="ruby-value">:prev</span>]=<span class="ruby-keyword">nil</span>
|
329
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">nodo</span>[<span class="ruby-value">:value</span>]
|
330
|
+
<span class="ruby-keyword">end</span>
|
331
|
+
<span class="ruby-keyword">end</span></pre>
|
332
|
+
</div>
|
333
|
+
|
334
|
+
</div>
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
</div>
|
340
|
+
|
341
|
+
|
342
|
+
<div id="method-i-pushHead" class="method-detail ">
|
343
|
+
|
344
|
+
<div class="method-heading">
|
345
|
+
<span class="method-name">pushHead</span><span
|
346
|
+
class="method-args">(v)</span>
|
347
|
+
|
348
|
+
<span class="method-click-advice">click to toggle source</span>
|
349
|
+
|
350
|
+
</div>
|
351
|
+
|
352
|
+
|
353
|
+
<div class="method-description">
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
<div class="method-source-code" id="pushHead-source">
|
361
|
+
<pre><span class="ruby-comment"># File lib/exam/d_list.rb, line 53</span>
|
362
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pushHead</span>(<span class="ruby-identifier">v</span>)
|
363
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Array</span>)
|
364
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">v</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>
|
365
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
366
|
+
<span class="ruby-identifier">nodo</span>=<span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">v</span>[<span class="ruby-identifier">i</span>], <span class="ruby-identifier">aux</span>, <span class="ruby-keyword">nil</span>)
|
367
|
+
<span class="ruby-ivar">@head</span>=<span class="ruby-identifier">nodo</span>
|
368
|
+
<span class="ruby-identifier">aux</span>[<span class="ruby-value">:prev</span>]=<span class="ruby-ivar">@head</span>
|
369
|
+
<span class="ruby-keyword">end</span>
|
370
|
+
<span class="ruby-keyword">else</span>
|
371
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
372
|
+
<span class="ruby-identifier">nodo</span>=<span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">v</span>, <span class="ruby-identifier">aux</span>, <span class="ruby-keyword">nil</span>)
|
373
|
+
<span class="ruby-ivar">@head</span>=<span class="ruby-identifier">nodo</span>
|
374
|
+
<span class="ruby-identifier">aux</span>[<span class="ruby-value">:prev</span>]=<span class="ruby-ivar">@head</span>
|
375
|
+
<span class="ruby-keyword">end</span>
|
376
|
+
<span class="ruby-keyword">end</span></pre>
|
377
|
+
</div>
|
378
|
+
|
379
|
+
</div>
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
</div>
|
385
|
+
|
386
|
+
|
387
|
+
<div id="method-i-pushTail" class="method-detail ">
|
388
|
+
|
389
|
+
<div class="method-heading">
|
390
|
+
<span class="method-name">pushTail</span><span
|
391
|
+
class="method-args">(v)</span>
|
392
|
+
|
393
|
+
<span class="method-click-advice">click to toggle source</span>
|
394
|
+
|
395
|
+
</div>
|
396
|
+
|
397
|
+
|
398
|
+
<div class="method-description">
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
<div class="method-source-code" id="pushTail-source">
|
406
|
+
<pre><span class="ruby-comment"># File lib/exam/d_list.rb, line 69</span>
|
407
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pushTail</span>(<span class="ruby-identifier">v</span>)
|
408
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-ivar">@head</span>
|
409
|
+
|
410
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Array</span>)
|
411
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">v</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>
|
412
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]<span class="ruby-operator">!=</span><span class="ruby-keyword">nil</span> <span class="ruby-keyword">do</span>
|
413
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
414
|
+
<span class="ruby-keyword">end</span>
|
415
|
+
<span class="ruby-identifier">nuevo_nodo</span>=<span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">v</span>[<span class="ruby-identifier">i</span>], <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">aux</span>)
|
416
|
+
<span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]=<span class="ruby-identifier">nuevo_nodo</span>
|
417
|
+
<span class="ruby-keyword">end</span>
|
418
|
+
<span class="ruby-keyword">else</span>
|
419
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>] <span class="ruby-keyword">do</span>
|
420
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
421
|
+
<span class="ruby-keyword">end</span>
|
422
|
+
<span class="ruby-identifier">nuevo_nodo</span>=<span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">v</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">aux</span>)
|
423
|
+
<span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]=<span class="ruby-identifier">nuevo_nodo</span>
|
424
|
+
<span class="ruby-keyword">end</span>
|
425
|
+
<span class="ruby-keyword">end</span></pre>
|
426
|
+
</div>
|
427
|
+
|
428
|
+
</div>
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
</div>
|
434
|
+
|
435
|
+
|
436
|
+
<div id="method-i-size" class="method-detail ">
|
437
|
+
|
438
|
+
<div class="method-heading">
|
439
|
+
<span class="method-name">size</span><span
|
440
|
+
class="method-args">()</span>
|
441
|
+
|
442
|
+
<span class="method-click-advice">click to toggle source</span>
|
443
|
+
|
444
|
+
</div>
|
445
|
+
|
446
|
+
|
447
|
+
<div class="method-description">
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
<div class="method-source-code" id="size-source">
|
455
|
+
<pre><span class="ruby-comment"># File lib/exam/d_list.rb, line 89</span>
|
456
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">size</span>
|
457
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-ivar">@head</span>
|
458
|
+
<span class="ruby-identifier">n</span>=<span class="ruby-value">0</span>
|
459
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>] <span class="ruby-keyword">do</span>
|
460
|
+
<span class="ruby-identifier">n</span>=<span class="ruby-identifier">n</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>
|
461
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
462
|
+
<span class="ruby-keyword">end</span>
|
463
|
+
<span class="ruby-identifier">n</span>=<span class="ruby-identifier">n</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>
|
464
|
+
<span class="ruby-keyword">end</span></pre>
|
465
|
+
</div>
|
466
|
+
|
467
|
+
</div>
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
</div>
|
473
|
+
|
474
|
+
|
475
|
+
<div id="method-i-to_is" class="method-detail ">
|
476
|
+
|
477
|
+
<div class="method-heading">
|
478
|
+
<span class="method-name">to_is</span><span
|
479
|
+
class="method-args">()</span>
|
480
|
+
|
481
|
+
<span class="method-click-advice">click to toggle source</span>
|
482
|
+
|
483
|
+
</div>
|
484
|
+
|
485
|
+
|
486
|
+
<div class="method-description">
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
<div class="method-source-code" id="to_is-source">
|
494
|
+
<pre><span class="ruby-comment"># File lib/exam/d_list.rb, line 110</span>
|
495
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_is</span>
|
496
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-ivar">@head</span>
|
497
|
+
<span class="ruby-identifier">s</span>=<span class="ruby-string">""</span>
|
498
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>] <span class="ruby-keyword">do</span>
|
499
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
500
|
+
<span class="ruby-keyword">end</span>
|
501
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:prev</span>] <span class="ruby-keyword">do</span>
|
502
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span> <span class="ruby-operator">+</span> <span class="ruby-node">"#{aux[:value]} "</span>
|
503
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-identifier">aux</span>[<span class="ruby-value">:prev</span>]
|
504
|
+
<span class="ruby-keyword">end</span>
|
505
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span> <span class="ruby-operator">+</span> <span class="ruby-node">"#{aux[:value]}"</span>
|
506
|
+
<span class="ruby-comment">#puts "#{s}"</span>
|
507
|
+
<span class="ruby-keyword">end</span></pre>
|
508
|
+
</div>
|
509
|
+
|
510
|
+
</div>
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
</div>
|
516
|
+
|
517
|
+
|
518
|
+
<div id="method-i-to_s" class="method-detail ">
|
519
|
+
|
520
|
+
<div class="method-heading">
|
521
|
+
<span class="method-name">to_s</span><span
|
522
|
+
class="method-args">()</span>
|
523
|
+
|
524
|
+
<span class="method-click-advice">click to toggle source</span>
|
525
|
+
|
526
|
+
</div>
|
527
|
+
|
528
|
+
|
529
|
+
<div class="method-description">
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
|
536
|
+
<div class="method-source-code" id="to_s-source">
|
537
|
+
<pre><span class="ruby-comment"># File lib/exam/d_list.rb, line 99</span>
|
538
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
539
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-ivar">@head</span>
|
540
|
+
<span class="ruby-identifier">s</span>=<span class="ruby-string">""</span>
|
541
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>] <span class="ruby-keyword">do</span>
|
542
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span> <span class="ruby-operator">+</span> <span class="ruby-node">"#{aux[:value]} "</span>
|
543
|
+
<span class="ruby-identifier">aux</span>=<span class="ruby-identifier">aux</span>[<span class="ruby-value">:next</span>]
|
544
|
+
<span class="ruby-keyword">end</span>
|
545
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span> <span class="ruby-operator">+</span> <span class="ruby-node">"#{aux[:value]}"</span>
|
546
|
+
<span class="ruby-comment">#puts "#{s}"</span>
|
547
|
+
<span class="ruby-keyword">end</span></pre>
|
548
|
+
</div>
|
549
|
+
|
550
|
+
</div>
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
</div>
|
556
|
+
|
557
|
+
|
558
|
+
</section>
|
559
|
+
|
560
|
+
</section>
|
561
|
+
</main>
|
562
|
+
|
563
|
+
|
564
|
+
<footer id="validator-badges" role="contentinfo">
|
565
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
566
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
|
567
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
568
|
+
</footer>
|
569
|
+
|