Bibliografia.alu0100816167 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6fa58dbce0ba15557b4cd947b48f9d94c5217385
4
+ data.tar.gz: 94200cffbfd4a05a5db535e68894e4119fdf936f
5
+ SHA512:
6
+ metadata.gz: 00563f038b2d0a7976641b800c59e637bb8fe270b953b2c99de6e24c68724a3fe59f89d674c3fec9879187c4b5817c10cacac93b22c3ed3ed2b7b830f0948b90
7
+ data.tar.gz: b5b06313c4daac1927889323142eaa930ed38acb57d2ee7d3dbeb9bb1b4a1885388019044c22a475cc57e14efeeea57508dda7d3b20c8cf047a709e9c48bb5dc
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .~
11
+ *~
12
+ *.class
13
+ *old
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format progress
3
+ --format doc
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0-p247
4
+ - 1.9.3
5
+ - jruby-19mode # JRuby in 1.9 mode
6
+ - rbx
7
+ # uncomment this line if your project needs to run something other than `rake`:
8
+ script: bundle exec rspec spec
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'Bibliografia/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "Bibliografia.alu0100816167"
8
+ spec.version = Bibliografia::VERSION
9
+ spec.authors = [" Carlos de Armas Hernández"]
10
+ spec.email = ["alu0100816167@ull.edu.es"]
11
+
12
+ if spec.respond_to?(:metadata)
13
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
14
+ end
15
+
16
+ spec.summary = %q{Practica 11}
17
+ spec.description = %q{Lenguajes y paradigmas de la programación}
18
+ spec.license = "MIT"
19
+
20
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.8"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rspec", "~> 2.11"
28
+ spec.add_development_dependency "guard"
29
+ #spec.add_development_dependency "guard-rspec"
30
+ #spec.add_development_dependency "guard-bundler"
31
+ spec.add_development_dependency "coveralls"
32
+
33
+
34
+ end
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in Bibliografia.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,82 @@
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.exists?(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
+
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
+ # Rails files
56
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
57
+ dsl.watch_spec_files_for(rails.app_files)
58
+ dsl.watch_spec_files_for(rails.views)
59
+
60
+ watch(rails.controllers) do |m|
61
+ [
62
+ rspec.spec.("routing/#{m[1]}_routing"),
63
+ rspec.spec.("controllers/#{m[1]}_controller"),
64
+ rspec.spec.("acceptance/#{m[1]}")
65
+ ]
66
+ end
67
+
68
+ # Rails config changes
69
+ watch(rails.spec_helper) { rspec.spec_dir }
70
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
71
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
72
+
73
+ # Capybara features specs
74
+ watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
75
+ watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
76
+
77
+ # Turnip features and steps
78
+ watch(%r{^spec/acceptance/(.+)\.feature$})
79
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
80
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
81
+ end
82
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Juan Ignacio Hita Manso
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # Practica 9 - LPP
2
+ ==================
3
+
4
+ ##Carlos de Armas Hernández
5
+
6
+
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new
5
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "Bibliografia"
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
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,7 @@
1
+ require "Bibliografia/version"
2
+ require 'Bibliografia/Bibliografia'
3
+ require 'Bibliografia/list'
4
+
5
+ module Bibliografia
6
+ # Your code goes here...
7
+ end
@@ -0,0 +1 @@
1
+ service_name: travis-ci
@@ -0,0 +1,310 @@
1
+ module Bibliografia
2
+ class Bibliografia
3
+ attr_accessor :titulo, :autor, :fecha_publicacion
4
+
5
+ include Comparable
6
+
7
+ def initialize(titulo, &bloque)
8
+ self.autor= []
9
+ self.fecha_publicacion= []
10
+ self.titulo= titulo
11
+
12
+
13
+ if block_given?
14
+ if block.arity == 1
15
+ yield self
16
+ else
17
+ instance_eval &bloque
18
+ end
19
+ end
20
+ end
21
+
22
+ def <=>(other)
23
+ #return nil unless other.kind_of? Bibliografia::Bibliografia
24
+
25
+ #return nil unless other.kind_of? Bibliografia::Bibliografia
26
+ if((@autor == other.autor)== 0)
27
+ if((@fecha_publicacion <=> other.fecha_publicacion)==0)
28
+ @titulo <=> other.titulo
29
+ else
30
+ @fecha_publicacion <=> other.fecha_publicacion
31
+ end
32
+ else
33
+ @autor <=> other.autor
34
+
35
+ end
36
+ end
37
+
38
+
39
+
40
+ #def to_s()
41
+
42
+ #end
43
+
44
+ end
45
+
46
+
47
+
48
+
49
+ class Libro < Bibliografia
50
+ attr_accessor :edicion, :volumen, :lpublicacion, :editor
51
+ def initialize(titulo, &bloque)
52
+
53
+ @autor = []
54
+ @fecha_publicacion = []
55
+ @titulo = titulo
56
+ @edicion = []
57
+ @volumen = []
58
+ @lpublicacion = []
59
+ @editor= []
60
+
61
+ if block_given?
62
+ if bloque.arity == 1
63
+ yield self
64
+ else
65
+ instance_eval &bloque
66
+ end
67
+ end
68
+
69
+
70
+ end
71
+
72
+ def author(text, options = {})
73
+ author= text
74
+ author << " (#{options[:a_total]})" if options[:a_total]
75
+ autor << author
76
+ end
77
+
78
+ def date(text, options = {})
79
+ date= text
80
+ date << " (#{options[:a_date]})" if options[:a_date]
81
+ fecha_publicacion << date
82
+
83
+ end
84
+
85
+ def title(text, options = {})
86
+ title= text
87
+ title << " (#{options[:a_title]})" if options[:a_title]
88
+ titulo << title
89
+ end
90
+
91
+ def edition(text, options = {})
92
+ edition= text
93
+ edition << " (#{options[:n_editions]})" if options[:n_editions]
94
+ edicion << edition
95
+ end
96
+
97
+ def vols(text, options = {})
98
+ vols = text
99
+ vols << " (#{options[:n_vols]})" if options[:n_vols]
100
+ volumen << vols
101
+ end
102
+
103
+ def place(text, options = {})
104
+ place= text
105
+ edition << " (#{options[:a_place]})" if options[:a_place]
106
+ lpublicacion << place
107
+ end
108
+
109
+ def ed(text, options= {})
110
+ ed= text
111
+ ed << " (#{options[:a_ed]})" if options[:a_ed]
112
+ editor << ed
113
+ end
114
+
115
+ def to_s()
116
+ salida= titulo
117
+ salida << ", #{autor.join(', ')}, #{fecha_publicacion.join(', ')}, #{edicion.join(', ')}, #{volumen.join(', ')}, #{lpublicacion.join(', ')}, #{editor.join(', ')}\n\n"
118
+
119
+ salida
120
+ end
121
+
122
+
123
+ end
124
+
125
+ class Articulo < Bibliografia
126
+ attr_accessor :eds, :titulo2, :pags, :edicion, :volumen, :lpublicacion, :editor
127
+ def initialize(titulo, &bloque)
128
+
129
+ @autor = []
130
+ @fecha_publicacion = []
131
+ @titulo = titulo
132
+ @eds = []
133
+ @titulo2 = []
134
+ @pags = []
135
+ @edicion = []
136
+ @volumen = []
137
+ @lpublicacion = []
138
+ @editor = []
139
+
140
+ if block_given?
141
+ if bloque.arity == 1
142
+ yield self
143
+ else
144
+ instance_eval &bloque
145
+ end
146
+ end
147
+
148
+ end
149
+
150
+ def author(text, options = {})
151
+ author= text
152
+ author << " (#{options[:a_total]})" if options[:a_total]
153
+ autor << author
154
+ end
155
+
156
+ def date(text, options = {})
157
+ date= text
158
+ date << " (#{options[:a_date]})" if options[:a_date]
159
+ fecha_publicacion << date
160
+
161
+ end
162
+
163
+ def title(text, options = {})
164
+ title= text
165
+ title << " (#{options[:a_title]})" if options[:a_title]
166
+ titulo << title
167
+ end
168
+
169
+ def title2(text, options = {})
170
+ title2= text
171
+ title2 << " (#{options[:a_title]})" if options[:a_title]
172
+ titulo2 << title2
173
+ end
174
+
175
+
176
+ def edition(text, options = {})
177
+ edition = text
178
+ edition << " (#{options[:n_editions]})" if options[:n_editions]
179
+ edicion << edition
180
+ end
181
+
182
+
183
+ def vols(text, options = {})
184
+ vols = text
185
+ vols << " (#{options[:n_vols]})" if options[:n_vols]
186
+ volumen << vols
187
+ end
188
+
189
+ def place(text, options = {})
190
+ place= text
191
+ place << " (#{options[:a_place]})" if options[:a_place]
192
+ lpublicacion << place
193
+ end
194
+
195
+ def eds(text, options= {})
196
+ eds = text
197
+ eds << " (#{options[:a_eds]})" if options[:a_eds]
198
+ editor << eds
199
+ end
200
+
201
+ def the_editor(text, options= {})
202
+ the_editor = text
203
+ the_editor << " (#{options[:a_editeur]})" if options[:a_editeur]
204
+ editor << the_editor
205
+ end
206
+
207
+ def pages(text, options= {})
208
+ pages = text
209
+ pages << " (#{options[:a_editeur]})" if options[:a_editeur]
210
+ editor << pages
211
+ end
212
+
213
+ def to_s()
214
+ salida= titulo
215
+
216
+ salida << ", #{autor.join(', ')}, #{fecha_publicacion.join(', ')}, #{titulo2.join(', ')}, #{editor.join(', ')}, #{edicion.join(', ')}, #{volumen.join(', ')}, #{lpublicacion.join(', ')}\n\n"
217
+
218
+ salida
219
+ end
220
+
221
+ end
222
+
223
+ class Edoc < Bibliografia
224
+ attr_accessor :edicion, :tipo_medio, :lpublicacion, :editor, :source, :fechacceso
225
+ def initialize(titulo, &bloque)
226
+ @autor = []
227
+ @fecha_publicacion = []
228
+ @titulo = titulo
229
+ @edicion = []
230
+ @tipo_medio = []
231
+ @lpublicacion = []
232
+ @editor = []
233
+ @source = []
234
+ @fechacceso = []
235
+
236
+ if block_given?
237
+ if bloque.arity == 1
238
+ yield self
239
+ else
240
+ instance_eval &bloque
241
+ end
242
+ end
243
+ end
244
+
245
+ def author(text, options = {})
246
+ author= text
247
+ author << " (#{options[:a_total]})" if options[:a_total]
248
+ autor << author
249
+ end
250
+
251
+ def date(text, options = {})
252
+ date= text
253
+ date << " (#{options[:a_date]})" if options[:a_date]
254
+ fecha_publicacion << date
255
+
256
+ end
257
+
258
+ def title(text, options = {})
259
+ title= text
260
+ title << " (#{options[:a_title]})" if options[:a_title]
261
+ titulo << title
262
+ end
263
+
264
+ def edition(text, options = {})
265
+ edition = text
266
+ edition << " (#{options[:n_editions]})" if options[:n_editions]
267
+ edicion << edition
268
+ end
269
+
270
+ def place(text, options = {})
271
+ place = text
272
+ place << " (#{options[:a_place]})" if options[:a_place]
273
+ lpublicacion << place
274
+ end
275
+
276
+ def the_editor(text, options= {})
277
+ the_editor = text
278
+ the_editor << " (#{options[:a_editeur]})" if options[:a_editeur]
279
+ editor << the_editor
280
+ end
281
+
282
+ def access(text, options= {})
283
+ access = text
284
+ access << " (#{options[:a_access]})" if options[:a_access]
285
+ fechacceso << access
286
+ end
287
+
288
+ def fuente(text, options= {})
289
+ fuente = text
290
+ fuente<< " (#{options[:a_fuente]})" if options[:a_fuente]
291
+ source << fuente
292
+ end
293
+
294
+ def media(text, options= {})
295
+ media = text
296
+ media<< " (#{options[:a_media]})" if options[:a_media]
297
+ tipo_medio << media
298
+ end
299
+
300
+ def to_s()
301
+ salida= titulo
302
+
303
+ salida << ", #{autor.join(', ')}, #{fecha_publicacion.join(', ')}, #{edicion.join(', ')}, #{tipo_medio.join(', ')}, #{lpublicacion.join(', ')}, #{editor.join(', ')}, #{source.join(', ')}, #{fechacceso.join(', ')}\n\n"
304
+
305
+ salida
306
+ end
307
+
308
+ end
309
+ end
310
+
@@ -0,0 +1,149 @@
1
+
2
+
3
+ Node= Struct.new(:prev, :value, :next)
4
+
5
+
6
+
7
+ module List
8
+
9
+ class List
10
+
11
+
12
+ include Enumerable
13
+ attr_accessor :inicio, :fin
14
+
15
+ def initialize()
16
+
17
+ @inicio= nil
18
+ @fin = nil
19
+ end
20
+
21
+
22
+ def extract_beg()
23
+
24
+ if (@inicio != nil)
25
+ aux= @inicio
26
+ @inicio= @inicio.next
27
+ return aux
28
+ else
29
+ return nil
30
+ end
31
+ end
32
+
33
+
34
+
35
+
36
+
37
+ def insert_single_beg(valor)
38
+
39
+ nodo = Node.new(nil, valor, nil)
40
+
41
+ if (@inicio == nil)
42
+ @inicio = nodo
43
+ @fin = nodo
44
+ else
45
+ aux = @inicio
46
+ @inicio = nodo
47
+ @inicio.next = aux
48
+ aux.prev = @inicio
49
+
50
+ end
51
+ end
52
+
53
+
54
+
55
+
56
+
57
+ def insert_end(valor)
58
+
59
+ nodo = Node.new(nil, valor,nil)
60
+ if(@fin == nil)
61
+ @fin = nodo
62
+ @inicio = nodo
63
+ else
64
+ aux = @fin
65
+ @fin = nodo
66
+ @fin.prev = aux
67
+ aux.next = @fin
68
+ end
69
+ end
70
+
71
+
72
+ def each
73
+ aux = @inicio
74
+ if (@inicio == nil and @fin == nil)
75
+
76
+ yield nil
77
+
78
+ elsif (@inicio == @fin)
79
+
80
+ yield @inicio.value
81
+
82
+ else
83
+ while(aux != nil)
84
+ yield aux.value
85
+ aux = aux.next
86
+ end
87
+ end
88
+ end
89
+
90
+
91
+
92
+
93
+ def extract_end() #Extraer al final
94
+ if(@fin != nil)
95
+ aux= @fin
96
+ @fin= @fin.prev
97
+ return aux
98
+ else
99
+ return nil
100
+ end
101
+
102
+ end
103
+
104
+
105
+
106
+
107
+ def insert_multiple_beg(nodos) #insertar multiple al principio
108
+ nodos.each do |element|
109
+ insert_single_beg(element)
110
+ end
111
+ end
112
+
113
+ def insert_multiple_end(nodos) #Insertar multiple al final
114
+ nodos.each do |element|
115
+ insert_single_end(element)
116
+ end
117
+ end
118
+
119
+
120
+
121
+
122
+ def empty() #Comprueba si la lista esta vacia
123
+
124
+ if(@inicio == nil)
125
+ return true
126
+ else
127
+ return false
128
+ end
129
+
130
+ end
131
+
132
+
133
+ def to_s()
134
+
135
+ lista_ref = []
136
+ index= 0
137
+ while(@inicio != nil)
138
+ lista_ref1= @inicio.value.to_s()
139
+ lista_ref[index]= lista_ref1
140
+ @inicio= @inicio.next
141
+ index += 1
142
+ end
143
+ lista_ref
144
+ end
145
+
146
+
147
+ end
148
+
149
+ end
@@ -0,0 +1,56 @@
1
+ class Recipe
2
+ attr_accessor :name, :ingredients, :instructions
3
+
4
+ def initialize(name, &block)
5
+ self.name = name
6
+ self.ingredients = []
7
+ self.instructions = []
8
+
9
+ if block_given?
10
+ if block.arity == 1
11
+ yield self
12
+ else
13
+ instance_eval &block
14
+ end
15
+ end
16
+ end
17
+
18
+ def to_s
19
+ output = name
20
+ output << "\n#{'=' * name.size}\n\n"
21
+ output << "Ingredients: #{ingredients.join(', ')}\n\n"
22
+
23
+ instructions.each_with_index do |instruction, index|
24
+ output << "#{index + 1}) #{instruction}\n"
25
+ end
26
+
27
+ output
28
+ end
29
+
30
+ def ingredient(name, options = {})
31
+ ingredient = name
32
+ ingredient << " (#{options[:amount]})" if options[:amount]
33
+
34
+ ingredients << ingredient
35
+ end
36
+
37
+ def step(text, options = {})
38
+ instruction = text
39
+ instruction << " (#{options[:during]})" if options[:during]
40
+
41
+ instructions << instruction
42
+ end
43
+ end
44
+
45
+ mac_and_cheese = Recipe.new("Noodles and Cheese") do
46
+ ingredient "Water", :amount => "2 cups"
47
+ ingredient "Noodles", :amount => "1 cup"
48
+ ingredient "Cheese", :amount => "1/2 cup"
49
+
50
+ step "Heat water to boiling.", :during => "5 minutes"
51
+ step "Add noodles to boiling water.", :during => "6 minutes"
52
+ step "Drain water."
53
+ step "Mix cheese in with noodles."
54
+ end
55
+
56
+ puts mac_and_cheese
@@ -0,0 +1,6 @@
1
+ Gabriel Garcia Marquez
2
+ De viaje por Europa del Este
3
+ Editorial: Random House
4
+ Fecha de publicación: 2015
5
+ ISBN: 23231
6
+ Referencia: 243424
@@ -0,0 +1,3 @@
1
+ module Bibliografia
2
+ VERSION = "0.2.0"
3
+ end
metadata ADDED
@@ -0,0 +1,134 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: Bibliografia.alu0100816167
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - " Carlos de Armas Hernández"
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-12-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.8'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.11'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.11'
55
+ - !ruby/object:Gem::Dependency
56
+ name: guard
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Lenguajes y paradigmas de la programación
84
+ email:
85
+ - alu0100816167@ull.edu.es
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".travis.yml"
93
+ - Bibliografia.gemspec
94
+ - CODE_OF_CONDUCT.md
95
+ - Gemfile
96
+ - Guardfile
97
+ - LICENSE.txt
98
+ - README.md
99
+ - Rakefile
100
+ - bin/console
101
+ - bin/setup
102
+ - lib/Bibliografia.rb
103
+ - lib/Bibliografia/.coveralls.yml
104
+ - lib/Bibliografia/Bibliografia.rb
105
+ - lib/Bibliografia/list.rb
106
+ - lib/Bibliografia/recipe.rb
107
+ - lib/Bibliografia/salida
108
+ - lib/Bibliografia/version.rb
109
+ homepage:
110
+ licenses:
111
+ - MIT
112
+ metadata:
113
+ allowed_push_host: https://rubygems.org
114
+ post_install_message:
115
+ rdoc_options: []
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ requirements: []
129
+ rubyforge_project:
130
+ rubygems_version: 2.5.1
131
+ signing_key:
132
+ specification_version: 4
133
+ summary: Practica 11
134
+ test_files: []