alimentos_diego_algomas 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +2 -0
  3. data/.gitignore +12 -0
  4. data/.rspec +3 -0
  5. data/.travis.yml +7 -0
  6. data/Gemfile +4 -0
  7. data/Gemfile.lock +97 -0
  8. data/Guardfile +83 -0
  9. data/README.md +57 -0
  10. data/Rakefile +6 -0
  11. data/alimentos.gemspec +38 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/docs/Alimentos.html +115 -0
  15. data/docs/Alimentos/Alimentos.html +376 -0
  16. data/docs/Alimentos/Error.html +106 -0
  17. data/docs/Gemfile.html +99 -0
  18. data/docs/Gemfile_lock.html +180 -0
  19. data/docs/Guardfile.html +166 -0
  20. data/docs/List.html +120 -0
  21. data/docs/List/Error.html +106 -0
  22. data/docs/List/List.html +495 -0
  23. data/docs/Menu.html +115 -0
  24. data/docs/Menu/Error.html +106 -0
  25. data/docs/Menu/Menu.html +512 -0
  26. data/docs/Object.html +199 -0
  27. data/docs/Plato.html +115 -0
  28. data/docs/Plato/Error.html +106 -0
  29. data/docs/Plato/Plato.html +478 -0
  30. data/docs/Plato/PlatoAmbiental.html +374 -0
  31. data/docs/README_md.html +155 -0
  32. data/docs/Rakefile.html +101 -0
  33. data/docs/bin/setup.html +101 -0
  34. data/docs/created.rid +17 -0
  35. data/docs/css/fonts.css +167 -0
  36. data/docs/css/rdoc.css +619 -0
  37. data/docs/fonts/Lato-Light.ttf +0 -0
  38. data/docs/fonts/Lato-LightItalic.ttf +0 -0
  39. data/docs/fonts/Lato-Regular.ttf +0 -0
  40. data/docs/fonts/Lato-RegularItalic.ttf +0 -0
  41. data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
  42. data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
  43. data/docs/images/add.png +0 -0
  44. data/docs/images/arrow_up.png +0 -0
  45. data/docs/images/brick.png +0 -0
  46. data/docs/images/brick_link.png +0 -0
  47. data/docs/images/bug.png +0 -0
  48. data/docs/images/bullet_black.png +0 -0
  49. data/docs/images/bullet_toggle_minus.png +0 -0
  50. data/docs/images/bullet_toggle_plus.png +0 -0
  51. data/docs/images/date.png +0 -0
  52. data/docs/images/delete.png +0 -0
  53. data/docs/images/find.png +0 -0
  54. data/docs/images/loadingAnimation.gif +0 -0
  55. data/docs/images/macFFBgHack.png +0 -0
  56. data/docs/images/package.png +0 -0
  57. data/docs/images/page_green.png +0 -0
  58. data/docs/images/page_white_text.png +0 -0
  59. data/docs/images/page_white_width.png +0 -0
  60. data/docs/images/plugin.png +0 -0
  61. data/docs/images/ruby.png +0 -0
  62. data/docs/images/tag_blue.png +0 -0
  63. data/docs/images/tag_green.png +0 -0
  64. data/docs/images/transparent.png +0 -0
  65. data/docs/images/wrench.png +0 -0
  66. data/docs/images/wrench_orange.png +0 -0
  67. data/docs/images/zoom.png +0 -0
  68. data/docs/index.html +132 -0
  69. data/docs/js/darkfish.js +84 -0
  70. data/docs/js/navigation.js +105 -0
  71. data/docs/js/navigation.js.gz +0 -0
  72. data/docs/js/search.js +110 -0
  73. data/docs/js/search_index.js +1 -0
  74. data/docs/js/search_index.js.gz +0 -0
  75. data/docs/js/searcher.js +229 -0
  76. data/docs/js/searcher.js.gz +0 -0
  77. data/docs/table_of_contents.html +345 -0
  78. data/lib/alimentos.rb +29 -0
  79. data/lib/alimentos/alimentos.rb +36 -0
  80. data/lib/alimentos/dsl.rb +123 -0
  81. data/lib/alimentos/dslmenu.rb +60 -0
  82. data/lib/alimentos/list.rb +104 -0
  83. data/lib/alimentos/menu.rb +62 -0
  84. data/lib/alimentos/plato.rb +93 -0
  85. data/lib/alimentos/platoAmbiental.rb +64 -0
  86. data/lib/alimentos/version.rb +15 -0
  87. metadata +243 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6943be118106ee4feb6973ae8625d60ddf372b88fc89b5783106f1f1e3cc8a21
4
+ data.tar.gz: c3e5601d5989bee7fbe8d907761a4033c6b36e18dbaa23b215c30109c8bf87a2
5
+ SHA512:
6
+ metadata.gz: c367445d6d36f87e80a78fd5a6c0f52e063e3da86b61217076fedab400fc2c3beee6d7e09bad37f341b523da487fffb5b3fd9a3b473deddc807303b99874f4f8
7
+ data.tar.gz: 65308575fa4957c16bb20fc11dc2a10b9754057e19f075ef1a22d508becf7607f7cc3571a8477dc75ad97f0f150f80a756775d76ab7c54482e89c4f594510d23
@@ -0,0 +1,2 @@
1
+ service_name: travis-ci
2
+ repo_token: ySy166VDTaGdlnbW6WZAlDlFfiYVahdGC
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.3
7
+ before_install: gem install bundler -v 2.0.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in alimentos.gemspec
4
+ gemspec
@@ -0,0 +1,97 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ alimentos_diego_algomas (0.1.3)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ coderay (1.1.2)
10
+ coveralls (0.8.23)
11
+ json (>= 1.8, < 3)
12
+ simplecov (~> 0.16.1)
13
+ term-ansicolor (~> 1.3)
14
+ thor (>= 0.19.4, < 2.0)
15
+ tins (~> 1.6)
16
+ diff-lcs (1.3)
17
+ docile (1.3.2)
18
+ ffi (1.11.2)
19
+ formatador (0.2.5)
20
+ guard (2.16.1)
21
+ formatador (>= 0.2.4)
22
+ listen (>= 2.7, < 4.0)
23
+ lumberjack (>= 1.0.12, < 2.0)
24
+ nenv (~> 0.1)
25
+ notiffany (~> 0.0)
26
+ pry (>= 0.9.12)
27
+ shellany (~> 0.0)
28
+ thor (>= 0.18.1)
29
+ guard-bundler (2.2.1)
30
+ bundler (>= 1.3.0, < 3)
31
+ guard (~> 2.2)
32
+ guard-compat (~> 1.1)
33
+ guard-compat (1.2.1)
34
+ guard-rspec (4.7.3)
35
+ guard (~> 2.1)
36
+ guard-compat (~> 1.1)
37
+ rspec (>= 2.99.0, < 4.0)
38
+ json (2.3.0)
39
+ listen (3.2.0)
40
+ rb-fsevent (~> 0.10, >= 0.10.3)
41
+ rb-inotify (~> 0.9, >= 0.9.10)
42
+ lumberjack (1.0.13)
43
+ method_source (0.9.2)
44
+ nenv (0.3.0)
45
+ notiffany (0.1.3)
46
+ nenv (~> 0.1)
47
+ shellany (~> 0.0)
48
+ pry (0.12.2)
49
+ coderay (~> 1.1.0)
50
+ method_source (~> 0.9.0)
51
+ rake (10.5.0)
52
+ rb-fsevent (0.10.3)
53
+ rb-inotify (0.10.0)
54
+ ffi (~> 1.0)
55
+ rdoc (6.2.0)
56
+ rspec (3.9.0)
57
+ rspec-core (~> 3.9.0)
58
+ rspec-expectations (~> 3.9.0)
59
+ rspec-mocks (~> 3.9.0)
60
+ rspec-core (3.9.0)
61
+ rspec-support (~> 3.9.0)
62
+ rspec-expectations (3.9.0)
63
+ diff-lcs (>= 1.2.0, < 2.0)
64
+ rspec-support (~> 3.9.0)
65
+ rspec-mocks (3.9.0)
66
+ diff-lcs (>= 1.2.0, < 2.0)
67
+ rspec-support (~> 3.9.0)
68
+ rspec-support (3.9.0)
69
+ shellany (0.0.1)
70
+ simplecov (0.16.1)
71
+ docile (~> 1.1)
72
+ json (>= 1.8, < 3)
73
+ simplecov-html (~> 0.10.0)
74
+ simplecov-html (0.10.2)
75
+ sync (0.5.0)
76
+ term-ansicolor (1.7.1)
77
+ tins (~> 1.0)
78
+ thor (0.20.3)
79
+ tins (1.23.0)
80
+ sync
81
+
82
+ PLATFORMS
83
+ ruby
84
+
85
+ DEPENDENCIES
86
+ alimentos_diego_algomas!
87
+ bundler (~> 2.0)
88
+ coveralls
89
+ guard
90
+ guard-bundler
91
+ guard-rspec
92
+ rake (~> 10.0)
93
+ rdoc
94
+ rspec (~> 3.0)
95
+
96
+ BUNDLED WITH
97
+ 2.0.2
@@ -0,0 +1,83 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ guard :bundler do
19
+ require 'guard/bundler'
20
+ require 'guard/bundler/verify'
21
+ helper = Guard::Bundler::Verify.new
22
+
23
+ files = ['Gemfile']
24
+ files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
25
+
26
+ # Assume files are symlinked from somewhere
27
+ files.each { |file| watch(helper.real_path(file)) }
28
+ end
29
+
30
+ # Note: The cmd option is now required due to the increasing number of ways
31
+ # rspec may be run, below are examples of the most common uses.
32
+ # * bundler: 'bundle exec rspec'
33
+ # * bundler binstubs: 'bin/rspec'
34
+ # * spring: 'bin/rspec' (This will use spring if running and you have
35
+ # installed the spring binstubs per the docs)
36
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
37
+ # * 'just' rspec: 'rspec'
38
+
39
+ guard :rspec, cmd: "bundle exec rspec" do
40
+ require "guard/rspec/dsl"
41
+ dsl = Guard::RSpec::Dsl.new(self)
42
+
43
+ # Feel free to open issues for suggestions and improvements
44
+ watch(%r{^lib/alimentos/(.+)\.rb$}) {dsl.rspec.spec_dir}
45
+ # RSpec files
46
+ rspec = dsl.rspec
47
+ watch(rspec.spec_helper) { rspec.spec_dir }
48
+ watch(rspec.spec_support) { rspec.spec_dir }
49
+ watch(rspec.spec_files)
50
+
51
+ # Ruby files
52
+ ruby = dsl.ruby
53
+ dsl.watch_spec_files_for(ruby.lib_files)
54
+
55
+
56
+ # Rails files
57
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
58
+ dsl.watch_spec_files_for(rails.app_files)
59
+ dsl.watch_spec_files_for(rails.views)
60
+
61
+ watch(rails.controllers) do |m|
62
+ [
63
+ rspec.spec.call("routing/#{m[1]}_routing"),
64
+ rspec.spec.call("controllers/#{m[1]}_controller"),
65
+ rspec.spec.call("acceptance/#{m[1]}")
66
+ ]
67
+ end
68
+
69
+ # Rails config changes
70
+ watch(rails.spec_helper) { rspec.spec_dir }
71
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
72
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
73
+
74
+ # Capybara features specs
75
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
76
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
77
+
78
+ # Turnip features and steps
79
+ watch(%r{^spec/acceptance/(.+)\.feature$})
80
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
81
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
82
+ end
83
+ end
@@ -0,0 +1,57 @@
1
+ # Alimentos
2
+ [![Coverage Status](https://coveralls.io/repos/github/diego-algomas/alimentos-lpp/badge.svg?branch=master)](https://coveralls.io/github/diego-algomas/alimentos-lpp?branch=master)
3
+ [![Build Status](https://travis-ci.com/diego-algomas/alimentos-lpp.svg?branch=master)](https://travis-ci.com/diego-algomas/alimentos-lpp)
4
+
5
+ Gema creada por Diego Machín Guardia
6
+ Práctica 6 de LPP
7
+
8
+ ## Descripción
9
+
10
+ En esta gema está creada para almacenar la información relacionada a cada uno de los alimentos. En las pruebas se encuentran distintas pruebas del buen funcionamiento de la clase. Por otro lado esta gema ha sido desarrollada usando el desarrollo por pruebas
11
+
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'alimentos'
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ $ bundle
24
+
25
+ Or install it yourself as:
26
+
27
+ $ gem install alimentos
28
+
29
+ ## Desarrollo
30
+
31
+ El primer paso de la ejecución consistirá en crear la estructura de los ficheros usando el bundle y aprovechando para crear una gema. Esto se hará ejecutando el siguiente comando:
32
+ bundle gem alimentos
33
+ A continuación editaremos el fichero de alimentos.gemspec donde actualizaremos la información para que corresponda con la de la aplicación y se ejecutará el bundle install para instalar todas las dependencias necesarias.
34
+
35
+ La creación de esta gema ha sido realizada usando la técnica de TDD en la cual primero se crean las pruebas y a continuación se realizará el código necesario para que pase la prueba. Es por ello que cualquier cambio en el código se puede comprobar el buen funcionamiento de la gema gracias a todas las pruebas creadas. Para lanzar todas las pruebas se realiza el `rake` el cual lanza por defecto todas las pruebas.
36
+
37
+
38
+ # Práctica 7
39
+
40
+ ## Clase List
41
+
42
+ Para esta tarea se ha implementado dentro del directorio lib/alimentos un modulo donde se incluye la clase Lista. En esta clase se define los métodos de una lista doblemente enlazada en la cual se almacena la longitud la cabeza y además es iterable en toda ella gracias al módulo enumerable.
43
+
44
+ En el directorio rspec a continuación de lsa pruebas de la clase alimento se encuentras las pruebas para la clase lista y el resto de las pruebas para comprobar el buen funcionamiento de la clase. Todo esto hecho siguiendo el TDD.
45
+
46
+ ## Pruebas de las Dietas
47
+
48
+ Para las pruebas de las emisiones y el espacio dañado por cada una de las dietas se ha procedido a crear una variable dieta donde se alamacenan todos los alimentos que tiene esa dieta. Como cada alimento guarda los datos para 100 g de alimento se han hecho los calculos para aproximar la ingesta de calorías necesarias entre un hombre y una mujer siguiendo cada una de las dietas propuestas: española, vasca, vegetariana,vegetaria y carnívora. Es por ello que cada uno de los alimentos de esta lista respeta los porcentajes de cada una de éstas dietas además de cumplir la ingesta calórica necesaria para un día.
49
+
50
+ ## P8
51
+
52
+ Cabe destacar la clase Menu y la clase plato. La clase Menu incluye una lista de platos donde cada plato es una clase que contiene varios alimentos con sus correspondientes cantidades.
53
+ La clase menú es enumerable y comparable así como la clase plato es enumerable.
54
+
55
+ ## P9
56
+ La documentación de todo el repositorio puede ser consultada en
57
+ https://diego-algomas.github.io/Documentacion-Alimentos/index.html
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,38 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "alimentos/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "alimentos_diego_algomas"
7
+ spec.version = Alimentos::VERSION
8
+ spec.authors = ["alu0101029993@ull.edu.es"]
9
+ spec.email = ["alu0101029993@ull.edu.es"]
10
+
11
+ spec.summary = %q{Representación de los alimentos}
12
+ spec.description = %q{Permite crear y realizar operaciones con la representación de los alimentos}
13
+ spec.homepage = "https://rubygems.org"
14
+
15
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = "https://rubygems.org"
19
+ spec.metadata["changelog_uri"] = "https://rubygems.org"
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ end
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_development_dependency "bundler", "~> 2.0"
31
+ spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_development_dependency "rspec", "~> 3.0"
33
+ spec.add_development_dependency "guard"
34
+ spec.add_development_dependency "guard-rspec"
35
+ spec.add_development_dependency "guard-bundler"
36
+ spec.add_development_dependency "rdoc"
37
+ spec.add_development_dependency "coveralls"
38
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "alimentos"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,115 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>module Alimentos - 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/navigation.js" defer></script>
15
+ <script src="./js/search.js" defer></script>
16
+ <script src="./js/search_index.js" defer></script>
17
+ <script src="./js/searcher.js" defer></script>
18
+ <script src="./js/darkfish.js" defer></script>
19
+
20
+ <link href="./css/fonts.css" rel="stylesheet">
21
+ <link href="./css/rdoc.css" rel="stylesheet">
22
+
23
+
24
+
25
+
26
+ <body id="top" role="document" class="module">
27
+ <nav role="navigation">
28
+ <div id="project-navigation">
29
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
30
+ <h2>
31
+ <a href="./index.html" rel="home">Home</a>
32
+ </h2>
33
+
34
+ <div id="table-of-contents-navigation">
35
+ <a href="./table_of_contents.html#pages">Pages</a>
36
+ <a href="./table_of_contents.html#classes">Classes</a>
37
+ <a href="./table_of_contents.html#methods">Methods</a>
38
+ </div>
39
+ </div>
40
+
41
+ <div id="search-section" role="search" class="project-section initially-hidden">
42
+ <form action="#" method="get" accept-charset="utf-8">
43
+ <div id="search-field-wrapper">
44
+ <input id="search-field" role="combobox" aria-label="Search"
45
+ aria-autocomplete="list" aria-controls="search-results"
46
+ type="text" name="search" placeholder="Search" spellcheck="false"
47
+ title="Type to search, Up and Down to navigate, Enter to load">
48
+ </div>
49
+
50
+ <ul id="search-results" aria-label="Search Results"
51
+ aria-busy="false" aria-expanded="false"
52
+ aria-atomic="false" class="initially-hidden"></ul>
53
+ </form>
54
+ </div>
55
+
56
+ </div>
57
+
58
+
59
+
60
+ <div id="class-metadata">
61
+
62
+
63
+
64
+
65
+
66
+ </div>
67
+ </nav>
68
+
69
+ <main role="main" aria-labelledby="module-Alimentos">
70
+ <h1 id="module-Alimentos" class="module">
71
+ module Alimentos
72
+ </h1>
73
+
74
+ <section class="description">
75
+
76
+ <p>Modulo donde se encuentra la clase de alimentos</p>
77
+
78
+ </section>
79
+
80
+
81
+ <section id="5Buntitled-5D" class="documentation-section">
82
+
83
+
84
+
85
+
86
+
87
+ <section class="constants-list">
88
+ <header>
89
+ <h3>Constants</h3>
90
+ </header>
91
+ <dl>
92
+
93
+ <dt id="VERSION">VERSION
94
+
95
+ <dd>
96
+
97
+
98
+ </dl>
99
+ </section>
100
+
101
+
102
+
103
+
104
+
105
+ </section>
106
+
107
+ </main>
108
+
109
+
110
+ <footer id="validator-badges" role="contentinfo">
111
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
112
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.0.
113
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
114
+ </footer>
115
+